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

Re: What's cooking in git.git (Dec 2010, #06; Tue, 21)

From
Joshua Jensen <jjensen@workspacewhiz.com>
Date
Dec 24, 2010, 16:53 UTC
Message-ID
<4D14CFF2.9050705@workspacewhiz.com>
In-Reply-To
<AANLkTikaBfVw-4eD9qeGSdM5xKxq-gJ-3oAe4B2qt4od@mail.gmail.com>
----- Original Message -----
From: Nguyen Thai Ngoc Duy
Date: 12/23/2010 6:39 PM
Show 5 quoted lines
> If you have not known already, path in "git log ref -- path" must be
> case sensitive. Solving that is not hard: ce_path_match() and
> tree_entry_interesting() are the ones that do path matching. Those
> functions are nearly replaced in this series. I'll add
> case-insensitive support to them, so you can worry about other places.

As I recall (I'd have to examine other unsubmitted case insensitivity patches), merely adding case insensitivity support to ce_path_match() is not enough. The cache is stored alphabetically in a case sensitive fashion. That means filenames starting with 'A' are stored in a completely different place than filenames starting with 'a'. Certain parts of the code call ce_path_match() and then walk the cache sequentially for possible matches. It aborts long before hitting the 'a' filename.

I have a patch that appears to resolve most of these issues. For core.ignorecase=true, when the cache is read, it is re-sorted alphabetically in a case insensitive manner. ce_path_match() still needs fixes, but the rest were covered by the case insensitive cache. 'A' and 'a' are not interleaved, and the combination of sequential and binary(?) searches Git uses are successful. Finally, when the cache is written, I re-sort the cache in a case insensitive fashion.

Hmmm... I think this was also needed for the *_name_compare() functions, too.

Anyway, just something to consider.
Josh
Previous: Nguyen Thai Ngoc DuyNext: Nguyen Thai Ngoc Duy
Message 11 of 17 in “What's cooking in git.git (Dec 2010, #06; Tue, 21)”
  1. Junio C HamanoDec 22, 2010
  2. Thiago FarinaDec 22, 2010
  3. Andreas EricssonDec 22, 2010
  4. Junio C HamanoDec 22, 2010
  5. Thiago FarinaDec 22, 2010
  6. Heiko VoigtDec 23, 2010
  7. Nguyen Thai Ngoc DuyDec 23, 2010
  8. Junio C HamanoDec 23, 2010
  9. Joshua JensenDec 23, 2010
  10. Nguyen Thai Ngoc DuyDec 24, 2010
  11. Joshua JensenDec 24, 2010
  12. Nguyen Thai Ngoc DuyDec 25, 2010
  13. Junio C HamanoDec 24, 2010
  14. Joshua JensenDec 24, 2010
  15. Nguyen Thai Ngoc DuyDec 24, 2010
  16. Thomas RastDec 26, 2010
  17. Junio C HamanoDec 26, 2010

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.