view raw
jedediah jedediah - 7 months ago 39
Git Question

git format-patch with a list file instead of numbered files

git format-patch
normally generates patch files named like this:


Instead, I want to generate patch filenames with commit messages, but no numbers:


and a single file that lists all the patches in the correct order.

I will also need an equivalent
git am
to apply these patches.

do this? And if not, how would you do it with scripts or whatever?


On Unix-like systems you can do this to remove an initial number up to the first -:

$ git format-patch  120c547..2b05980  | while read x; do mv "$x" $(echo "$x" | cut -d '-' -f2-); done

You can easily apply such patches with git am as this commands takes both mbox and Maildir - just cp all patches into a directory and tell git am to look for patches in this directory. For example:

$ git am /tmp/patches