From: Felipe Contreras Date: Sun, 7 Apr 2013 17:46:20 +0000 (-0500) Subject: format-patch: improve head calculation for cover-letter X-Git-Tag: v1.8.3-rc0~56^2~5 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/80d35ca0aaeca654562974be6ea528e22bc76e8c?ds=sidebyside;hp=80d35ca0aaeca654562974be6ea528e22bc76e8c format-patch: improve head calculation for cover-letter If we do it after the revision traversal we can be sure that this is indeed a commit that will be processed (i.e. not a merge) and it's the top most one (thus removing the NEEDSWORK comment, at least we show the same as 'git diff --stat' output that appears in the cover-letter). While we are at it, since we know there's nothing to generate, exit sooner in all cases, like --cover-letter currently does. Also, if there's nothing to generate and cover-letter is specified, a different code-path might be triggered that is not currently covered in the test-case, so add a test for it. Signed-off-by: Felipe Contreras Signed-off-by: Junio C Hamano ---