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

Re: [PATCH/RFC] blame: respect "core.ignorecase"

From
Jeff King <peff@peff.net>
Date
Sep 10, 2012, 16:13 UTC
Message-ID
<20120910161325.GB9435@sigill.intra.peff.net>
In-Reply-To
<7v7gs3q9rp.fsf@alter.siamese.dyndns.org>
On Sun, Sep 09, 2012 at 12:24:58PM -0700, Junio C Hamano wrote:
Show 18 quoted lines
> Having said all that, I am not sure if the "fixing" is really the
> right approach to begin with.  Contrast these two:
> 
>     $ git blame MakeFILE
>     $ git blame HEAD -- MakeFILE
> 
> The latter, regardless of core.ignorecase, should fail, with "No
> such path MakeFILE in HEAD".  The former is merely an extension to
> the latter, in the sense that the main traversal is exactly the same
> as the latter, but on top, local modifications are blamed to the
> working tree.
> 
> If we were to do anything, I would think the most sane thing to do
> is a smaller patch to fix fake_working_tree_commit() where it calls
> lstat() and _should_ die with "Cannot lstat MakeFILE" on a sane
> filesystem.  It does not currently make sure the path exists in the
> HEAD exactly as given by the user (i.e. without core.ignorecase
> matching), and die when it is not found.

Yes, I think that is the only sensible thing here. The rest of this email is me essentially me agreeing with you and telling you things you already know, but I had a slightly different line of reasoning, so I thought I would share.

As far as the original patch, if you are going to change blame, then it is only logical to change the whole revision parser so that "git log -- MAKEFILE" works. And I do not think that is a direction we want to go.

core.ignorecase has never been about "make git case-insensitive". Git represents a case-sensitive tree, and will always do so because of the sha1 we compute over the tree objects. core.ignorecase is really "make case-sensitive git work around your case-insensitive filesystem"[1].

If the proposal were instead to add a certain type of pathspec that is case-insensitive[2], that would make much more sense to me. It is not violating git's case-sensitivity because it is purely a _query_ issue. And it is a feature you might use whether or not your filesystem is case sensitive.

-Peff
[1] I was going to submit a patch to Documentation/config.txt to make
    this more clear, but IMHO the current text is already pretty clear.
[2] I did not keep up with Duy's work on pathspec magic-prefixes (and I
    could not find anything relevant in the code or documentation), but
    it seems like this would be a logical feature to support there.
Previous: Ralf ThielowNext: Junio C Hamano
Message 7 of 12 in “blame: respect "core.ignorecase"”
  1. blame: respect "core.ignorecase"Ralf Thielow, Sep 9, 2012
  2. Johannes SixtSep 9, 2012
  3. Junio C HamanoSep 9, 2012
  4. Junio C HamanoSep 9, 2012
  5. blame: allow "blame file" in the middle of a conflicted mergeJunio C Hamano, Sep 11, 2012
  6. Ralf ThielowSep 10, 2012
  7. Jeff KingSep 10, 2012
  8. Junio C HamanoSep 10, 2012
  9. Jeff KingSep 10, 2012
  10. Junio C HamanoSep 10, 2012
  11. Jeff KingSep 10, 2012
  12. Junio C HamanoSep 10, 2012

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.