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

[PATCH] git-contacts: do not fail parsing of good diffs

From
Lars Gullik Bjønnes <larsbj@gullik.org>
Date
Feb 15, 2014, 17:24 UTC
Message-ID
<m3wqgw2srh.fsf@black.gullik.net>

If a line in a patch starts with "--- " it will be deemed malformed unless it also contains the proper diff header format. This situation can happen with a valid patch if it has a line starting with "-- " and that line is removed.

This patch just removes the check in git-contacts.
Signed-off-by: Lars Gullik Bjønnes <larsbj@gullik.org>
---
 contrib/contacts/git-contacts | 2 --
 1 file changed, 2 deletions(-)
diff --git a/contrib/contacts/git-contacts b/contrib/contacts/git-contacts
index 428cc1a..dbe2abf 100755
--- a/contrib/contacts/git-contacts
+++ b/contrib/contacts/git-contacts
@@ -96,8 +96,6 @@ sub scan_patches {
                next unless $id;
                if (m{^--- (?:a/(.+)|/dev/null)$}) {
                        $source = $1;
-               } elsif (/^--- /) {
-                       die "Cannot parse hunk source: $_\n";
                } elsif (/^@@ -(\d+)(?:,(\d+))?/ && $source) {
                        my $len = defined($2) ? $2 : 1;
                        push @{$sources->{$source}{$id}}, [$1, $len] if $len;
-- 
1.9.0

-- 
	Lgb
Next: Junio C Hamano
Message 1 of 3 in “git-contacts: do not fail parsing of good diffs”
  1. git-contacts: do not fail parsing of good diffsLars Gullik Bjønnes, Feb 15, 2014
  2. Junio C HamanoFeb 18, 2014
  3. Lars Gullik BjønnesFeb 21, 2014

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.