From: Jeff King <peff@peff.net>
To: Brandon Casey <casey@nrlssc.navy.mil>
Cc: gitster@pobox.com, git@vger.kernel.org
Subject: Re: [PATCH] git-branch: display sha1 on branch deletion
Date: Fri, 12 Dec 2008 14:43:51 -0500 [thread overview]
Message-ID: <20081212194349.GA5486@sigill.intra.peff.net> (raw)
In-Reply-To: <uTIFnEi0iyLKcAungf7u1Gu2xl50j9i-AMiZaQp-QTs1q-ppgyHZoelGLgvK7BFKpYE03BLRHJ4@cipher.nrlssc.navy.mil>
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
next prev parent reply other threads:[~2008-12-12 19:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-12 19:29 [PATCH] git-branch: display sha1 on branch deletion Brandon Casey
2008-12-12 19:43 ` Jeff King [this message]
2008-12-12 23:17 ` Brandon Casey
2008-12-12 23:20 ` [PATCH v2] " Brandon Casey
2008-12-13 6:31 ` Jeff King
2008-12-15 17:23 ` Brandon Casey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081212194349.GA5486@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=casey@nrlssc.navy.mil \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).