]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
scripts/c2p: hopefully removing trailing \n in changelogs
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 2 Feb 2021 14:57:20 +0000 (15:57 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 2 Feb 2021 14:57:20 +0000 (15:57 +0100)
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 <gregkh@linuxfoundation.org>
scripts/c2p

index 9cb65a67e2ade254c38f302e6e266687da5198fe..d75b24a5eee82e4ad286c73d892e147cf45f7780 100755 (executable)
@@ -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 = <GIT>) {
 
@@ -83,7 +84,7 @@ while ($line = <GIT>) {
 
        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 <gregkh\@linuxfoundation.org>\n";
                                $signed_off_by_complete = "true";
                                $signed_off_by_seen = "false";