Question

I have a patch file (which somebody made with git format-patch HEAD~3 HEAD --stdout > his_last_3_commits.patch following more or less that site)

I would like to know how to list the content (I mean here the title of the commits) which are in that his_last_3_commits.patch ?

Was it helpful?

Solution 2

Here is the final command I did (thanks to answer by Gary Fixler and a forum) :

grep "^Subject:" his_last_3_commits.patch | sed "s/'/\\\\\\\\\\\'/g" | xargs --max-args=1 -I% php -r "echo iconv_mime_decode('%', 0, 'UTF-8');echo \"\n\";"

PS : if someone knows a git command which does that, don't hesistate to answer here.

OTHER TIPS

If you mean the commit messages, would this be enough?

grep "^Subject:" his_last_3_commits.patch

You'll only get the first line of each commit message, but if you're sticking with a good style for those, they'll be useful.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top