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

Re: [PATCH] fix show_entry() in tree-diff.c for TREE_IN_RECURSIVE

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 13, 2009, 23:42 UTC
Message-ID
<7v63ezvgyo.fsf@alter.siamese.dyndns.org>
In-Reply-To
<op.uvhcoii8tdk399@sirnot.private>
"Nick Edelen" <sirnot@gmail.com> writes:
> fix show_entry() in tree_diff.c to display tree entries on TREE_IN_RECURSIVE
s/fix/Fix/; s/$/./;
> Signed-off-by: Nick Edelen <sirnot@gmail.com>
> this seems like how it should act: trees are shown under this option for
> changes,...

Please show a sample input, the output you expect and the output from the current code, to illustrate the alleged breakage better.

For example. if you used to have files dc/1, dr/2, dt/3, fc, fr and ft and then removed dr/2, dt/3, fr, ft and added da/5, fa, dt and ft/4, you expect this output.

$ git diff -t -r --raw HEAD^ HEAD :000000 040000 0000000... a13e5ad... A da :000000 100644 0000000... ce01362... A da/5 :040000 040000 8dc877a... 40b5137... M dc :100644 100644 e69de29... ce01362... M dc/1 :040000 000000 f84fc27... 0000000... D dr :100644 000000 e69de29... 0000000... D dr/2 :000000 100644 0000000... ce01362... A dt :040000 000000 6e36c7d... 0000000... D dt :100644 000000 e69de29... 0000000... D dt/3 :000000 100644 0000000... ce01362... A fa :100644 100644 e69de29... ce01362... M fc :100644 000000 e69de29... 0000000... D fr :100644 000000 e69de29... 0000000... D ft :000000 040000 0000000... 9a1efba... A ft :000000 100644 0000000... ce01362... A ft/4

But because we show 040000 entries only for changed and typechange cases, we currently get this.

$ git diff -t -r --raw HEAD^ HEAD :000000 100644 0000000... ce01362... A da/5 :040000 040000 8dc877a... 40b5137... M dc :100644 100644 e69de29... ce01362... M dc/1 :100644 000000 e69de29... 0000000... D dr/2 :000000 100644 0000000... ce01362... A dt :100644 000000 e69de29... 0000000... D dt/3 :000000 100644 0000000... ce01362... A fa :100644 100644 e69de29... ce01362... M fc :100644 000000 e69de29... 0000000... D fr :100644 000000 e69de29... 0000000... D ft :000000 100644 0000000... ce01362... A ft/4

I think the output from the code after your change is more consistent, but I somehow suspect that this might break people's script, like gitweb, rather badly, if they depended on the existing behaviour.

Previous: Nick EdelenNext: Junio C Hamano
Message 2 of 4 in “fix show_entry() in tree-diff.c for TREE_IN_RECURSIVE”
  1. fix show_entry() in tree-diff.c for TREE_IN_RECURSIVENick Edelen, Jun 13, 2009
  2. Junio C HamanoJun 13, 2009
  3. Junio C HamanoJun 14, 2009
  4. Nick EdelenJun 14, 2009

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.