Skip to content

Instantly share code, notes, and snippets.

@qinshulei
Created December 7, 2015 06:55
Show Gist options
  • Select an option

  • Save qinshulei/bbab8bf70c7cb30af417 to your computer and use it in GitHub Desktop.

Select an option

Save qinshulei/bbab8bf70c7cb30af417 to your computer and use it in GitHub Desktop.
get all patchs by grep and order it
output_dir=/home/qinshulei/gerrit_projects/jenkins/patch_out;num=1000;for i in $(git log --no-merges --grep=add --format="%h") ; do mkdir -p $output_dir; num=$((num - 1)); git format-patch -1 $i -o $output_dir --start-number $num;cd $output_dir;touch patch-commits-map.txt;temp=$(ls *$num-*);mv ${temp} ${temp%%-*}-${i}-${temp#*-};echo "$num $i">>patch-commits-map.txt; cd -;done;sort -n $output_dir/patch-commits-map.txt > $output_dir/patch-commits-map.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment