From: Jonathan Nieder <jrnieder@gmail.com>
To: Christian Couder <chriscool@tuxfamily.org>
Cc: Junio C Hamano <gitster@pobox.com>,
git@vger.kernel.org,
Johannes Schindelin <Johannes.Schindelin@gmx.de>,
Sverre Rabbelier <srabbelier@gmail.com>,
Ramkumar Ramachandra <artagnon@gmail.com>,
Jeff King <peff@peff.net>
Subject: Re: [PATCH 1/4] revert: report success when using option --strategy
Date: Thu, 15 Jul 2010 17:37:06 -0500 [thread overview]
Message-ID: <20100715223706.GA4788@burratino> (raw)
In-Reply-To: <20100713232816.7738.17380.chriscool@tuxfamily.org>
Christian Couder wrote:
> "git cherry-pick foo" has always reported success with
> "Finished one cherry-pick" but "cherry-pick --strategy"
> does not print anything.
[...]
> This patch also refactors the code that prints a message
> like "Automatic cherry-pick failed. <help message>". This
> code was duplicated in both do_recursive_merge() and
> do_pick_commit().
This is good. Nitpicks below.
> +++ b/builtin/revert.c
> diff --git a/t/t3508-cherry-pick-many-commits.sh b/t/t3508-cherry-pick-many-commits.sh
> index f90ed3d..6555f92 100755
> --- a/t/t3508-cherry-pick-many-commits.sh
> +++ b/t/t3508-cherry-pick-many-commits.sh
> @@ -23,12 +23,36 @@ test_expect_success setup '
> '
>
> test_expect_success 'cherry-pick first..fourth works' '
> + cat <<-EOF > expected &&
Style:
cat <<-\EOF >expected &&
The \quoting lets reviewers skim through a message without looking
for characters that might be expanded. The decreased whitespace is
just for consistency.
> + Finished one cherry-pick.
> + Finished one cherry-pick.
> + Finished one cherry-pick.
> + EOF
> +
> + git checkout -f master &&
> + git reset --hard first &&
> + test_tick &&
> + git cherry-pick first..fourth 2>actual &&
> + git diff --quiet other &&
> + git diff --quiet HEAD other &&
> + test_cmp expected actual &&
> + test "$(git rev-parse --verify HEAD)" != "$(git rev-parse --verify fourth)"
The --verify here does not accomplish much, since the exit status of
git rev-parse is not propagated to test. So strictly speaking it
would be more robust to do something like
head=$(git rev-parse --verify HEAD) &&
fourth=$(git rev-parse --verify fourth) &&
test "$head" = "$fourth"
though I do not think it is worth changing.
With or without the following changes,
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Thanks.
---
diff --git a/t/t3508-cherry-pick-many-commits.sh b/t/t3508-cherry-pick-many-commits.sh
index 6555f92..d90b365 100755
--- a/t/t3508-cherry-pick-many-commits.sh
+++ b/t/t3508-cherry-pick-many-commits.sh
@@ -23,7 +23,7 @@ test_expect_success setup '
'
test_expect_success 'cherry-pick first..fourth works' '
- cat <<-EOF > expected &&
+ cat <<-\EOF >expected &&
Finished one cherry-pick.
Finished one cherry-pick.
Finished one cherry-pick.
@@ -40,7 +40,7 @@ test_expect_success 'cherry-pick first..fourth works' '
'
test_expect_success 'cherry-pick --strategy resolve first..fourth works' '
- cat <<-EOF > expected &&
+ cat <<-\EOF >expected &&
Finished one cherry-pick with strategy resolve.
Finished one cherry-pick with strategy resolve.
Finished one cherry-pick with strategy resolve.
--
prev parent reply other threads:[~2010-07-15 22:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-13 23:28 [PATCH 1/4] revert: report success when using option --strategy Christian Couder
2010-07-15 22:37 ` Jonathan Nieder [this message]
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=20100715223706.GA4788@burratino \
--to=jrnieder@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=artagnon@gmail.com \
--cc=chriscool@tuxfamily.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
--cc=srabbelier@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).