git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 4/4] revert: improve success message by adding abbreviated commit sha1
@ 2010-07-13 23:28 Christian Couder
  2010-07-15 22:51 ` Jonathan Nieder
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Couder @ 2010-07-13 23:28 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: git, Johannes Schindelin, Sverre Rabbelier, Ramkumar Ramachandra,
	Jonathan Nieder, Jeff King

Instead of "Finished one cherry-pick." or "Finished one
revert.", we now print "Finished cherry-pick commit
<abbreviated sha1>." or "Finished revert commit
<abbreviated sha1>." which is more informative especially
when cherry-picking or reverting many commits.

In case of failure the message is now "Automatic
cherry-pick commit <abbreviated sha1> failed." instead of
"Automatic cherry-pick failed.".

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 builtin/revert.c                    |    5 +++--
 t/t3508-cherry-pick-many-commits.sh |   12 ++++++------
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/builtin/revert.c b/builtin/revert.c
index ec931bd..36479f9 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -492,7 +492,8 @@ static int do_pick_commit(void)
 		}
 	}
 
-	strbuf_addstr(&mebuf, me);
+	strbuf_addf(&mebuf, "%s commit %s", me,
+		    find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV));
 
 	if (!strategy || !strcmp(strategy, "recursive") || action == REVERT) {
 		res = do_recursive_merge(base, next, base_label, next_label,
@@ -521,7 +522,7 @@ static int do_pick_commit(void)
 		if (!no_commit)
 			res = run_git_commit(defmsg);
 		if (!res)
-			fprintf(stderr, "Finished one %s.\n", mebuf.buf);
+			fprintf(stderr, "Finished %s.\n", mebuf.buf);
 	}
 
 	strbuf_release(&mebuf);
diff --git a/t/t3508-cherry-pick-many-commits.sh b/t/t3508-cherry-pick-many-commits.sh
index 6555f92..1bd3ca1 100755
--- a/t/t3508-cherry-pick-many-commits.sh
+++ b/t/t3508-cherry-pick-many-commits.sh
@@ -24,9 +24,9 @@ test_expect_success setup '
 
 test_expect_success 'cherry-pick first..fourth works' '
 	cat <<-EOF > expected &&
-	Finished one cherry-pick.
-	Finished one cherry-pick.
-	Finished one cherry-pick.
+	Finished cherry-pick commit $(git rev-parse --short second).
+	Finished cherry-pick commit $(git rev-parse --short third).
+	Finished cherry-pick commit $(git rev-parse --short fourth).
 	EOF
 
 	git checkout -f master &&
@@ -41,9 +41,9 @@ test_expect_success 'cherry-pick first..fourth works' '
 
 test_expect_success 'cherry-pick --strategy resolve first..fourth works' '
 	cat <<-EOF > expected &&
-	Finished one cherry-pick with strategy resolve.
-	Finished one cherry-pick with strategy resolve.
-	Finished one cherry-pick with strategy resolve.
+	Finished cherry-pick commit $(git rev-parse --short second) with strategy resolve.
+	Finished cherry-pick commit $(git rev-parse --short third) with strategy resolve.
+	Finished cherry-pick commit $(git rev-parse --short fourth) with strategy resolve.
 	EOF
 
 	git checkout -f master &&
-- 
1.7.2.rc1.215.g2dff2.dirty

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 4/4] revert: improve success message by adding abbreviated commit sha1
  2010-07-13 23:28 [PATCH 4/4] revert: improve success message by adding abbreviated commit sha1 Christian Couder
@ 2010-07-15 22:51 ` Jonathan Nieder
  2010-07-17 20:17   ` Christian Couder
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Nieder @ 2010-07-15 22:51 UTC (permalink / raw)
  To: Christian Couder
  Cc: Junio C Hamano, git, Johannes Schindelin, Sverre Rabbelier,
	Ramkumar Ramachandra, Jeff King

Christian Couder wrote:

> --- a/t/t3508-cherry-pick-many-commits.sh
> +++ b/t/t3508-cherry-pick-many-commits.sh
> @@ -24,9 +24,9 @@ test_expect_success setup '
>  
>  test_expect_success 'cherry-pick first..fourth works' '
>  	cat <<-EOF > expected &&
> -	Finished one cherry-pick.
> -	Finished one cherry-pick.
> -	Finished one cherry-pick.
> +	Finished cherry-pick commit $(git rev-parse --short second).
> +	Finished cherry-pick commit $(git rev-parse --short third).
> +	Finished cherry-pick commit $(git rev-parse --short fourth).

If the redirections are changed to <<-\EOF before, then they would
need to be changed back to <<-EOF here.

> Instead of "Finished one cherry-pick." or "Finished one
> revert.", we now print "Finished cherry-pick commit
> <abbreviated sha1>."

“Finished cherry-pick of commit f67ab8.” sounds more better to my ear.

	Finished cherry-pick of foo.
	Finished cherry-pick of bar.
	Finished cherry-pick of baz.
	etc

is a lot saner than

	Finished one cherry-pick.
	Finished one cherry-pick.
	Finisehd one cherry-pick.
	etc

Thanks for making it happen.

diff --git a/builtin/revert.c b/builtin/revert.c
index 36479f9..e261fb2 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -492,7 +492,7 @@ static int do_pick_commit(void)
 		}
 	}
 
-	strbuf_addf(&mebuf, "%s commit %s", me,
+	strbuf_addf(&mebuf, "%s of commit %s", me,
 		    find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV));
 
 	if (!strategy || !strcmp(strategy, "recursive") || action == REVERT) {
diff --git a/t/t3508-cherry-pick-many-commits.sh b/t/t3508-cherry-pick-many-commits.sh
index 1bd3ca1..5af5905 100755
--- a/t/t3508-cherry-pick-many-commits.sh
+++ b/t/t3508-cherry-pick-many-commits.sh
@@ -24,9 +24,9 @@ test_expect_success setup '
 
 test_expect_success 'cherry-pick first..fourth works' '
 	cat <<-EOF > expected &&
-	Finished cherry-pick commit $(git rev-parse --short second).
-	Finished cherry-pick commit $(git rev-parse --short third).
-	Finished cherry-pick commit $(git rev-parse --short fourth).
+	Finished cherry-pick of commit $(git rev-parse --short second).
+	Finished cherry-pick of commit $(git rev-parse --short third).
+	Finished cherry-pick of commit $(git rev-parse --short fourth).
 	EOF
 
 	git checkout -f master &&
@@ -41,9 +41,9 @@ test_expect_success 'cherry-pick first..fourth works' '
 
 test_expect_success 'cherry-pick --strategy resolve first..fourth works' '
 	cat <<-EOF > expected &&
-	Finished cherry-pick commit $(git rev-parse --short second) with strategy resolve.
-	Finished cherry-pick commit $(git rev-parse --short third) with strategy resolve.
-	Finished cherry-pick commit $(git rev-parse --short fourth) with strategy resolve.
+	Finished cherry-pick of commit $(git rev-parse --short second) with strategy resolve.
+	Finished cherry-pick of commit $(git rev-parse --short third) with strategy resolve.
+	Finished cherry-pick of commit $(git rev-parse --short fourth) with strategy resolve.
 	EOF
 
 	git checkout -f master &&
-- 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 4/4] revert: improve success message by adding abbreviated commit sha1
  2010-07-15 22:51 ` Jonathan Nieder
@ 2010-07-17 20:17   ` Christian Couder
  0 siblings, 0 replies; 3+ messages in thread
From: Christian Couder @ 2010-07-17 20:17 UTC (permalink / raw)
  To: Jonathan Nieder
  Cc: Junio C Hamano, git, Johannes Schindelin, Sverre Rabbelier,
	Ramkumar Ramachandra, Jeff King

On Friday 16 July 2010 00:51:41 Jonathan Nieder wrote:
> Christian Couder wrote:
> > Instead of "Finished one cherry-pick." or "Finished one
> > revert.", we now print "Finished cherry-pick commit
> > <abbreviated sha1>."
> 
> “Finished cherry-pick of commit f67ab8.” sounds more better to my ear.
> 
> 	Finished cherry-pick of foo.
> 	Finished cherry-pick of bar.
> 	Finished cherry-pick of baz.
> 	etc
> 
> is a lot saner than
> 
> 	Finished one cherry-pick.
> 	Finished one cherry-pick.
> 	Finisehd one cherry-pick.
> 	etc
> 
> Thanks for making it happen.

Thanks for your review and your patches to improve my patches!
And thanks to Junio for picking up everything!

Best regards,
Christian.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-07-17 20:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-13 23:28 [PATCH 4/4] revert: improve success message by adding abbreviated commit sha1 Christian Couder
2010-07-15 22:51 ` Jonathan Nieder
2010-07-17 20:17   ` Christian Couder

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).