From: Junio C Hamano <gitster@pobox.com>
To: "David Symonds" <dsymonds@gmail.com>
Cc: "Bill Lear" <rael@zopyra.com>,
"Jay Soffian" <jaysoffian@gmail.com>,
"Git Mailing List" <git@vger.kernel.org>
Subject: Re: A couple branch questions
Date: Wed, 13 Feb 2008 19:43:21 -0800 [thread overview]
Message-ID: <7vr6fgkxt2.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <ee77f5c20802131903i45b1629fpcb4a5c6e4f483052@mail.gmail.com> (David Symonds's message of "Wed, 13 Feb 2008 19:03:12 -0800")
"David Symonds" <dsymonds@gmail.com> writes:
> If I have four branches, a, b1, b2 and c, and I've merged b2 into c
> (but planning to keep developing on b2), and just merged b1 into a
> (which I have checked out), then I probably only want to delete b1,
> not b2. The "current" branch is a useful notion because it
> significantly simplifies merging/rebasing operations.
Not just "simplifies", but it tends to make it much safer.
People often mistake that the safety of "branch -d" is to not
lose the commit (i.e. not making it unreachable), but that is
not the case. That safety already exists in HEAD reflogs.
The "branch -d" safety is about not losing the particular point.
The information we really are trying to protect is "this branch
points at _that commit_", which is just as important if not
more.
And immediately after merging that branch into your current
branch is where we can be fairly certain that you are truly done
with the branch and that did not make a typo, if we hear you say
"I do not need that branch anymore, delete it". "If it is
merged in _some random branch_" does not give such an assurance
and an inappropriate test for this purpose.
I should point out that the current protection based on HEAD
predates the invention of the "branch --track". If we were
designing the safety today, it would have taken the form of "if
the branch to be removed is fully merged in the branch that it
used to be tracking, or the current branch, then it is safe to
remove it.".
next prev parent reply other threads:[~2008-02-14 3:44 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-14 1:39 A couple branch questions Jay Soffian
2008-02-14 1:45 ` David Symonds
2008-02-14 2:24 ` Bill Lear
2008-02-14 3:03 ` David Symonds
2008-02-14 3:43 ` Junio C Hamano [this message]
2008-02-14 14:01 ` Keeping reflogs on branch deletion Brian Downing
2008-02-14 15:00 ` Nicolas Pitre
2008-02-14 15:08 ` Johannes Schindelin
2008-02-14 15:17 ` Jeff King
2008-02-14 16:16 ` Nicolas Pitre
2008-02-14 16:31 ` Jeff King
2008-02-14 17:32 ` Nicolas Pitre
2008-02-14 17:57 ` Jeff King
2008-02-14 20:17 ` Wincent Colaiuta
2008-02-14 16:35 ` Jakub Narebski
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=7vr6fgkxt2.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=dsymonds@gmail.com \
--cc=git@vger.kernel.org \
--cc=jaysoffian@gmail.com \
--cc=rael@zopyra.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).