git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Liu Yubao <yubao.liu@gmail.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: 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 15:59:56 +0800	[thread overview]
Message-ID: <45503CFC.7000403@gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0611060928180.3667@g5.osdl.org>

Linus Torvalds wrote:
> 
> On Mon, 6 Nov 2006, Linus Torvalds wrote:
>> Besides, doing an empty commit like that ("I fast forwarded") literally 
>> doesn't add any true history information. It literally views history not 
>> as history of the _project_, but as the history of just one of the 
>> repositories. And that's wrong.
>>
>> So just get used to it. You MUST NOT do what you want to do. It's stupid.
> 
> Btw, absolutely the _only_ reason people seem to want to do this is 
> because they want to "pee in the snow" and put their mark on things. They 
> seem to want to show "_I_ did this", even if the "doing" was a total 
> no-op and they didn't actually generate any real value.

We can kick out fake commits when calculate credits, we can grep logs with
author name to see what he/she has done.

Fake commit is only for digging branch scope history, I can *outline* what has
been merged to a branch and don't care about how these good work are done on 
earth.

> 
> That's absolutely the last thing you want to encourage, especially when 
> the end result is a history that is totally unreadable and contains more 
> "junk" than actual real work. 
> 
> I'll be the first to say that "merging code" is often as important as 
> actually writing the code in the first place, and that it is important to 
> show who actually did real work to make a patch appear in a project.
> 
> In the kernel, for example, we have "sign-off" lines to show what route a 
> patch took before it was accepted, and it's very instructive to see (for 
> example) how man patches give credit to somebody like Andrew Morton for 
> passing it on versus actually writing the code himself (he has a lot of 
> authorship credit too, but it's absolutely _dwarfed_ by his importance as 
> a maintainer - and if you were to ask any random kernel developer why 
> Andrew is so important, I can pretty much guarantee that his importance is 
> very much about those "sign-offs", and not about the patches he authors).
> 
> But at the same time, when it comes to merging, because it actually 
> clutters up history a lot, we actively try to _avoid_ it. Many subsystem 
> maintainers purposefully re-generate a linear history, rebased on top of 
> my current kernel, exactly because it makes the history less "branchy", 
> and because that makes things easier to see.
> 
> So we have actually done work to _encourage_ fast-forwarding over "merge 
> with a commit", because the fast-forwarding ends up generating a much more 
> readable and understandable history. Generating a _fake_ "merge commit" 
> would be absolutely and utterly horrible. It gives fake credit for work 
> that wasn't real work, and it makes history uglier and harder to read. 
> 
> So it's a real NEGATIVE thing to have, and you should run away from it as 
> fast as humanly possible.
> 
> Now, the kernel actually ends up being fairly branchy anyway, but that's 
> simply because we actually have a lot of real parallel development (I bet 
> more than almost any other project out there - we simply have more commits 
> done by more people than most projects). I tend to do multiple merges a 
> day, so even though people linearize their history individually, you end 
> up seeing a fair amount of merges. But we'd have a lot _more_ of them if 
> people didn't try to keep history clean.

That's right the central semantics I have said, git tends to and recommends
a trunk mode development *on a high level*. It's not a bad thing.

> 
> Btw, in the absense of a merge, you can still tell who committed 
> something, exactly because git keeps track of "committer" information in 
> addition to "authorship" information. I don't understand why other 
> distributed environments don't seem to do this - because separating out 
> who committed something (and when) from who authored it (and when) is 
> actually really really important.

Yes, agree.

> 
> And that's not just because we use patches and other SCM's than just git 
> to track things (so authorship and committing really are totally separate 
> issues), but because even if the author and committer is the same person, 
> it's very instructive to realize that it might have been moved around in 
> history, so it might actually have been cherry-picked later, and the 
> committer date differs from the author date even if the actual author and 
> committer are the same person (but you might also have had somebody _else_ 
> re-linearize or otherwise cherry-pick the history: again, it's important 
> to show the committer _separately_ both as a person and as a date).
> 
> And because there is a committer field, if you actually want to linearize 
> or log things by who _committed_ stuff, you can. Just do
> 
> 	git log --committer=torvalds
> 
 > on the kernel, and you can see the log as it pertains for what _I_
 > committed, for example. You can even show it graphically, although it
 > won't be a connected graph any more, so it will tend to be very ugly
 > (but you'll see the "linear stretches" when somebody did some work). Just
 > do "gitk --committer=myname" to see in your own project.
 >
 > 		Linus

I want to separate a branch, not to separate commits by some author, for 
example, many authors can contribute to git's master branch, I want to
know what happened in the master branch like this:
      good work from A;
      good work from C;
      merge from next;   -----> I don't care how this feature is realized.
      good work from A;
      ....

As Junio points out, HEAD^1 is not always the tip of working branch,
so "git log" can't never satisfy me. There is reflog, but it's not public.

BTW: I have a great respect for any man who contributes to Linux and GIT,
especially you:-)


  reply	other threads:[~2006-11-07  8: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   ` 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
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 [this message]
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=45503CFC.7000403@gmail.com \
    --to=yubao.liu@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=torvalds@osdl.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).