From: Ted Ts'o <tytso@mit.edu>
To: Sitaram Chamarty <sitaramc@gmail.com>
Cc: Rich Pixley <rich.pixley@palm.com>,
Seth Robertson <in-gitvger@baka.org>,
"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Newbie grief
Date: Tue, 1 May 2012 07:14:15 -0400 [thread overview]
Message-ID: <20120501111415.GD5769@thunk.org> (raw)
In-Reply-To: <CAMK1S_jwVsyKrGoL5uVAiuRrOa8bz79-DAueBmHZE2k=PpcJ2Q@mail.gmail.com>
On Tue, May 01, 2012 at 09:14:24AM +0530, Sitaram Chamarty wrote:
>
> > Multiple heads are the idea that a single commit can "branch" in the
> > repository and that both commits can be HEADS of the same branch at once in
> > a single repository. This allows a potential collision to exist in the
> > repository and to be pushed and pulled through multiple repositories. It
>
> That is bizarre; I have no other word for it.
>
> I teach git (occasionally), and if this feature existed I would
> totally ignore it in my teaching material because I wouldn't know how
> to defend or explain the need for "hydra branches".
I wouldn't use the verb branch (and certainly not "hydra branch"),
because it's confusing to someone who thinks this has something to do
with noun "branch". But that's a confusion because of the english, or
rather the terminology that was used.
I would put it this way. Every non-merge commit has a parent (we'll
ignore merge commits for now). When you look at that commit via "git
show <commit-id>", what you see is the diff between its parent and the
state of the source tree as described by that commit-id. If you put
it this way, it becomes obvious that a particular parent commit can
have multiple child commits. (This seems to be what you are calling
"hydra branches".)
A branch is a pointer to a commit. When you add a commit to a branch,
you are adding a new commit whose parent is pointing to the current
branch head, and afterwards, the branch head pointer is changed to
point at the new commit.
> Does Hg do this? That would explain why my (admittedly half-hearted)
> attempts to learn it have failed -- whatever tutorial I used must have
> been written with the idea that hydra branches are intuitive and
> logical and sane, but did not express the concept as clearly and
> succinctly as you did.
What Hg does is it requires that all terminal commits (commits that do
not have children) must be named by a branch pointer. So when you
pull in some changes from Hg, there may be a non-terminal commit, but
before the hg pull finishes, it will create a merge commit which
merges the current branch pointer and the newly pulled in commits, so
that when you are done, the branch pointer points at the new merge
commit, and the requirement that there be no non-named terminal
commits is maintained.
Git differs in that you can have a child commit which is not pointed
to by a branch pointer, and which is referred to only by commit-id.
These child commits can disappear on you, when you do a garbage
collection; but it allows you to have multiple child commits hanging
off of a single parent commit, and you can do diffs, cherry picks,
etc. But they *do* have a unique name --- the commit id, which is a
SHA1 hash of the contents of the diff.
Does this help?
- Ted
next prev parent reply other threads:[~2012-05-01 11:14 UTC|newest]
Thread overview: 100+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-30 22:30 Newbie grief Rich Pixley
2012-04-30 23:31 ` Seth Robertson
2012-05-01 1:15 ` Rich Pixley
2012-05-01 1:32 ` Junio C Hamano
2012-05-01 1:55 ` Rich Pixley
2012-05-01 3:44 ` Sitaram Chamarty
2012-05-01 11:14 ` Ted Ts'o [this message]
2012-05-01 16:13 ` Sitaram Chamarty
2012-05-01 18:15 ` Rich Pixley
2012-05-01 18:20 ` Michael Witten
2012-05-01 18:52 ` Rich Pixley
2012-05-02 21:28 ` Jakub Narebski
2012-05-01 18:42 ` Randal L. Schwartz
2012-05-01 20:52 ` Rich Pixley
2012-05-01 21:05 ` Randal L. Schwartz
2012-05-01 21:12 ` Junio C Hamano
2012-05-01 21:25 ` Rich Pixley
2012-05-01 21:28 ` Randal L. Schwartz
2012-05-01 21:57 ` Rich Pixley
2012-05-01 22:56 ` Michael Witten
2012-05-01 23:55 ` Philip Oakley
2012-05-03 16:08 ` Hallvard Breien Furuseth
2012-05-03 18:20 ` Rich Pixley
2012-05-03 23:04 ` Hallvard Breien Furuseth
2012-05-03 23:06 ` Hallvard Breien Furuseth
2012-05-03 18:46 ` Rich Pixley
2012-05-03 21:09 ` Junio C Hamano
2012-05-03 22:44 ` Rich Pixley
2012-05-03 22:53 ` Randal L. Schwartz
2012-05-03 22:59 ` Junio C Hamano
2012-05-04 19:23 ` Felipe Contreras
2012-05-04 19:30 ` Felipe Contreras
2012-05-04 19:41 ` Michael Witten
2012-05-01 21:29 ` Rich Pixley
2012-05-01 21:39 ` Randal L. Schwartz
2012-05-01 22:07 ` Rich Pixley
2012-05-01 22:17 ` Andreas Ericsson
2012-05-01 23:01 ` PJ Weisberg
2012-05-03 18:43 ` Rich Pixley
2012-05-03 19:09 ` Nathan Gray
2012-05-03 19:16 ` Rich Pixley
2012-05-03 20:14 ` Randal L. Schwartz
2012-05-03 20:52 ` Rich Pixley
2012-05-04 15:56 ` Mark Brown
2012-05-04 18:23 ` Rich Pixley
2012-05-04 19:14 ` Jakub Narebski
2012-05-04 20:00 ` Mark Brown
2012-05-02 14:21 ` Hallvard Breien Furuseth
2012-05-02 15:21 ` Michael Witten
2012-05-03 12:23 ` Hallvard Breien Furuseth
2012-05-03 12:53 ` Randal L. Schwartz
2012-05-03 16:09 ` Michael Witten
2012-05-03 16:20 ` Hallvard Breien Furuseth
2012-05-03 16:44 ` Michael Witten
2012-05-03 18:26 ` Rich Pixley
2012-05-03 19:33 ` Ted Ts'o
2012-05-01 23:30 ` Felipe Contreras
2012-05-03 18:31 ` Rich Pixley
2012-05-03 18:58 ` Rich Pixley
2012-05-04 14:09 ` Andreas Ericsson
2012-05-04 14:59 ` Stephen Bash
2012-05-04 16:29 ` Mark Brown
2012-05-04 19:13 ` Felipe Contreras
2012-05-01 18:03 ` Rich Pixley
[not found] ` <4FA01C73.5000909@palm.com>
2012-05-02 0:44 ` Sitaram Chamarty
[not found] ` <4F9F28F5.2020403@palm.com>
2012-05-01 1:37 ` Seth Robertson
2012-05-01 3:04 ` Rich Pixley
2012-05-01 5:32 ` Michael Witten
2012-05-01 6:21 ` Junio C Hamano
2012-05-01 6:24 ` Michael Witten
2012-05-01 17:29 ` Rich Pixley
2012-05-01 17:33 ` Rich Pixley
2012-05-03 19:13 ` Rich Pixley
2012-05-03 20:19 ` Ronan Keryell
2012-05-03 21:13 ` Junio C Hamano
2012-05-03 22:23 ` Ronan Keryell
2012-05-03 22:33 ` Rich Pixley
2012-05-03 22:39 ` Rich Pixley
2012-05-04 1:01 ` Illia Bobyr
2012-05-04 3:13 ` Nathan Gray
2012-05-04 4:35 ` Michael Witten
2012-05-04 5:25 ` Junio C Hamano
2012-05-04 10:09 ` Carlos Martín Nieto
2012-05-04 14:50 ` Junio C Hamano
2012-05-04 17:39 ` Junio C Hamano
2012-05-04 16:46 ` Nathan Gray
2012-05-04 17:17 ` Illia Bobyr
2012-05-04 18:10 ` Rich Pixley
2012-05-04 17:57 ` Rich Pixley
2012-05-04 19:22 ` Michael Witten
2012-05-04 19:18 ` Andrew Sayers
2012-05-04 18:57 ` Jérôme Benoit
2012-05-04 20:03 ` Felipe Contreras
2012-05-04 20:27 ` Junio C Hamano
2012-05-04 20:45 ` Felipe Contreras
2012-05-04 21:29 ` Rich Pixley
2012-05-04 22:05 ` Felipe Contreras
2012-04-30 23:35 ` Jan Krüger
2012-05-01 18:59 ` Rich Pixley
2012-05-02 8:25 ` Philippe Vaucher
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=20120501111415.GD5769@thunk.org \
--to=tytso@mit.edu \
--cc=git@vger.kernel.org \
--cc=in-gitvger@baka.org \
--cc=rich.pixley@palm.com \
--cc=sitaramc@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).