From: Eric Sunshine <sunshine@sunshineco.com>
To: git@vger.kernel.org
Cc: Eric Sunshine <sunshine@sunshineco.com>,
Junio C Hamano <gitster@pobox.com>
Subject: [PATCH 3/3] t3404: simplify short SHA-1 collision test
Date: Wed, 21 Aug 2013 15:12:58 -0400 [thread overview]
Message-ID: <1377112378-45511-4-git-send-email-sunshine@sunshineco.com> (raw)
In-Reply-To: <1377112378-45511-1-git-send-email-sunshine@sunshineco.com>
The short SHA-1 collision test employs two "magic" values in commit
messages to trigger an "ambiguous SHA-1 error" during 'rebase -i' -- one
for 'collide3' during setup, and one for 'collide2' at rebase time --
even though the collision can just as easily be triggered by a single
magic value at rebase time only. The setup-time 'collide3' magic value
serves no purpose [1], but can easily mislead readers into thinking that
it is somehow significant even though it is not. Drop this unneeded bit
of magic.
As a side-effect, this also simplifies the setup-time "test_commit
collide3" invocation, making it easier to read.
[1]: The magic value on 'collide3' gave it a short SHA-1 prefix of
"badbeef" which could be spotted easily in verbose output during
development of the test, but is otherwise not meaningful or helpful.
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
---
t/t3404-rebase-interactive.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 7d15c7a..50e22b1 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -1058,7 +1058,7 @@ test_expect_success 'short SHA-1 setup' '
unset test_tick &&
test_commit collide1 collide &&
test_commit --notick collide2 collide &&
- test_commit --notick "collide3 115158b5" collide collide3 collide3
+ test_commit --notick collide3 collide
)
'
@@ -1069,7 +1069,7 @@ test_expect_success 'short SHA-1 collide' '
unset test_tick &&
test_tick &&
set_fake_editor &&
- FAKE_COMMIT_MESSAGE="collide2 815200e" \
+ FAKE_COMMIT_MESSAGE="collide2 ac4f2ee" \
FAKE_LINES="reword 1 2" git rebase -i HEAD~2
)
'
--
1.8.4.rc4.499.gfb33910
next prev parent reply other threads:[~2013-08-21 19:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-21 19:12 [PATCH 0/3] t3404 incremental improvements Eric Sunshine
2013-08-21 19:12 ` [PATCH 1/3] t3404: preserve test_tick state across short SHA-1 collision test Eric Sunshine
2013-08-25 5:55 ` Jonathan Nieder
2013-08-25 7:53 ` Eric Sunshine
2013-08-25 8:53 ` Jonathan Nieder
2013-08-26 5:29 ` Junio C Hamano
2013-08-21 19:12 ` [PATCH 2/3] t3404: make tests more self-contained Eric Sunshine
2013-08-21 23:27 ` Junio C Hamano
2013-08-21 19:12 ` Eric Sunshine [this message]
2013-08-21 23:25 ` [PATCH 0/3] t3404 incremental improvements Junio C Hamano
2013-08-22 18:17 ` Eric Sunshine
2013-08-22 19:02 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1377112378-45511-4-git-send-email-sunshine@sunshineco.com \
--to=sunshine@sunshineco.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).