git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Liu Yubao <yubao.liu@gmail.com>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: If merging that is really fast forwarding creates new commit [Was: Re: how to show log for only one branch]
Date: Mon, 06 Nov 2006 21:00:07 +0800	[thread overview]
Message-ID: <454F31D7.1030202@gmail.com> (raw)
In-Reply-To: <7vk629f6is.fsf@assigned-by-dhcp.cox.net>

Thanks to Junio for his patient explanation about branches in git, I find 
there is a subtle difference between GIT and regular VCS that can be easily
neglected by newbies.

I realize that git is a *content tracker*, it only creates commit object
when the corresponding tree is really modified, git records content merging
but not usual merging operation, that's why git is called a content tracker.
This explains why a merging that is really a fast forwarding doesn't create
any new commit.

This feature is different from many regular VCS like CVS and Subversion and
confuses newbies that come from them: mainline doesn't make sense too much,
'git log' shows many logs from other branches. In git, a branch is almost a
tag, you can't get the *track* of a branch(It's a pity reflog is only for
local purpose). I am used to one-trunk-and-more-side-branches way, every
branches are isolated clearly, git makes me very confused at the beginning.


Then, what bad *logical* problem will happen if a merging that is really a 
fast forwarding creates a new commit?

If we throw away all compatibility, efficiency, memory and disk consumption
problems,
(1) we can get the track of a branch without reflog because HEAD^1 is
always the tip of target branch(or working branch usually) before merging.

(2) with the track, branch mechanism in git is possibly easier to understand,
especially for newbies from CVS or Subversion, I really like git's light 
weight, simple but powerful design and great efficiency, but I am really
surprised that 'git log' shows logs from other branches and a side branch can 
become part of main line suddenly.

A revision graph represents fast forwarding style merging like this:

             (fast forwarding)
  ---- a ............ * ------> master
        \            /
         b----------c -----> test         (three commits with three trees)

can be changed to:

  ---- a (tree_1) ----------- d (tree_3) ------> master
        \                    /
         b (tree_2) ------- c (tree_3) ----> test
(four commits with three trees, it's normal as more than one way can reach 
Rome :-)


I don't think I am smarter than any people in this mailing list, in fact
I am confused very much by GIT's branches at the beginning. There must
be many problems I haven't realized, I am very curious about them, any

  parent reply	other threads:[~2006-11-06 13:01 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   ` Liu Yubao [this message]
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
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=454F31D7.1030202@gmail.com \
    --to=yubao.liu@gmail.com \
    --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).