From: Junio C Hamano <gitster@pobox.com>
To: Marius Vollmer <marius.vollmer@gmail.com>
Cc: Dmitry Potapov <dpotapov@gmail.com>,
Michael J Gruber <git@drmicha.warpmail.net>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>,
git@vger.kernel.org
Subject: Re: What are branches?
Date: Mon, 20 Apr 2009 17:53:00 -0700 [thread overview]
Message-ID: <7vd4b6ddzn.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <87r5znashf.fsf@gmail.com> (Marius Vollmer's message of "Tue, 21 Apr 2009 01:08:12 +0300")
Marius Vollmer <marius.vollmer@gmail.com> writes:
> Junio C Hamano <gitster@pobox.com> writes:
>
>> If we made it easy for Dscho to create the merge M to record my tree as
>> the first parent, [...]
>
> But it _is_ easy for Dscho to do that, isn't it? He just needs to
> remember to do the merge the other way around, checking out your branch
> and merging his into it.
>
> This doesn't change much, of course, since we still can't follow a
> branch backwards in time reliably. Would it make sense to record
> additional information in a merge commit, such as the branch name for
> each parent? Then tools could automatically draw the history of the
> current branch as a straight line, say.
We already have record of that, but I do not think using it is necessarily
healthy.
There are certainly cases where the relationship between the maintainer
and a contributor makes one branch "the primary" in the sense that it is
the integration ground for everything under the sun, as opposed to the
other one that is "the side branch that was merged" in the sense that it
brought in a more narrowly focused set of patches. If you examine the
merge commit M Dscho makes in the example in my previous message, it shows
that one of the parents was committed by me and the other was committed by
Dscho. By following my commits over Dscho's, you will identify which one
of the parents of a merge is the mainline. You would perhaps instead of
"git log --first-parent" use "git log --mainline=gitster" or something
like that.
The point is that a convention to follow my commits over Dscho's commits
is just as valid as a convention to follow the first parent. It is purely
a social convention.
A more problematic is that in a distributed environment, there doesn't
necessarily such a "mainline vs side branch" relationship exist, and it is
not healthy to try to introduce such a concept like "mainline" when there
is no such thing.
Perhaps Alice and Bob forked at the same point, agreeing between
themselves that Alice works on the code updates while Bob updates the
documentation as a team of two to produce a new feature. Before they
collectively conclude their work and send a pull request to the project
management, they will merge their branches to produce the end result that
is pullable. From the overall project's point of view, the merge to get
their work into the mainline will be "the mainline merges one side branch
for the feature", but what about the merges between Alice and Bob while
they work together? There is no "this is the mainline and this is a side
branch" relationship between what they do.
next prev parent reply other threads:[~2009-04-21 0:54 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-19 15:17 What are branches? Johannes Schindelin
2009-04-19 15:24 ` Michael Witten
2009-04-19 22:10 ` Tuncer Ayaz
2009-04-19 22:29 ` Johannes Schindelin
2009-04-19 22:34 ` Tuncer Ayaz
2009-04-20 11:32 ` Dmitry Potapov
2009-04-20 12:07 ` Michael J Gruber
2009-04-20 13:24 ` Dmitry Potapov
2009-04-20 13:52 ` Michael J Gruber
[not found] ` <200904201614.07735.fge@one2team.com>
2009-04-20 14:27 ` Michael J Gruber
2009-04-20 18:40 ` Dmitry Potapov
2009-04-20 20:58 ` Junio C Hamano
2009-04-20 22:08 ` Marius Vollmer
2009-04-21 0:53 ` Junio C Hamano [this message]
2009-04-21 11:41 ` Dmitry Potapov
2009-04-20 14:25 ` Johannes Schindelin
2009-04-20 16:06 ` Björn Steinbrink
2009-04-20 18:59 ` Jakub Narebski
2009-04-20 20:23 ` Björn Steinbrink
2009-04-24 13:08 ` Jakub Narebski
2009-04-24 16:29 ` Björn Steinbrink
2009-04-20 18:47 ` Dmitry Potapov
2009-04-20 19:19 ` Johannes Schindelin
2009-04-20 19:24 ` Michał Kiedrowicz
2009-04-20 20:16 ` Dmitry Potapov
2009-04-20 21:04 ` Björn Steinbrink
2009-04-20 16:13 ` Brian Gernhardt
2009-04-25 11:11 ` Felipe Contreras
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=7vd4b6ddzn.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=dpotapov@gmail.com \
--cc=git@drmicha.warpmail.net \
--cc=git@vger.kernel.org \
--cc=marius.vollmer@gmail.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).