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

[PATCH] sequencer: write useful reflog message for fast-forward

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Jun 18, 2013, 18:35 UTC
Message-ID
<1371580518-32455-1-git-send-email-artagnon@gmail.com>
The following command
  $ git cherry-pick --ff b8bb3f
writes the following uninformative message to the reflog
  cherry-pick
Improve it to
  cherry-pick: fast-forward to b8bb3f
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
 sequencer.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sequencer.c b/sequencer.c
index ab6f8a7..ae63ff3 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -273,12 +273,14 @@ static int fast_forward_to(const unsigned char *to, const unsigned char *from,
 			   int unborn)
 {
 	struct ref_lock *ref_lock;
+	struct strbuf sb = STRBUF_INIT;
 
 	read_cache();
 	if (checkout_fast_forward(from, to, 1))
 		exit(1); /* the callee should have complained already */
 	ref_lock = lock_any_ref_for_update("HEAD", unborn ? null_sha1 : from, 0);
-	return write_ref_sha1(ref_lock, to, "cherry-pick");
+	strbuf_addf(&sb, "cherry-pick: fast-forward to %s", find_unique_abbrev(to, DEFAULT_ABBREV));
+	return write_ref_sha1(ref_lock, to, sb.buf);
 }
 
 static int do_recursive_merge(struct commit *base, struct commit *next,
-- 
1.8.3.1.457.gd1408e5
Next: Junio C Hamano
Message 1 of 3 in “sequencer: write useful reflog message for fast-forward”
  1. sequencer: write useful reflog message for fast-forwardRamkumar Ramachandra, Jun 18, 2013
  2. Junio C HamanoJun 18, 2013
  3. Ramkumar RamachandraJun 18, 2013

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.