From: Will Palmer <wmpalmer@gmail.com>
To: git@vger.kernel.org
Cc: Will Palmer <wmpalmer@gmail.com>
Subject: [PATCH 1/2] test for '!' handling in rev-parse's named commits
Date: Wed, 3 Jun 2015 21:54:13 +0100 [thread overview]
Message-ID: <1433364854-30088-2-git-send-email-wmpalmer@gmail.com> (raw)
In-Reply-To: <1433364854-30088-1-git-send-email-wmpalmer@gmail.com>
In anticipation of modifying this behaviour, add a test verifying the
handling of exclamation marks when looking up a commit "by name".
Specifically, as documented: '^{/!Message}' should fail, as this syntax
is currently reserved; while '^{!!Message}' should search for a commit
whose message contains the string "!Message".
Signed-off-by: Will Palmer <wmpalmer@gmail.com>
---
t/t1511-rev-parse-caret.sh | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/t/t1511-rev-parse-caret.sh b/t/t1511-rev-parse-caret.sh
index 15973f2..0c46e5c 100755
--- a/t/t1511-rev-parse-caret.sh
+++ b/t/t1511-rev-parse-caret.sh
@@ -18,7 +18,14 @@ test_expect_success 'setup' '
git checkout master &&
echo modified >>a-blob &&
git add -u &&
- git commit -m Modified
+ git commit -m Modified &&
+ echo changed! >>a-blob &&
+ git add -u &&
+ git commit -m !Exp &&
+ git branch expref &&
+ echo changed >>a-blob &&
+ git add -u &&
+ git commit -m Changed
'
test_expect_success 'ref^{non-existent}' '
@@ -77,4 +84,14 @@ test_expect_success 'ref^{/Initial}' '
test_cmp expected actual
'
+test_expect_success 'ref^{/!Exp}' '
+ test_must_fail git rev-parse master^{/!Exp}
+'
+
+test_expect_success 'ref^{/!!Exp}' '
+ git rev-parse expref >expected &&
+ git rev-parse master^{/!!Exp} >actual &&
+ test_cmp expected actual
+'
+
test_done
--
2.3.0.rc1
next prev parent reply other threads:[~2015-06-03 20:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-03 20:54 [PATCH 0/2] specify commit by negative pattern Will Palmer
2015-06-03 20:54 ` Will Palmer [this message]
2015-06-03 21:52 ` [PATCH 1/2] test for '!' handling in rev-parse's named commits Junio C Hamano
2015-06-03 22:44 ` Will Palmer
2015-06-04 17:09 ` Junio C Hamano
2015-06-03 23:12 ` Junio C Hamano
2015-06-03 20:54 ` [PATCH 2/2] object name: introduce '^{/!<negative pattern>}' notation Will Palmer
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1433364854-30088-2-git-send-email-wmpalmer@gmail.com \
--to=wmpalmer@gmail.com \
--cc=git@vger.kernel.org \
/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.
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 NNTP newsgroup(s).