From: Linus Torvalds <torvalds@osdl.org>
To: Liu Yubao <yubao.liu@gmail.com>
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: Mon, 6 Nov 2006 07:48:05 -0800 (PST) [thread overview]
Message-ID: <Pine.LNX.4.64.0611060734490.25218@g5.osdl.org> (raw)
In-Reply-To: <454F31D7.1030202@gmail.com>
On Mon, 6 Nov 2006, Liu Yubao wrote:
>
> Then, what bad *logical* problem will happen if a merging that is really a
> fast forwarding creates a new commit?
You MUST NOT do that.
If a fast-forward were to do a "merge commit", you'd never get into the
situation where two people merging each other would really ever get a
stable result. They'd just keep doing merge commits on top of each other.
Git tracks history, not "your view of history". Trying to track "your
view" is fundamentally wrong, because "your wiew" automatically means that
the project history would not be distributed any more - it would be
centralized around what _you_ think happened. That is not a sensible thing
to have in a distributed system.
For example, the way to break the "infinite merges" problem above is to
say that _you_ would be special, and you would do a "fast-forward commit",
and the other side would always just fast-forward without a commit. But
that is very fundamentally against the whole point of being distributed.
Now you're special.
In fact, even for "you", it would be horrible - because you personally
might have 5 different repositories on five different machines. You'd have
to select _which_ machine you want to track. That's simply insane. It's a
totally broken model. (You can even get the same situation with just _one_
repository, by just having five different branches - you have to decide
which one is the "main" branch).
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.
If you want to track the history of one particular local branch, use the
"reflog" thing. It allows you to see what one of your local branches
contained at any particular time.
See
[core]
logAllRefUpdates = true
documentation in "man git-update-refs" (and maybe somebody can write more
about it?)
next prev parent reply other threads:[~2006-11-06 15:48 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 [this message]
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=Pine.LNX.4.64.0611060734490.25218@g5.osdl.org \
--to=torvalds@osdl.org \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=yubao.liu@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).