threads / patch / 41105

patchFix t3400 on a case insensitive file system

Subject: [PATCH v1] Fix t3400 on a case insensitive file system

## tl;dr

2 messages between Jan 1, 2016 and Jan 2, 2016. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Torsten Bögershausen· Jan 1, 2016, 15:08 UTC · lore

On a case insenstive file system x is the same as X. When a file named "X" exist, e.g. ">x && git add x" does not work as expected, use file name "Y" instead.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
---
 t/t3400-rebase.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Show changes to t/t3400-rebase.sh +3 −3
diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh
index 5ed4012..2eebd22 100755
--- a/t/t3400-rebase.sh
+++ b/t/t3400-rebase.sh
@@ -259,11 +259,11 @@ test_expect_success 'rebase duplicated commit with
--keep-empty' '
 	git reset --hard &&
 	git checkout master &&
 -	>x && git add x && git commit x -mx &&
-	echo x >x && git commit x -mx1 &&
+	>Y && git add Y && git commit Y -mY &&
+	echo Y >Y && git commit Y -mY1 &&
  	git checkout -b duplicated HEAD~ &&
-	echo x >x && git commit x -mx2 &&
+	echo Y >Y && git commit Y -mY2 &&
 	git rebase --keep-empty master
 '
 -- 2.6.2.403.g6abe3ff.dirty
Junio C Hamano· Jan 2, 2016, 19:30 UTC · re: Torsten Bögershausen · lore

Re: [PATCH v1] Fix t3400 on a case insensitive file system

Torsten Bögershausen <tboegi@web.de> writes:
Show 6 quoted lines
> On a case insenstive file system x is the same as X.
> When a file named "X" exist, e.g. ">x && git add x" does not work as expected,
> use file name "Y" instead.
>
> Signed-off-by: Torsten Bögershausen <tboegi@web.de>
> ---

It is a right thing to fix this, but do you have to use capital 'Y' here?

I see both uppercase X and Y are used in the earlier tests in this script, and it may be that that earlier Y, unlike earlier X, does not interfere on your case insensitive system right now, but using a single letter 'Y' smells like a future breakage waiting to happen. Wouldn't it make more sense to name this a lot more distinctively and uniquely?

In any case, I think this is only in the topic that has been listed as "Will discard", so I won't worry about it myself for now--if the topic will be resurrected in the future, reviewers should keep an eye to prevent it from adding this bug.

Thanks.
Show 21 quoted lines
>  t/t3400-rebase.sh | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh
> index 5ed4012..2eebd22 100755
> --- a/t/t3400-rebase.sh
> +++ b/t/t3400-rebase.sh
> @@ -259,11 +259,11 @@ test_expect_success 'rebase duplicated commit with
> --keep-empty' '
>  	git reset --hard &&
>  	git checkout master &&
>  -	>x && git add x && git commit x -mx &&
> -	echo x >x && git commit x -mx1 &&
> +	>Y && git add Y && git commit Y -mY &&
> +	echo Y >Y && git commit Y -mY1 &&
>   	git checkout -b duplicated HEAD~ &&
> -	echo x >x && git commit x -mx2 &&
> +	echo Y >Y && git commit Y -mY2 &&
>  	git rebase --keep-empty master
>  '
>  -- 2.6.2.403.g6abe3ff.dirty

← back to recent threads