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

Re: git-gui: more issues with diff parsing

From
Jakub Narebski <jnareb@gmail.com>
Date
Sep 12, 2008, 18:01 UTC
Message-ID
<m3ljxxnt09.fsf@localhost.localdomain>
In-Reply-To
<20080912152345.GE22960@spearce.org>
"Shawn O. Pearce" <spearce@spearce.org> writes:
Show 21 quoted lines
> The diff is weird:
> 
>   $ git-diff-index --cached -p --no-color -U5 \
>       d6e02aa06c91c711d98ae06e6e69c5de5841a5e5 -- g
>   diff --git a/g b/g
>   deleted file mode 100644
>   index e69de29..1a010b1
>   diff --git a/g b/g
>   new file mode 120000
>   index e69de29..1a010b1
>   --- /dev/null
>   +++ b/g
>   @@ -0,0 +1 @@
>   +file
>   \ No newline at end of file
> 
> Notice how we get two diffs for the same file?  That's why git-gui
> is choking on this particular change.  It expected only one diff
> for the path it gave to Git.  It got two back.  In cases like this
> we may not be able to support line or hunk application as the patch
> is really two different patches against that path.  :-|

Hmmm... it looks _exactly_ like a problem I had with writing "syntax highlighting" (and linkage) for the patchset part of 'commitdiff' and 'blobdiff' views, namely that typechange (file to symlink and vice versa) generates two patches for single difftree (raw diff format output) line.

See git_patchset_body in gitweb/gitweb.perl, and is_patch_split function, and commit message of 0cec6db (gitweb: Fix and simplify "split patch" detection), which tells about alternate solution.

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Junio C Hamano
Message 4 of 4 in “git-gui: more issues with diff parsing”
  1. Michele BallabioSep 9, 2008
  2. Shawn O. PearceSep 12, 2008
  3. Junio C HamanoSep 12, 2008
  4. Jakub NarebskiSep 12, 2008

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.