Re: Weird behaviour of git diff-index in container
From: Junio C Hamano <hidden>
Date: 2022-05-10 16:47:48
Jonathan Nieder [off-list ref] 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.
- 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-<.