Re: [PATCH] git-branch: display sha1 on branch deletion
From: Jeff King <hidden>
Date: 2016-06-15 22:45:46
On Fri, Dec 12, 2008 at 01:29:01PM -0600, Brandon Casey wrote:
Make it easier to recover from a mistaken branch deletion by displaying the sha1 of the branch's tip commit.
I think this is reasonable behavior, but I have two comments:
- printf("Deleted %sbranch %s.\n", remote, argv[i]);
+ printf("Deleted %sbranch %s (%s).\n", remote, argv[i],
+ sha1_to_hex(sha1));1. Any reason not to use find_unique_abbrev(sha1, DEFAULT_ABBREV) here? The full 40-character sha1 kind of dominates the line, especially if you have short branch name. And this is not really for long-term usage, but rather "oops, I didn't mean to have just deleted that". 2. I wonder if it is confusing to new users to simply say "Delete branch $branch ($sha1)". We haven't deleted $sha1, just the branch pointer. $sha1 is probably still in the HEAD reflog, if not in another branch. Maybe something like "(was $sha1)" would be appropriate. I don't know if '2' is a big deal. I haven't been a new user for a long time, so I didn't personally find it confusing (especially with '1' so that you actually notice the branch name rather than the gigantic sha1). -Peff