gitformat-patch

Git: How to list the commits of a patch file


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 ?


Solution

  • 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.