From: Linus Torvalds <torvalds@linux-foundation.org>
To: Jeff King <peff@peff.net>
Cc: Roman Zippel <zippel@linux-m68k.org>,
Tim Harper <timcharper@gmail.com>,
git@vger.kernel.org
Subject: Re: Bizarre missing changes (git bug?)
Date: Tue, 29 Jul 2008 10:25:35 -0700 (PDT) [thread overview]
Message-ID: <alpine.LFD.1.10.0807291006070.3334@nehalem.linux-foundation.org> (raw)
In-Reply-To: <20080729125247.GC12069@sigill.intra.peff.net>
On Tue, 29 Jul 2008, Jeff King wrote:
>
> I glanced briefly over "gitk kernel/printk.c" and it looks pretty sane.
Jeff, it _is_ sane. When Roman says it's "incorrect", he is just wrong.
But it's true that "gitk kernel/printk.c" does simplify the history, and
does so very aggressively. It does so very much by design, and has done it
since pretty much day one. And it's a good thing - and it is "correct" -
but it does mean that you may literally be missing things that are part of
"history" but that didn't matter much.
The most trivial way to show this is actually by making such a simple case
that it's obvious what is going on. Do this:
mkdir test-simplification
cd test-simplification
git init
echo "Hi there" > file
git add file
git commit -m"Initial file"
git branch other-branch
echo "Hello" > file
git add file
git commit -m"Modified file"
git checkout other-branch
echo "Hello" > file
git add file
git commit -m"Another person modified the file identically"
echo "This is a stupid example" > another-file
git add another-file
git commit -m"Add another file"
git merge master
Now, do these three things
gitk
gitk file
gitk --full-history file
and compare them. They all show _different_ histories.
Which one is "correct"? They all are. It just depends on what you want to
see.
The "gitk file" history is the simplest one BY FAR, because it has very
aggressively simplified history to the point where it tried to find the
_simplest_ history that explains the current contents of 'file'[*]
>From a practical standpoint, and from having used this a long time, I'd
argue that the simple history is the one that you want 99.9% of all time.
But not _always_. Sometimes, the things that got simplified away actually
matter. It's rare, but it happens.
For example, maybe you had a bug-fix that you _know_ you did, and it it
doesn't show up in the simplified history. That really pisses you off, and
it apparently really pisses Roman off that it can happen. But the fact is,
that still doesn't mean that the simple history is "wrong" or even
"incomplete".
No, it's actually meaningful data in itself. If the bug-fix doesn't show
in the simplified history, then that simply means that the bug-fix was not
on a branch that could _possibly_ have mattered for the current contents.
So once you are _aware_ of history simplification and are mentally able to
accept it, the fact that history got simplified is actually just another
tool.
And that's why "-full-history" and "git whatchanged" exist. They are ways
to start delving deeper - they shouldn't be the _default_ mode, but they
are ways to show more information when the initial default simple mode
turns out to show that something didn't even matter for the end result.
And yes, there is a mid-way point between "aggressive simplification"
(default) and "no simplification at all" (--full-history). It's more
complex than either, and I do think it would be useful to have. It's what
Roman wants, but as long as he thinks it's the _only_ correct answer, and
refuses to face the performance issues, the discussion with Roman is kind
of pointless.
Linus
[*] when I say "_simplest_ history", I do want to point out that the
history simplification is always a "local optimization", and it doesn't
try to check all possible paths: there can be other histories that are
even simpler on a global scale.
But in practice it is _one_ history of the file, and it's a history that
is not "unnecessarily complicated" considering the simple heurstics for
finding it.
So think "local minima" instead of "global minima", and in practice the
local one is pretty close to the global one, although there are obviously
always extreme cases where the two can differ by a whole lot.
next prev parent reply other threads:[~2008-07-29 17:30 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-21 20:26 Bizarre missing changes (git bug?) Tim Harper
2008-07-21 20:37 ` Linus Torvalds
2008-07-21 22:53 ` Tim Harper
2008-07-21 22:55 ` Tim Harper
[not found] ` <8C23FB54-A28E-4294-ABEA-A5766200768B@gmail.com>
2008-07-21 22:57 ` Linus Torvalds
2008-07-26 3:12 ` Roman Zippel
2008-07-26 19:58 ` Linus Torvalds
2008-07-27 17:50 ` Roman Zippel
2008-07-27 18:47 ` Linus Torvalds
2008-07-27 23:14 ` Roman Zippel
2008-07-27 23:18 ` Linus Torvalds
2008-07-28 0:00 ` Roman Zippel
2008-07-28 5:00 ` Linus Torvalds
2008-07-28 5:30 ` Linus Torvalds
2008-07-29 2:59 ` Roman Zippel
2008-07-29 3:15 ` Martin Langhoff
2008-07-30 0:16 ` Roman Zippel
2008-07-30 0:25 ` Martin Langhoff
2008-07-30 0:32 ` Linus Torvalds
2008-07-30 0:48 ` Linus Torvalds
2008-07-30 23:56 ` Junio C Hamano
2008-07-31 0:15 ` Junio C Hamano
2008-07-31 0:30 ` Linus Torvalds
2008-07-31 8:17 ` [PATCH v2] revision traversal: show full history with merge simplification Junio C Hamano
2008-07-31 8:18 ` Junio C Hamano
2008-07-31 22:30 ` Linus Torvalds
2008-07-31 22:09 ` [PATCH v3-wip] " Junio C Hamano
2008-07-31 22:26 ` Linus Torvalds
2008-07-31 22:36 ` Junio C Hamano
2008-08-01 3:00 ` Junio C Hamano
2008-08-01 3:48 ` Linus Torvalds
2008-08-01 7:50 ` Junio C Hamano
2008-07-30 8:36 ` Bizarre missing changes (git bug?) Jakub Narebski
2008-07-29 3:29 ` Linus Torvalds
2008-07-29 3:33 ` Linus Torvalds
2008-07-29 11:39 ` Roman Zippel
2008-07-29 12:00 ` David Kastrup
2008-07-29 15:50 ` Linus Torvalds
2008-07-30 1:14 ` Roman Zippel
2008-07-30 1:32 ` Kevin Ballard
2008-07-30 1:49 ` Linus Torvalds
2008-07-29 5:31 ` Jeff King
2008-07-29 12:32 ` Roman Zippel
2008-07-29 12:48 ` Olivier Galibert
2008-07-29 12:52 ` Jeff King
2008-07-29 17:25 ` Linus Torvalds [this message]
2008-07-30 1:50 ` Roman Zippel
2008-07-30 2:05 ` Linus Torvalds
2008-07-30 4:26 ` Jeff King
2008-07-30 4:52 ` Linus Torvalds
2008-07-30 2:48 ` Roman Zippel
2008-07-30 3:20 ` Kevin Ballard
2008-07-30 3:21 ` Linus Torvalds
2008-07-30 3:35 ` Linus Torvalds
2008-07-30 4:23 ` Jeff King
2008-07-27 23:25 ` Martin Langhoff
2008-07-28 1:29 ` Roman Zippel
2008-07-21 20:42 ` Alex Riesen
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=alpine.LFD.1.10.0807291006070.3334@nehalem.linux-foundation.org \
--to=torvalds@linux-foundation.org \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
--cc=timcharper@gmail.com \
--cc=zippel@linux-m68k.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).