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

"git diff-index" broken in 'next'

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 11, 2008, 02:41 UTC
Message-ID
<7vk5kagexu.fsf_-_@gitster.siamese.dyndns.org>
In-Reply-To
<alpine.LFD.1.00.0803100735530.5896@woody.linux-foundation.org>

When you are in the middle of conflicted merge, it is useful to view "git diff" that compares the stage #2 and your work tree (which has conflict markers and both sides of the changes). This still works.

However, with the unpack_trees() update, another form of useful sanity check seems to be totally broken:

      $ git diff HEAD -- $conflicted_file

This used to show the diff between the HEAD and the work tree, but not anymore. It shows a diff as if the whole file is gone, and that is because diff-lib.c::oneway_diff() gets idx==NULL from the caller for unmerged entries. It never reaches show_modified() codepath.

I think it is somewhere around ll. 280 in unpack_callback() that causes this, but I don't have time to dig this further for now.

Previous: Linus TorvaldsNext: Linus Torvalds
Message 7 of 8 in “"git checkout" branch switching safety broken in 'next'”
  1. Junio C HamanoMar 10, 2008
  2. Jakub NarebskiMar 10, 2008
  3. Jay SoffianMar 10, 2008
  4. setting git-gui localeMaxim Fridental, Mar 11, 2008
  5. Johannes SchindelinMar 11, 2008
  6. Linus TorvaldsMar 10, 2008
  7. "git diff-index" broken in 'next'Junio C Hamano, Mar 11, 2008
  8. Linus TorvaldsMar 11, 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.