* [PATCH 0/2] solaris test fixups
@ 2014-01-23 19:54 Jeff King
2014-01-23 19:54 ` [PATCH 1/2] t7501: fix "empty commit" test with NO_PERL Jeff King
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Jeff King @ 2014-01-23 19:54 UTC (permalink / raw
To: git
Due to the alignment bug in another thread, I had the pleasure of
visiting my old friend Solaris 9 today. The tests _almost_ all run out
of the box.
This series features two minor fixes:
[1/2]: t7501: fix "empty commit" test with NO_PERL
[2/2]: t7700: do not use "touch -r"
I had a few other failures related to encodings; I suspect the problem
is simply that the machine in question doesn't have eucJP support at
all.
The big one that I did not fix is in t7001-mv. We do this:
test_must_fail git mv some-file no-such-dir/
and assume that it will fail. It doesn't. Solaris happily renames
some-file to a regular file named "no-such-dir". So we fail later during
the index-update, complaining about adding the entry "no-such-dir/", but
still exit(0) at the end. I'm mostly willing to just call Solaris crazy
for allowing the rename (Linux returns ENOTDIR), but I do wonder if
the index codepath could be improved (and especially to return an
error).
-Peff
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/2] t7501: fix "empty commit" test with NO_PERL
2014-01-23 19:54 [PATCH 0/2] solaris test fixups Jeff King
@ 2014-01-23 19:54 ` Jeff King
2014-01-23 19:55 ` [PATCH 2/2] t7700: do not use "touch -r" Jeff King
2014-01-23 20:52 ` [PATCH 0/2] solaris test fixups Junio C Hamano
2 siblings, 0 replies; 9+ messages in thread
From: Jeff King @ 2014-01-23 19:54 UTC (permalink / raw
To: git
t7501.9 tries to check that "git commit" will fail when the
index is unchanged. It relies on previous tests not to have
modified the index. When it was originally written, this was
always the case. However, commit c65dc35 (t7501: test the
right kind of breakage, 2012-03-30) changed earlier tests (4
and 5) to leave a modification in the index.
We never noticed, however, because t7501.7, between the two,
clears the index state as a side effect. However, that test
depends on the PERL prerequisite, and so it does not always
run. Therefore if NO_PERL is set, we do not run the
intervening test, the index is left unclean, and t7501.9
fails.
We could fix this by moving t7501.9 up in the script.
However, this patch instead leaves it in place and adds a
"git reset" before the commit. This makes the test more
explicit about its preconditions, and will future-proof it
against any other changes in the test state.
Signed-off-by: Jeff King <peff@peff.net>
---
t/t7501-commit.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh
index f04798f..94eec83 100755
--- a/t/t7501-commit.sh
+++ b/t/t7501-commit.sh
@@ -57,6 +57,7 @@ test_expect_success 'using invalid commit with -C' '
'
test_expect_success 'nothing to commit' '
+ git reset --hard &&
test_must_fail git commit -m initial
'
--
1.8.5.2.500.g8060133
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/2] t7700: do not use "touch -r"
2014-01-23 19:54 [PATCH 0/2] solaris test fixups Jeff King
2014-01-23 19:54 ` [PATCH 1/2] t7501: fix "empty commit" test with NO_PERL Jeff King
@ 2014-01-23 19:55 ` Jeff King
2014-01-23 21:12 ` Junio C Hamano
2014-01-23 20:52 ` [PATCH 0/2] solaris test fixups Junio C Hamano
2 siblings, 1 reply; 9+ messages in thread
From: Jeff King @ 2014-01-23 19:55 UTC (permalink / raw
To: git
Some versions of touch (such as /usr/ucb/touch on Solaris)
do not know about the "-r" option. This would make sense as
a feature of test-chmtime, but fortunately this fix is even
easier. The test does not care about the timestamp of the
.keep file it creates at all, only that it exists. So we can
simply drop the use of "-r".
Signed-off-by: Jeff King <peff@peff.net>
---
t/t7700-repack.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t7700-repack.sh b/t/t7700-repack.sh
index d954b84..f9f9014 100755
--- a/t/t7700-repack.sh
+++ b/t/t7700-repack.sh
@@ -17,7 +17,7 @@ test_expect_success 'objects in packs marked .keep are not repacked' '
# The second pack will contain the excluded object
packsha1=$(git rev-list --objects --all | grep file2 |
git pack-objects pack) &&
- touch -r pack-$packsha1.pack pack-$packsha1.keep &&
+ touch pack-$packsha1.keep &&
objsha1=$(git verify-pack -v pack-$packsha1.idx | head -n 1 |
sed -e "s/^\([0-9a-f]\{40\}\).*/\1/") &&
mv pack-* .git/objects/pack/ &&
--
1.8.5.2.500.g8060133
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] t7700: do not use "touch -r"
2014-01-23 19:55 ` [PATCH 2/2] t7700: do not use "touch -r" Jeff King
@ 2014-01-23 21:12 ` Junio C Hamano
2014-01-23 21:14 ` Jeff King
0 siblings, 1 reply; 9+ messages in thread
From: Junio C Hamano @ 2014-01-23 21:12 UTC (permalink / raw
To: Jeff King; +Cc: git
Jeff King <peff@peff.net> writes:
> ... The test does not care about the timestamp of the
> .keep file it creates at all, only that it exists.
Please refrain from using "touch" for such use cases in the first
place. It appears that
>pack-$packsha1.keep &&
is what the test wants.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] t7700: do not use "touch -r"
2014-01-23 21:12 ` Junio C Hamano
@ 2014-01-23 21:14 ` Jeff King
2014-01-23 21:24 ` Junio C Hamano
0 siblings, 1 reply; 9+ messages in thread
From: Jeff King @ 2014-01-23 21:14 UTC (permalink / raw
To: Junio C Hamano; +Cc: git
On Thu, Jan 23, 2014 at 01:12:55PM -0800, Junio C Hamano wrote:
> Jeff King <peff@peff.net> writes:
>
> > ... The test does not care about the timestamp of the
> > .keep file it creates at all, only that it exists.
>
> Please refrain from using "touch" for such use cases in the first
> place. It appears that
>
> >pack-$packsha1.keep &&
>
> is what the test wants.
Agreed. I was making the minimal change, but I think there is no reason
not to fix both while we are there. Do you want to just mark up the
patch in transit?
-Peff
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] t7700: do not use "touch -r"
2014-01-23 21:14 ` Jeff King
@ 2014-01-23 21:24 ` Junio C Hamano
2014-01-23 21:28 ` Jeff King
0 siblings, 1 reply; 9+ messages in thread
From: Junio C Hamano @ 2014-01-23 21:24 UTC (permalink / raw
To: Jeff King; +Cc: git
Jeff King <peff@peff.net> writes:
> Agreed. I was making the minimal change, but I think there is no reason
> not to fix both while we are there. Do you want to just mark up the
> patch in transit?
Let's just queue this instead.
-- >8 --
From: Jeff King <peff@peff.net>
Date: Thu, 23 Jan 2014 14:55:18 -0500
Subject: [PATCH] t7700: do not use "touch" unnecessarily
Some versions of touch (such as /usr/ucb/touch on Solaris)
do not know about the "-r" option. This would make sense as
a feature of test-chmtime, but fortunately this fix is even
easier.
The test does not care about the timestamp of the .keep file it
creates at all, only that it exists. For such a use case, with or
without portability issues around "-r", "touch" should not be used
in the first place.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
t/t7700-repack.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t7700-repack.sh b/t/t7700-repack.sh
index d954b84..b45bd1e 100755
--- a/t/t7700-repack.sh
+++ b/t/t7700-repack.sh
@@ -17,7 +17,7 @@ test_expect_success 'objects in packs marked .keep are not repacked' '
# The second pack will contain the excluded object
packsha1=$(git rev-list --objects --all | grep file2 |
git pack-objects pack) &&
- touch -r pack-$packsha1.pack pack-$packsha1.keep &&
+ >pack-$packsha1.keep &&
objsha1=$(git verify-pack -v pack-$packsha1.idx | head -n 1 |
sed -e "s/^\([0-9a-f]\{40\}\).*/\1/") &&
mv pack-* .git/objects/pack/ &&
--
1.9-rc0-234-g8e6341d
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] t7700: do not use "touch -r"
2014-01-23 21:24 ` Junio C Hamano
@ 2014-01-23 21:28 ` Jeff King
0 siblings, 0 replies; 9+ messages in thread
From: Jeff King @ 2014-01-23 21:28 UTC (permalink / raw
To: Junio C Hamano; +Cc: git
On Thu, Jan 23, 2014 at 01:24:44PM -0800, Junio C Hamano wrote:
> Jeff King <peff@peff.net> writes:
>
> > Agreed. I was making the minimal change, but I think there is no reason
> > not to fix both while we are there. Do you want to just mark up the
> > patch in transit?
>
> Let's just queue this instead.
That's what I meant. :)
Thanks, looks good to me.
-Peff
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/2] solaris test fixups
2014-01-23 19:54 [PATCH 0/2] solaris test fixups Jeff King
2014-01-23 19:54 ` [PATCH 1/2] t7501: fix "empty commit" test with NO_PERL Jeff King
2014-01-23 19:55 ` [PATCH 2/2] t7700: do not use "touch -r" Jeff King
@ 2014-01-23 20:52 ` Junio C Hamano
2014-01-23 20:54 ` Jeff King
2 siblings, 1 reply; 9+ messages in thread
From: Junio C Hamano @ 2014-01-23 20:52 UTC (permalink / raw
To: Jeff King; +Cc: git, Johannes Sixt
Jeff King <peff@peff.net> writes:
> and assume that it will fail. It doesn't. Solaris happily renames
> some-file to a regular file named "no-such-dir". So we fail later during
> the index-update, complaining about adding the entry "no-such-dir/", but
> still exit(0) at the end. I'm mostly willing to just call Solaris crazy
> for allowing the rename (Linux returns ENOTDIR), but I do wonder if
> the index codepath could be improved (and especially to return an
> error).
I think j6t has a patch for that, a8933469 (mv: let 'git mv file
no-such-dir/' error out on Windows, too, 2014-01-08).
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/2] solaris test fixups
2014-01-23 20:52 ` [PATCH 0/2] solaris test fixups Junio C Hamano
@ 2014-01-23 20:54 ` Jeff King
0 siblings, 0 replies; 9+ messages in thread
From: Jeff King @ 2014-01-23 20:54 UTC (permalink / raw
To: Junio C Hamano; +Cc: git, Johannes Sixt
On Thu, Jan 23, 2014 at 12:52:30PM -0800, Junio C Hamano wrote:
> Jeff King <peff@peff.net> writes:
>
> > and assume that it will fail. It doesn't. Solaris happily renames
> > some-file to a regular file named "no-such-dir". So we fail later during
> > the index-update, complaining about adding the entry "no-such-dir/", but
> > still exit(0) at the end. I'm mostly willing to just call Solaris crazy
> > for allowing the rename (Linux returns ENOTDIR), but I do wonder if
> > the index codepath could be improved (and especially to return an
> > error).
>
> I think j6t has a patch for that, a8933469 (mv: let 'git mv file
> no-such-dir/' error out on Windows, too, 2014-01-08).
Ah yeah, that looks like exactly the same issue (and the fix looks sane
from my cursory investigation). Thanks for the pointer. I wasn't
planning to look further into it, but now I can do so without feeling
guilty. :)
-Peff
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2014-01-23 21:29 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-23 19:54 [PATCH 0/2] solaris test fixups Jeff King
2014-01-23 19:54 ` [PATCH 1/2] t7501: fix "empty commit" test with NO_PERL Jeff King
2014-01-23 19:55 ` [PATCH 2/2] t7700: do not use "touch -r" Jeff King
2014-01-23 21:12 ` Junio C Hamano
2014-01-23 21:14 ` Jeff King
2014-01-23 21:24 ` Junio C Hamano
2014-01-23 21:28 ` Jeff King
2014-01-23 20:52 ` [PATCH 0/2] solaris test fixups Junio C Hamano
2014-01-23 20:54 ` Jeff King
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).