Re: [PATCH] glossary: improve "branch" definition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sergey Organov <sorganov@xxxxxxxxx> writes:

>> But do we need to say "a separate line of development", instead of
>> just "a line of development"?  What is "a line of development" that
>> is not separate?  What extra pieces of information are we trying to
>> convey by having the word "separate" there?
>
> I think it tries to convey a notion that 2 branches represent separate
> lines of development. I.e., that the whole purpose of branching is to
> provide support for independent, or parallel, or /separate/ lines of
> development.

So in the context of talking about a branch, there is no need to say
"a separate line".  It only starts making sense to use the word
"separate" whey you say "this is a line of development.  By the way,
there is another line of development that is separate from the first
one".

> I'm not going to insist on the exact wording though, -- just wanted to
> bring attention to the issue, and "separate" was somehow the first word
> that came to mind when I edited the text.
>
> As an after-thought, I'd probably add that branch in Git is represented
> by a chain of commits, and then I'd refer to most recent commit of the
> chain, instead of most recent commit on the branch. That'd make
> definition more formal and precise. Makes sense?

It brings up a more serious issue, though.  

         o---o---o---o---x A
        /             \
    ---o---o---o---o---o---o---y B

The only thing everybody can agree on in the above history is that
commit 'x' is at the tip of the branch A, and commit 'y' is at the
tip of the branch B, and 'y^' is on the branch B.  There is no good
answer to questions like

  where does branch 'A' begin?
  where does branch 'B' begin?

Perhaps the merge to 'B' was from another branch that no longer
exists (because the whole 4-commit chain was merged at that point to
the integration branch 'B'), and 'A' was forked from that branch
whose name was forgotten.

Any commit in the history represents a line of development behind
that commit, and whether a commit is pointed at by a ref does not
change that.  And development is not even a line when you include
forking and merging.

In the mental model of Git about branches, I think the only one
thing people can agree on is that a branch points at a commit, and
checking it out and making a commit on top of it will change that
branch to point at the newly created commit.  And this view supports
the word "separate"---whether you have two branches pointing at the
same commit or a different one, building a new commit on and
advancing the tip of one branch does not affect the other branch.

Come to think of it, the original "active" may not have been so bad
a word to begin with.  It is misleading in the sense that "active"
used in the original statement does not mean "currently checked
out", but if we read it as "potentially active---can grow in its own
direction", it does convey that each branch can (although does not
have to) represent its own line of development.

So, I dunno.  I'd say just settling on the simplest "is a line of
development" would be the easiest path for now.





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux