git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael J Gruber <drmicha@warpmail.net>
To: Francis Galiegue <fge@one2team.com>
Cc: Git Mailing List <git@vger.kernel.org>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Dmitry Potapov <dpotapov@gmail.com>
Subject: Re: What are branches?
Date: Mon, 20 Apr 2009 16:27:20 +0200	[thread overview]
Message-ID: <49EC8648.6000608@warpmail.net> (raw)
In-Reply-To: <200904201614.07735.fge@one2team.com>

Francis Galiegue venit, vidit, dixit 20.04.2009 16:14:
> Le lundi 20 avril 2009, vous avez écrit :
>> Dmitry Potapov venit, vidit, dixit 20.04.2009 15:24:
>>
>> There is nothing in a git commit that ties it to a specific branch; in
>> that sense, it does not "belong" to any.
>>
> 
> Yes there is: the branch you are currently on (shown by, among others, "git 
> branch").

No, there is not.

Proof: Delete that branch and the commit will still be there. QED

> 
>> A git branch is a pointer to a commit. That commit and its predecessors
>> are contained in the branch. A commit may be contained in multiple
>> branches, on equal footing: there is no "prime branch".
>>
> 
> No. A commit's SHA1 depends on all other commits.

...on all predecessors' SHA1s, to be exact.

Now, what does this have to do with the existence of a "prime branch",
which you claim?

> 
> Why do you think the rebase command exists at all?
> 

In order to change the DAG. It rewrites commits.

On the other hand: If I want to change what branch a commit "is on", I
use git branch -m to rename the branch or git reset etc. to change some
*descendant* commits of the commit in question. All of this does not
rewrite the commit in question, but changes the names resp. the number
of branches the commit is on. Which exactly proves my point.

git branches are different. Luckily they are!

Michael

P.S.: Please don't cull cc:
P.P.S.: I'll stop here with this thread. I assume you'll believe at
least Dscho if you don't believe me ;)

  parent reply	other threads:[~2009-04-20 14:29 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 [this message]
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
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=49EC8648.6000608@warpmail.net \
    --to=drmicha@warpmail.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=dpotapov@gmail.com \
    --cc=fge@one2team.com \
    --cc=git@vger.kernel.org \
    /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).