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

Re: Weird behaviour of git diff-index in container

From
Junio C Hamano <gitster@pobox.com>
Date
May 10, 2022, 16:47 UTC
Message-ID
<xmqq8rr98hci.fsf@gitster.g>
In-Reply-To
<YnnRIq3kudurSq4c@google.com>
Jonathan Nieder <jrnieder@gmail.com> writes:
> I love this example.  Thanks for writing.
I guess our mails crossed ;-)
> Some places I expected to find an explanation of this:
>
> - documentation for the "git diff-index" command ("git help
>   diff-index").  It does not mention this behavior.

Yes, diff-index and diff-files should at least have a pointer to "update-index --refresh". Ideally they should share a write-up based on what both of us covered in these responses.

Show 5 quoted lines
> - documentation for the "git diff" command ("git help diff").  It also
>   doesn't mention this.  That's particularly surprising because it
>   would be a great place to document the diff.autoRefreshIndex setting
>   that affects this behavior of the "git diff" command (described in
>   Documentation/config/diff.txt).

And the autorefreshindex documentation is a tad stale (it is on by default these days) and does not say why you would want it. I do not mind config/diff.txt having it, but that should eventually refer to the same page that is designed to help the readers of the diff-index and diff-files documentation.

I do not think anywhere else the missing info belongs to, but stepping back a bit, it may help to have a write up on scripting using the plumbing commands in general, not limited to "diff-*" family of commands. I actually am torn a bit, as we have long neglected to give matching improvement to plumbing commands when we add shiny new toys to commands at the Porcelain level, so Git may have grown much more hostile to scripters over the years X-<.

Previous: Jonathan Nieder
Message 4 of 4 in “Weird behaviour of git diff-index in container”
  1. Timo FunkeMay 9, 2022
  2. Junio C HamanoMay 9, 2022
  3. Jonathan NiederMay 10, 2022
  4. Junio C HamanoMay 10, 2022

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.