git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Liu Yubao <yubao.liu@gmail.com>
To: Andy Whitcroft <apw@shadowen.org>
Cc: Andreas Ericsson <ae@op5.se>, Junio C Hamano <junkio@cox.net>,
	git@vger.kernel.org
Subject: Re: If merging that is really fast forwarding creates new commit [Was: Re: how to show log for only one branch]
Date: Tue, 07 Nov 2006 20:05:38 +0800	[thread overview]
Message-ID: <45507692.7050100@gmail.com> (raw)
In-Reply-To: <4550522D.9060503@shadowen.org>

Andy Whitcroft wrote:
> Liu Yubao wrote: 
> But in that situation you and Alice now have different actual history
> DAG's in your repositories.
> 
> Alice sees:
> a---b---c---d-----------h
>              \         /
>               e---f---g
> 
> Bob sees:
> a---b---c---d-----------h
>              \         / \
>               e---f---g---i
> 
> 
> If bob now adds a new commit 'j' and alice pulls it back we either have
> to then accept 'i' at alice's end or forever lose the identicality of
> the commit DAG.  At which point our primary benefit of the SHA1 ==
> parent == same commit for everyone is gone.  We can no longer say "this
> commit is broken" and everyone know which commit that is.
> 
Alice and bob have their own branch scope view respectively, they have two
different branches, their DAGs in *branch scope view* can
be different because they trace the history from different points.

In branch scope view, you see only one HEAD, it merges changes from
other branches. Each branch has its own commit DAG.

In global scope view, you see many HEADs, they fork and merge frequently,
here is only one big commit DAG, but you can never see the whole as branches
can be distributed over the world.

Fake commit doesn't break the DAG in global scope view, it has parents
as normal commit although the trees pointed by fake commit and its parent
are same. In fact, git has suck commit already:

   a (tree_1) -------  b (tree_2)  ---- d (tree_2) ---> master
    \                                    /
     `---------------  c (tree_2) ------' -----> test

If you don't pull from other, you can get different global DAG, it's normal 
obviously. It doesn't matter you get different DAG in branch scope, of course
they are different.

The problem is you can't get branch *track* from global scope view in git, you
can't tell which commits a branch has *referred to*. Note following HEAD^1 
isn't right as Junio pointed out 
(http://marc.theaimsgroup.com/?l=git&m=116279354214757&w=2).

Branch track is useful as people have requested reflog feature (realized, but
only for local purpose) and "note" extension in commit object.

If you have a commit A that I haven't pulled, I can't know what you
refer to when you say "Commit A introduced a bug". I must know where
to get this commit. After I pull it from other branch, We can say "this
commit is broken" and everyone know which commit that is.

>> We create a fake commit for fast forwarding style merge, this fake commit
>> is used to record the track of a branch, so we can always follow HEAD^1
>> to travel through the history of a branch. In fact, git pays more attention
>> to the history of *data modification* than history of *operation*, that is
>> right the subtle difference between content tracker and VCS, latter's
>> branch has more information(useful information, I think).
> 
> Any VCS is concerned with data modification and how its tracked.  There
> are two ways you can record history.  A series of snapshots (git) or a
> series of operations (eg cvs and svn).  Each has its trade offs,
> operations like diff on snapshots is O(number of files), on diffs they
> are O(number of files * number of deltas).
> 
> The difference here is all about the interpretation of the word
> 'branch'.  In CVS and others there is the hard concept of a mainline --
> here is the master copy when something is added here it is "the one",
> branches are temporary places which contain 'different' history such as
> a patch branch.  You want something on both branches you commit the
> change twice once to each.  In git they are more separate future
> histories.  When they are merged back together the new single history
> contains the changes in both, neither is more important than the other
> both represent forward progress.  People tend to draw as below giving a
> false importance to the 'line' from d->h:
> 
> a---b---c---d-----------h
>              \         /
>               e---f---g
> 
> We probabally should draw the below, h's history contains all history
> from both 'up' and 'down' histories.  Which is more important?  Neither.
>  h is made up of a,b,c,d from alice and e,f,g from bob merged by alice.
> 
>               ---------
>              /         \
> a---b---c---d           h
>              \         /
>               e---f---g
> 
> 
If fake commit is introduced, a possible revision graph is like this:

   a - * -- c  ------- * ---> branchA
    \ /      \         /
     b ------ * ---- d ---> branchB      ('*' stands for fake commit)

It's indeed not pretty as a linear revision graph that git's fast forwarding
style merge creates, but it can record the tracks of two branches by following
HEAD^1.

  reply	other threads:[~2006-11-07 12:07 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-06  3:41 how to show log for only one branch Liu Yubao
2006-11-06  6:12 ` Junio C Hamano
2006-11-06 10:41   ` Liu Yubao
2006-11-06 18:16     ` Junio C Hamano
2006-11-07  2:21       ` Liu Yubao
2006-11-07  8:21         ` Jakub Narebski
2006-11-06 13:00   ` If merging that is really fast forwarding creates new commit [Was: Re: how to show log for only one branch] Liu Yubao
2006-11-06 13:39     ` If merging that is really fast forwarding creates new commit Rocco Rutte
2006-11-07  3:42       ` Liu Yubao
2006-11-06 13:43     ` If merging that is really fast forwarding creates new commit [Was: Re: how to show log for only one branch] Andreas Ericsson
2006-11-07  3:26       ` Liu Yubao
2006-11-07  9:30         ` Andy Whitcroft
2006-11-07 12:05           ` Liu Yubao [this message]
2006-11-07 12:17             ` Jakub Narebski
2006-11-06 15:48     ` Linus Torvalds
2006-11-06 16:03       ` Martin Langhoff
2006-11-06 17:48       ` Linus Torvalds
2006-11-07  7:59         ` Liu Yubao
2006-11-07 17:23           ` Linus Torvalds
2006-11-07 18:23           ` If merging that is really fast forwarding creates new commit Junio C Hamano
2006-11-07 11:46         ` If merging that is really fast forwarding creates new commit [Was: Re: how to show log for only one branch] Eran Tromer
2006-11-07  7:27       ` Liu Yubao
2006-11-07  9:46         ` Andy Whitcroft
2006-11-07 12:08           ` Liu Yubao
2006-11-07 13:15             ` Andy Whitcroft
2006-11-07 16:05         ` Linus Torvalds
2006-11-07 16:39           ` Jakub Narebski
2006-11-07 21:37           ` If merging that is really fast forwarding creates new commit Junio C Hamano
2006-11-07 22:02             ` Planned new release of git [was: Re: If merging that is really fast forwarding creates new commit] Jakub Narebski
2006-11-07 23:06               ` Linus Torvalds
2006-11-07 23:36                 ` Planned new release of git Junio C Hamano
2006-11-07 23:19               ` Junio C Hamano
2006-11-06 15:25 ` how to show log for only one branch Jakub Narebski
2006-11-07  3:47   ` Liu Yubao
2006-11-07  8:08     ` 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=45507692.7050100@gmail.com \
    --to=yubao.liu@gmail.com \
    --cc=ae@op5.se \
    --cc=apw@shadowen.org \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /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).