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

Re: problem with parsing of patch files for patch-id

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 13, 2024, 16:25 UTC
Message-ID
<xmqqh6ctb6oa.fsf@gitster.g>
In-Reply-To
<CAP0H_AGw2R6JPxd=8gAn0w1Fy6iY71LRkH+F7uHL0PVmE04B_g@mail.gmail.com>
Rob Linden <rlinden@redhat.com> writes:
Show 32 quoted lines
>> Rob Linden <rlinden@redhat.com> writes:
>>
>> > This patch (also attached) fixes it by only considering commit hashes
>> > in a "From xxxxx..." line:
>>
>> If I am not mistaken, "git patch-id" was designed to read from
>>
>>     git rev-list ... commit range ... | git diff-tree --stdin -p
>>
>> where we see
>>
>>     9005149a4a77e2d3409c6127bf4fd1a0893c3495
>>     diff --git a/path b/path
>>     index ...
>>     ... patch text here ...
>>
>> so I would suspect that limiting the commit object names only to
>> those that follow "From " (i.e. the format-patch output or output
>> with the "--format=email" option) would break existing use cases big
>> time.
> ...
> Hello Junio!
> Thanks for the clue, You're right... I only work with the email format
> so I didn't think of that.
> My solution doesn't work then...
> I had a different idea first: to check if we already got an oid and
> only read a new one once
> the current diff is finished (and wasn't empty so far). The other one
> seemed just simpler.
> I will try again...
> Thanks & all the best,
> rob

Since then I sent a series [*] that was designed to address the issue you raised here, but unfortunately nobody seems to have paid attention and the patches are left hanging. It is part of my 'seen' branch and in the broken-out format parked on the jc/patch-id branch in the https://github.com/gitster/git/ repository, ending with the commit 3226bd87 (patch-id: tighten code to detect the patch header, 2024-06-21).

If you can test (and if possible code review) them, that may help the series to move forward.

Thanks.
[Reference]
 * https://lore.kernel.org/git/20240621231826.3280338-1-gitster@pobox.com/
Previous: Rob LindenNext: Junio C Hamano
Message 4 of 5 in “problem with parsing of patch files for patch-id”
  1. Rob LindenJun 21, 2024
  2. Junio C HamanoJun 21, 2024
  3. Rob LindenJun 21, 2024
  4. Junio C HamanoJul 13, 2024
  5. Junio C HamanoJun 21, 2024

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.