File tree Expand file tree Collapse file tree 1 file changed +19
-5
lines changed Expand file tree Collapse file tree 1 file changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -23,15 +23,30 @@ UPCOMING=$?
2323HEADER=" $1  ($( date ' +%B %d, %Y' )  )" 
2424echo  $HEADER  >>  newchanges
2525echo  $(  printf  " %${# HEADER} s"   |  tr "  "   " ="   )   >>  newchanges
26+ echo  >>  newchanges
2627
2728if  [[ " x$2 "   !=  " x"   ]];  then 
28- 	echo  " (\` Full changelog <https://github.com/nipy/nipype/milestone/$2 ?closed=1>\` __)"   >>  newchanges
29+     echo  " (\` Full changelog <https://github.com/nipy/nipype/milestone/$2 ?closed=1>\` __)"   >>  newchanges
30+     echo  >>  newchanges
2931fi 
3032
3133#  Search for PRs since previous release
32- git log --grep=" Merge pull request"   ` git describe --tags --abbrev=0`  ..HEAD --pretty=' format:  * %b %s'   |  sed  ' s+Merge pull request \#\([^\d]*\)\ from\ .*+(https://github.com/nipy/nipype/pull/\1)+'   >>  newchanges
33- echo  " "   >>  newchanges
34- echo  " "   >>  newchanges
34+ MERGE_COMMITS=$(  git log --grep=" Merge pull request\|(#.*)$"   ` git describe --tags --abbrev=0`  ..HEAD --pretty=' format:%h'   ) 
35+ for  COMMIT  in  ${MERGE_COMMITS// \n } ;  do 
36+     SUB=$(  git log -n 1 --pretty=" format:%s"   $COMMIT  ) 
37+     if  ( echo  $SUB  |  grep " ^Merge pull request"   );  then 
38+         #  Merge commit
39+         PR=$(  echo  $SUB  |  sed -e " s/Merge pull request \#\([0-9]*\).*/\1/"   ) 
40+         TITLE=$(  git log -n 1 --pretty=" format:%b"   $COMMIT  ) 
41+     else 
42+         #  Squashed merge
43+         PR=$(  echo  $SUB  |  sed -e " s/.*(\#\([0-9]*\))$/\1/"   ) 
44+         TITLE=$(  echo  $SUB  |  sed -e " s/\(.*\)(\#[0-9]*)$/\1/"   ) 
45+     fi 
46+     echo  "   * $TITLE  (https://github.com/nipy/nipype/pull/$PR )"   >>  newchanges
47+ done 
48+ echo  >>  newchanges
49+ echo  >>  newchanges
3550
3651#  Append old CHANGES
3752if  [[ " $UPCOMING "   ==  " 0"   ]];  then 
4358
4459#  Replace old CHANGES with new file
4560mv newchanges $CHANGES 
46- 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments