Skip to content

Commit 180a4d7

Browse files
peffgitster
authored andcommitted
t9100: stop depending on commit timestamps
An earlier "fix" to this script gave up updating it not to rely on the current time because we cannot control what timestamp subversion gives its commits. We however could solve the issue in a different way and still use deterministic timestamps on Git commits. One fix would be to sort the list of trees before removing duplicates, but that loses information: - we do care that the fetched history is in the same order - there's a tree which appears twice in the history, and we'd want to make sure that it's there both times So instead, let's de-duplicate using a hash (preserving the order), and drop only lines with identical trees and subjects (preserving the tree which appears twice, since it has different subjects each time). Signed-off-by: Jeff King <[email protected]> Acked-by: Eric Wong <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f2e3937 commit 180a4d7

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

t/t9100-git-svn-basic.sh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ GIT_SVN_LC_ALL=${LC_ALL:-$LANG}
88

99
. ./lib-git-svn.sh
1010

11-
# Make sure timestamps of commits created by Git interleave
12-
# with those created by "svn set-tree".
13-
unset GIT_COMMITTER_DATE
14-
1511
case "$GIT_SVN_LC_ALL" in
1612
*.UTF-8)
1713
test_set_prereq UTF8
@@ -204,8 +200,9 @@ GIT_SVN_ID=alt
204200
export GIT_SVN_ID
205201
test_expect_success "$name" \
206202
'git svn init "$svnrepo" && git svn fetch &&
207-
git rev-list --pretty=raw remotes/git-svn | grep ^tree | uniq > a &&
208-
git rev-list --pretty=raw remotes/alt | grep ^tree | uniq > b &&
203+
git log --format="tree %T %s" remotes/git-svn |
204+
awk "!seen[\$0]++ { print \$1, \$2 }" >a &&
205+
git log --format="tree %T" alt >b &&
209206
test_cmp a b'
210207

211208
name='check imported tree checksums expected tree checksums'

0 commit comments

Comments
 (0)