{"thread":{"id":"33433","subject":"[PATCH] checkout: abbreviate hash in suggest_reattach","startedAt":"2013-04-08T15:53:42Z","lastAt":"2013-04-08T21:03:03Z","messageCount":2,"participants":["Kevin Bracey","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"213526","messageId":"1365436422-25554-1-git-send-email-kevin@bracey.fi","threadId":"33433","inReplyTo":null,"subject":"[PATCH] checkout: abbreviate hash in suggest_reattach","fromName":"Kevin Bracey","fromEmail":"kevin@bracey.fi","sentAt":"2013-04-08T15:53:42Z","receivedAt":"2013-04-08T15:53:42Z","isPatch":true,"sender":{"key":"kevin@bracey.fi","avatar":"https://avatars.githubusercontent.com/u/96079793?v=4"},"body":"After printing the list of left-behind commits (with abbreviated\nhashes), use an abbreviated hash in the suggested 'git branch' command;\nthere's no point in outputting a full 40-character hex string in some\nfriendly advice.\n\nSigned-off-by: Kevin Bracey <kevin@bracey.fi>\n---\n builtin/checkout.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/builtin/checkout.c b/builtin/checkout.c\nindex a9c1b5a..e168bfb 100644\n--- a/builtin/checkout.c\n+++ b/builtin/checkout.c\n@@ -700,7 +700,7 @@ static void suggest_reattach(struct commit *commit, struct rev_info *revs)\n \t\t\t\"If you want to keep them by creating a new branch, \"\n \t\t\t\"this may be a good time\\nto do so with:\\n\\n\"\n \t\t\t\" git branch new_branch_name %s\\n\\n\"),\n-\t\t\tsha1_to_hex(commit->object.sha1));\n+\t\t\tfind_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV));\n }\n \n /*\n-- \n1.8.2.445.gfcda34b\n"},{"id":"213604","messageId":"20130408210303.GA9649@sigill.intra.peff.net","threadId":"33433","inReplyTo":"1365436422-25554-1-git-send-email-kevin@bracey.fi","subject":"Re: [PATCH] checkout: abbreviate hash in suggest_reattach","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-04-08T21:03:03Z","receivedAt":"2013-04-08T21:03:03Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Apr 08, 2013 at 06:53:42PM +0300, Kevin Bracey wrote:\n\n> After printing the list of left-behind commits (with abbreviated\n> hashes), use an abbreviated hash in the suggested 'git branch' command;\n> there's no point in outputting a full 40-character hex string in some\n> friendly advice.\n> \n> Signed-off-by: Kevin Bracey <kevin@bracey.fi>\n\nI think this makes sense. We generally use the full sha1 when the output\nis meant to live for a long time, but that is not the case here.\n\nI suspect I would have been annoyed by it, too, if I did not have\nadvice.detachedHEAD turned off. :)\n\n> diff --git a/builtin/checkout.c b/builtin/checkout.c\n> index a9c1b5a..e168bfb 100644\n> --- a/builtin/checkout.c\n> +++ b/builtin/checkout.c\n> @@ -700,7 +700,7 @@ static void suggest_reattach(struct commit *commit, struct rev_info *revs)\n>  \t\t\t\"If you want to keep them by creating a new branch, \"\n>  \t\t\t\"this may be a good time\\nto do so with:\\n\\n\"\n>  \t\t\t\" git branch new_branch_name %s\\n\\n\"),\n> -\t\t\tsha1_to_hex(commit->object.sha1));\n> +\t\t\tfind_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV));\n>  }\n\nCode looks obviously correct to me.\n\nAcked-by: Jeff King <peff@peff.net>\n\n-Peff\n"}]}