From: Greg Kroah-Hartman Date: Tue, 2 Feb 2021 14:57:20 +0000 (+0100) Subject: scripts/c2p: hopefully removing trailing \n in changelogs X-Git-Tag: v4.4.255~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2f308883c5f17dc4fb59fa13aef7196768055d9e;p=thirdparty%2Fkernel%2Fstable-queue.git scripts/c2p: hopefully removing trailing \n in changelogs As Lee helpfully pointed out, I was adding an extra \n in changelogs, which was messy for anyone wanting to cherry-pick patches afterward. Hopefully fix this up by routing patches through `git format-patch` and not `git show` and detecting the start of the diffstat. Signed-off-by: Greg Kroah-Hartman --- diff --git a/scripts/c2p b/scripts/c2p index 9cb65a67e2a..d75b24a5eee 100755 --- a/scripts/c2p +++ b/scripts/c2p @@ -56,7 +56,8 @@ $from = `git show --pretty=format:"%aN <%ae>" $base_id | head -n 1` || die "Fail $subj = `git show --pretty=format:"Subject: %s" $base_id | head -n 1` || die "Failed to run git to get subject"; open FILE, ">$tmpfile" || die "Failed to create $tmpfile"; -open GIT, "git show --pretty=email $base_id |" || die "Failed to run git"; +#open GIT, "git show --pretty=email $base_id |" || die "Failed to run git"; +open GIT, "git format-patch -n1 --no-numbered -k --stdout $base_id |" || die "Failed to run git"; while ($line = ) { @@ -83,7 +84,7 @@ while ($line = ) { if ($signed_off_by_seen eq "true") { if ($signed_off_by_complete eq "false") { - if ($line eq "\n") { + if ($line eq "\n" || $line eq "---\n") { print FILE "Signed-off-by: Greg Kroah-Hartman \n"; $signed_off_by_complete = "true"; $signed_off_by_seen = "false";