git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] filter-branch: strip pgp signature in commit messages

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Oct 8, 2015, 10:00 UTC
Message-ID
<56163ED6.2030403@drmicha.warpmail.net>
In-Reply-To
<56162C96.80108@drmicha.warpmail.net>
Michael J Gruber venit, vidit, dixit 08.10.2015 10:43:
Show 23 quoted lines
> Michael J Gruber venit, vidit, dixit 08.10.2015 10:15:
>> James McCoy venit, vidit, dixit 08.10.2015 07:01:
> ...
>> [No, this does not alleviate my dislike for the commit signature
>> implementation, and I have not checked the patch - the test looks good
>> to me, though.]
> 
> OK, now grumpy ol' Mike actually tested the patch with all our tests
> that filter-branch something. All is good, and the new test catches the
> regression when run without the patch.
> 
> I do think that the parser still has a problem that it had before
> already: it does not distinguish between an empty line and an all white
> space line (or else we didn't have a problem here at all).
> 
> In that sense, the patch is wrong, it does not correct the parser
> deficiency. But it alleviates it for the special case of embedded
> signatures, which currently is the only exceptional case that I am aware
> of. It's not guaranteed to stay like that, of course. So maybe, one
> should amend the commit message by saying that.
> 
> Michael
> 
... or do the right thing:
diff --git i/git-filter-branch.sh w/git-filter-branch.sh
index 5777947..27c9c54 100755
--- i/git-filter-branch.sh
+++ w/git-filter-branch.sh
@@ -377,7 +377,7 @@ while read commit parents; do
 	fi

 	{
-		while read -r header_line && test -n "$header_line"
+		while IFS='' read -r header_line && test -n "$header_line"
 		do
 			# skip header lines...
 			:;


Not tested for POSIX etc., maybe we need a bare IFS inside a {} block
instead. In any case, we need to tell read not to split by words.

Michael
Previous: Michael J GruberNext: James McCoy
Message 4 of 5 in “filter-branch: strip pgp signature in commit messages”
  1. filter-branch: strip pgp signature in commit messagesJames McCoy, Oct 8, 2015
  2. Michael J GruberOct 8, 2015
  3. Michael J GruberOct 8, 2015
  4. Michael J GruberOct 8, 2015
  5. James McCoyOct 8, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.