From: "Stephen P. Smith" <ischis2@cox.net>
To: Philip Oakley <philipoakley@iee.org>
Cc: Junio C Hamano <gitster@pobox.com>,
Duy Nguyen <pclouds@gmail.com>,
Git Mailing List <git@vger.kernel.org>,
Will Palmer <wmpalmer@gmail.com>,
"Stephen P . Smith" <ischis2@cox.net>
Subject: [PATCH V4 1/2] test for '!' handling in rev-parse's named commits
Date: Tue, 12 Jan 2016 21:51:48 -0700 [thread overview]
Message-ID: <1452660708-5568-1-git-send-email-ischis2@cox.net> (raw)
In-Reply-To: <ED12DDDA0C004D23BDDB14973C675800@PhilipOakley>
From: Will Palmer <wmpalmer@gmail.com>
In anticipation of extending this behaviour, add tests verifying the
handling of exclamation marks when looking up a commit "by name".
Specifically, as documented: '<rev>^{/!Message}' should fail, as the '!'
prefix is reserved; while '<rev>^{!!Message}' should search for a commit
whose message contains the string "!Message".
Signed-off-by: Will Palmer <wmpalmer@gmail.com>
Signed-off-by: Stephen P. Smith <ischis2@cox.net>
---
Notes:
No actual changes made to this patch. Just re-sending to keep
consistent with updates to the rest of the series.
t/t1511-rev-parse-caret.sh | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/t/t1511-rev-parse-caret.sh b/t/t1511-rev-parse-caret.sh
index 15973f2..b2f90be 100755
--- a/t/t1511-rev-parse-caret.sh
+++ b/t/t1511-rev-parse-caret.sh
@@ -18,7 +18,15 @@ test_expect_success 'setup' '
git checkout master &&
echo modified >>a-blob &&
git add -u &&
- git commit -m Modified
+ git commit -m Modified &&
+ git branch modref &&
+ 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 +85,18 @@ 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^{/!}' '
+ test_must_fail git rev-parse master^{/!}
+'
+
+test_expect_success 'ref^{/!!Exp}' '
+ git rev-parse expref >expected &&
+ git rev-parse master^{/!!Exp} >actual &&
+ test_cmp expected actual
+'
+
test_done
--
2.7.0-rc2
next prev parent reply other threads:[~2016-01-13 4:51 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-06 0:24 [PATCH v2 0/2] specify commit by negative pattern Will Palmer
2015-06-06 0:24 ` [PATCH v2 1/2] test for '!' handling in rev-parse's named commits Will Palmer
2015-06-06 0:24 ` [PATCH v2 2/2] object name: introduce '^{/!-<negative pattern>}' notation Will Palmer
2015-06-08 16:39 ` Junio C Hamano
2015-06-09 18:14 ` Will Palmer
2015-10-28 17:52 ` Junio C Hamano
2016-01-08 6:04 ` [PATCH v2 2/2] object name: introduce '^{/!-<negativepattern>}' notation Stephen Smith
2016-01-08 18:21 ` Junio C Hamano
2016-01-10 2:20 ` [PATCH V3 0/2] specify commit by negative pattern Stephen P. Smith
2016-01-10 2:22 ` [PATCH V3 1/2] test for '!' handling in rev-parse's named commits Stephen P. Smith
2016-01-10 2:23 ` [PATCH V3 2/2] object name: introduce '^{/!-<negative pattern>}' notation Stephen P. Smith
2016-01-11 18:10 ` Philip Oakley
2016-01-13 4:51 ` [PATCH V4 0/2] specify commit by negative pattern Stephen P. Smith
2016-01-13 4:51 ` Stephen P. Smith [this message]
2016-01-13 4:52 ` [PATCH V4 2/2] object name: introduce '^{/!-<negative pattern>}' notation Stephen P. Smith
2016-01-13 19:15 ` Junio C Hamano
2016-01-31 0:06 ` [PATCH V5 " Stephen P. Smith
2016-02-01 21:42 ` Junio C Hamano
2016-01-10 13:25 ` [PATCH V3 0/2] specify commit by negative pattern Philip Oakley
2016-01-11 0:08 ` Stephen P. Smith
2016-01-11 18:04 ` Philip Oakley
2016-01-10 14:14 ` Stephen & Linda Smith
2016-01-10 23:36 ` Philip Oakley
2016-01-09 1:55 ` [PATCH v2 2/2] object name: introduce '^{/!-<negativepattern>}' notation Stephen & Linda Smith
2016-01-09 2:18 ` Duy Nguyen
2016-01-11 17:13 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1452660708-5568-1-git-send-email-ischis2@cox.net \
--to=ischis2@cox.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=pclouds@gmail.com \
--cc=philipoakley@iee.org \
--cc=wmpalmer@gmail.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.
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).