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

Re: [PATCH] is_hfs_dotgit: loosen over-eager match of \u{..47}

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 23, 2014, 21:02 UTC
Message-ID
<xmqqr3vq13mo.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20141223201416.GA29365@google.com>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 12 quoted lines
>> +++ b/t/t1450-fsck.sh
> [...]
>> +		git fsck 2>err &&
>> +		cat err &&
>> +		! test -s err
>
> Nit: if this said
>
> 		test_line_count = 0 err
>
> then the error message would be more obvious when it fails with
> --verbose.

That's a good suggestion, I think. This is meant to apply on top of d08c13b, and we already had test_line_count back then.

So far I collected these follow-ups to squash into Peff's patch.
 t/t1450-fsck.sh |  3 +--
 utf8.c          | 15 ++++++++-------
 2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh
index 5e42385..0279b2b 100755
--- a/t/t1450-fsck.sh
+++ b/t/t1450-fsck.sh
@@ -284,8 +284,7 @@ test_expect_success 'fsck allows .Ňit' '
 		printf "100644 blob $blob\t.\\305\\207it" >tree &&
 		tree=$(git mktree <tree) &&
 		git fsck 2>err &&
-		cat err &&
-		! test -s err
+		test_line_count = 0 err
 	)
 '
 
diff --git a/utf8.c b/utf8.c
index 18a8f42..9c9fa3a 100644
--- a/utf8.c
+++ b/utf8.c
@@ -630,8 +630,8 @@ int mbs_chrlen(const char **text, size_t *remainder_p, const char *encoding)
 }
 
 /*
- * Pick the next char from the stream, folding as an HFS+ filename comparison
- * would. Note that this is _not_ complete by any means. It's just enough
+ * Pick the next char from the stream, ignoring codepoints an HFS+ would.
+ * Note that this is _not_ complete by any means. It's just enough
  * to make is_hfs_dotgit() work, and should not be used otherwise.
  */
 static ucs_char_t next_hfs_char(const char **in)
@@ -668,11 +668,6 @@ static ucs_char_t next_hfs_char(const char **in)
 			continue;
 		}
 
-		/*
-		 * there's a great deal of other case-folding that occurs,
-		 * but this is enough to catch anything that will convert
-		 * to ".git"
-		 */
 		return out;
 	}
 }
@@ -685,6 +680,12 @@ int is_hfs_dotgit(const char *path)
 	if (c != '.')
 		return 0;
 	c = next_hfs_char(&path);
+
+	/*
+	 * there's a great deal of other case-folding that occurs
+	 * in HFS+, but this is enough to catch anything that will
+	 * convert to ".git"
+	 */
 	if (c != 'g' && c != 'G')
 		return 0;
 	c = next_hfs_char(&path);
Previous: Jonathan NiederNext: Jeff King
Message 6 of 10 in “is_hfs_dotgit: loosen over-eager match of \u{..47}”
  1. is_hfs_dotgit: loosen over-eager match of \u{..47}Jeff King, Dec 23, 2014
  2. Torsten BögershausenDec 23, 2014
  3. Junio C HamanoDec 23, 2014
  4. Jeff KingDec 23, 2014
  5. Jonathan NiederDec 23, 2014
  6. Junio C HamanoDec 23, 2014
  7. Jeff KingDec 23, 2014
  8. Jeff KingDec 23, 2014
  9. Johannes SixtDec 23, 2014
  10. Jeff KingDec 23, 2014

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.