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

[PATCH 5/7] Add support for case insensitive directory and file lookups to git log

From
Joshua Jensen <jjensen@workspacewhiz.com>
Date
May 21, 2010, 04:50 UTC
Message-ID
<1274417435-2344-6-git-send-email-jjensen@workspacewhiz.com>
In-Reply-To
<1274417435-2344-1-git-send-email-jjensen@workspacewhiz.com>
This patch also affects any other commands that use tree-diff.c.
Signed-off-by: Joshua Jensen <jjensen@workspacewhiz.com>
---
 tree-diff.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/tree-diff.c b/tree-diff.c
index fe9f52c..5110980 100644
--- a/tree-diff.c
+++ b/tree-diff.c
@@ -5,6 +5,7 @@
 #include "diff.h"
 #include "diffcore.h"
 #include "tree.h"
+#include "dir.h"
 
 static char *malloc_base(const char *base, int baselen, const char *path, int pathlen)
 {
@@ -114,7 +115,7 @@ static int tree_entry_interesting(struct tree_desc *desc, const char *base, int
 
 		if (baselen >= matchlen) {
 			/* If it doesn't match, move along... */
-			if (strncmp(base, match, matchlen))
+			if (strncmp_icase(base, match, matchlen))
 				continue;
 
 			/*
@@ -131,7 +132,7 @@ static int tree_entry_interesting(struct tree_desc *desc, const char *base, int
 		}
 
 		/* Does the base match? */
-		if (strncmp(base, match, baselen))
+		if (strncmp_icase(base, match, baselen))
 			continue;
 
 		match += baselen;
@@ -147,7 +148,7 @@ static int tree_entry_interesting(struct tree_desc *desc, const char *base, int
 			 * Does match sort strictly earlier than path
 			 * with their common parts?
 			 */
-			m = strncmp(match, path,
+			m = strncmp_icase(match, path,
 				    (matchlen < pathlen) ? matchlen : pathlen);
 			if (m < 0)
 				continue;
@@ -183,7 +184,7 @@ static int tree_entry_interesting(struct tree_desc *desc, const char *base, int
 			 * we cheated and did not do strncmp(), so we do
 			 * that here.
 			 */
-			m = strncmp(match, path, pathlen);
+			m = strncmp_icase(match, path, pathlen);
 
 		/*
 		 * If common part matched earlier then it is a hit,
-- 
1.7.1.1930.gca7dd4
Previous: Joshua JensenNext: Joshua Jensen
Message 6 of 9 in “Various updates to make core.ignorecase=true work better”
  1. 0/7 Various updates to make core.ignorecase=true work betterJoshua Jensen, May 21, 2010
  2. 1/7 Add string comparison functions that respect the ignore_case variable.Joshua Jensen, May 21, 2010
  3. 2/7 Case insensitivity support for .gitignore via core.ignorecaseJoshua Jensen, May 21, 2010
  4. 3/7 Add case insensitivity support for directories when using git statusJoshua Jensen, May 21, 2010
  5. 4/7 Add case insensitivity support when using git ls-filesJoshua Jensen, May 21, 2010
  6. 5/7 Add support for case insensitive directory and file lookups to git logJoshua Jensen, May 21, 2010
  7. 6/7 Support case folding for git add when core.ignorecase=trueJoshua Jensen, May 21, 2010
  8. 7/7 Support case folding in git fast-import when core.ignorecase=trueJoshua Jensen, May 21, 2010
  9. Joshua JensenMay 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.