From: Kevin Bracey Date: Mon, 8 Apr 2013 15:53:42 +0000 (+0300) Subject: checkout: abbreviate hash in suggest_reattach X-Git-Tag: v1.8.3-rc0~60^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d6e1466095b54b613acd2ecfd6b72d06b07d2dc3;p=thirdparty%2Fgit.git checkout: abbreviate hash in suggest_reattach After printing the list of left-behind commits (with abbreviated hashes), use an abbreviated hash in the suggested 'git branch' command; there's no point in outputting a full 40-character hex string in some friendly advice. Signed-off-by: Kevin Bracey Acked-by: Jeff King Signed-off-by: Junio C Hamano --- diff --git a/builtin/checkout.c b/builtin/checkout.c index f8033f446e..eb51872347 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -729,7 +729,7 @@ static void suggest_reattach(struct commit *commit, struct rev_info *revs) "If you want to keep them by creating a new branch, " "this may be a good time\nto do so with:\n\n" " git branch new_branch_name %s\n\n"), - sha1_to_hex(commit->object.sha1)); + find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV)); } /*