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

Re: [PATCH] gitweb: Fix and simplify "split patch" detection

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 3, 2007, 00:15 UTC
Message-ID
<7vmyw4ob7z.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<200709022218.43042.jnareb@gmail.com>
Jakub Narebski <jnareb@gmail.com> writes:
Show 5 quoted lines
> Alternate solution, which we did chose, is to check when git splits
> patches, and do not check if parsed info from current patch corresponds
> to current or next raw diff format output line.  Git splits patches
> only for 'T' (typechange) status filepair, and there always two patches
> corresponding to one raw diff line.

Not that I can think of a better way offhand than what you already mentioned, but I have to say that I am not entirely happy with this implementation. A really old git showed two patches (one creation and one deletion) for "complete rewrite", which was corrected long time ago. I do not think we will change the typechange output in a similar way in the future, but relying on that level of detail feels somewhat ugly.

As you are reading from --patch-with-raw, you already know the order of patches that will be given to you when you finished reading the "raw" part. The patches will come in the same order. So it might be possible to keep track of patches to what path you are expecting and decide if it is part of what you are processing at the point you process "diff --git" line.

Previous: Jakub NarebskiNext: Jakub Narebski
Message 2 of 4 in “gitweb: Fix and simplify "split patch" detection”
  1. gitweb: Fix and simplify "split patch" detectionJakub Narebski, Sep 2, 2007
  2. Junio C HamanoSep 3, 2007
  3. Jakub NarebskiSep 3, 2007
  4. Junio C HamanoSep 3, 2007

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.