# [PATCH] t1410: Fix for case insensitive filesystems

3 messages from 2014-11-10 to 2014-11-10. Participants: Brian Gernhardt, Jeff King, Junio C Hamano.
Thread: https://gitlist.dev/t/37919

## Brian Gernhardt, 2014-11-10 01:48

Subject: [PATCH] t1410: Fix for case insensitive filesystems
Message-ID: <1415584086-41637-1-git-send-email-brian@gernhardtsoftware.com>
URL: https://gitlist.dev/e/1415584086-41637-1-git-send-email-brian%40gernhardtsoftware.com

```
A pair of recently added tests used branches a and a/b, but earlier
tests created files A and A/B.  On case insensitive filesystems (such
as HFS+), that causes git to complain about the name being ambiguous
between branch and file.  Resolve by renaming the branches to aa and
aa/bb.

Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
---
 t/t1410-reflog.sh | 36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh
index 976c1d4..ac31e19 100755
--- a/t/t1410-reflog.sh
+++ b/t/t1410-reflog.sh
@@ -254,36 +254,36 @@ test_expect_success 'checkout should not delete log for packed ref' '
 '
 
 test_expect_success 'stale dirs do not cause d/f conflicts (reflogs on)' '
-	test_when_finished "git branch -d a || git branch -d a/b" &&
+	test_when_finished "git branch -d aa || git branch -d aa/bb" &&
 
-	git branch a/b master &&
-	echo "a/b@{0} branch: Created from master" >expect &&
-	git log -g --format="%gd %gs" a/b >actual &&
+	git branch aa/bb master &&
+	echo "aa/bb@{0} branch: Created from master" >expect &&
+	git log -g --format="%gd %gs" aa/bb >actual &&
 	test_cmp expect actual &&
-	git branch -d a/b &&
+	git branch -d aa/bb &&
 
-	# now logs/refs/heads/a is a stale directory, but
-	# we should move it out of the way to create "a" reflog
-	git branch a master &&
-	echo "a@{0} branch: Created from master" >expect &&
-	git log -g --format="%gd %gs" a >actual &&
+	# now logs/refs/heads/aa is a stale directory, but
+	# we should move it out of the way to create "aa" reflog
+	git branch aa master &&
+	echo "aa@{0} branch: Created from master" >expect &&
+	git log -g --format="%gd %gs" aa >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'stale dirs do not cause d/f conflicts (reflogs off)' '
-	test_when_finished "git branch -d a || git branch -d a/b" &&
+	test_when_finished "git branch -d aa || git branch -d aa/bb" &&
 
-	git branch a/b master &&
-	echo "a/b@{0} branch: Created from master" >expect &&
-	git log -g --format="%gd %gs" a/b >actual &&
+	git branch aa/bb master &&
+	echo "aa/bb@{0} branch: Created from master" >expect &&
+	git log -g --format="%gd %gs" aa/bb >actual &&
 	test_cmp expect actual &&
-	git branch -d a/b &&
+	git branch -d aa/bb &&
 
-	# same as before, but we only create a reflog for "a" if
+	# same as before, but we only create a reflog for "aa" if
 	# it already exists, which it does not
-	git -c core.logallrefupdates=false branch a master &&
+	git -c core.logallrefupdates=false branch aa master &&
 	: >expect &&
-	git log -g --format="%gd %gs" a >actual &&
+	git log -g --format="%gd %gs" aa >actual &&
 	test_cmp expect actual
 '
 
-- 
2.2.0.rc0.209.g31b9a22

```

## Jeff King, 2014-11-10 06:23

Subject: Re: [PATCH] t1410: Fix for case insensitive filesystems
Message-ID: <20141110062356.GA8047@peff.net>
URL: https://gitlist.dev/e/20141110062356.GA8047%40peff.net
In-Reply-To: <1415584086-41637-1-git-send-email-brian@gernhardtsoftware.com>

```
On Sun, Nov 09, 2014 at 08:48:06PM -0500, Brian Gernhardt wrote:

> A pair of recently added tests used branches a and a/b, but earlier
> tests created files A and A/B.  On case insensitive filesystems (such
> as HFS+), that causes git to complain about the name being ambiguous
> between branch and file.  Resolve by renaming the branches to aa and
> aa/bb.

Already being discussed here:

  http://thread.gmane.org/gmane.comp.version-control.git/259250/focus=259253

:)

-Peff

```

## Junio C Hamano, 2014-11-10 06:34

Subject: Re: [PATCH] t1410: Fix for case insensitive filesystems
Message-ID: <CAPc5daV9g+kio2esi9avj+5ivQyaTkR4mo12gS-Cxt1KCOKMnA@mail.gmail.com>
URL: https://gitlist.dev/e/CAPc5daV9g%2Bkio2esi9avj%2B5ivQyaTkR4mo12gS-Cxt1KCOKMnA%40mail.gmail.com
In-Reply-To: <20141110062356.GA8047@peff.net>

```
On Sun, Nov 9, 2014 at 10:23 PM, Jeff King <peff@peff.net> wrote:
> On Sun, Nov 09, 2014 at 08:48:06PM -0500, Brian Gernhardt wrote:
>
>> A pair of recently added tests used branches a and a/b, but earlier
>> tests created files A and A/B.  On case insensitive filesystems (such
>> as HFS+), that causes git to complain about the name being ambiguous
>> between branch and file.  Resolve by renaming the branches to aa and
>> aa/bb.
>
> Already being discussed here:
>
>   http://thread.gmane.org/gmane.comp.version-control.git/259250/focus=259253
>
> :)

Related tangent for a moderately near future.

One thing that we may want to play with around this topic is to try
building an alternative "ref backend" that is backed by a filesystem,
lays out things pretty much the same way as the current "refs" (i.e.
one file per ref, directory hierarchy corresponds to slashes in the
refname, one file per reflog, etc.), but can be stored on a case
insensitive filesystem, as a demonstration of Ronnie's "ref-transaction"
restructuring series.

Perhaps such a backend may store branch 'a' as 'refs/heads/a' while
storing branch 'A' as 'refs/heads/%41' or something, and causes the
right thing to happen when "for-each-ref" enumerates the refs by
unquoting quoted names and when "checkout" asks to check out
such a branch.

```
