git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 4/4] revert: improve success message by adding abbreviated commit sha1

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Jul 15, 2010, 22:51 UTC
Message-ID
<20100715225141.GB7253@burratino>
In-Reply-To
<20100713232816.7738.78221.chriscool@tuxfamily.org>
Christian Couder wrote:
Show 12 quoted lines
> --- 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 &&
Previous: Christian CouderNext: Christian Couder
Message 2 of 3 in “revert: improve success message by adding abbreviated commit sha1”
  1. 4/4 revert: improve success message by adding abbreviated commit sha1Christian Couder, Jul 13, 2010
  2. Jonathan NiederJul 15, 2010
  3. Christian CouderJul 17, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.