From: Christian Couder <chriscool@tuxfamily.org>
To: Jeff King <peff@peff.net>
Cc: Christian Couder <christian.couder@gmail.com>,
"Ted Ts'o" <tytso@mit.edu>,
Linus Torvalds <torvalds@linux-foundation.org>,
Shawn Pearce <spearce@spearce.org>,
Git Mailing List <git@vger.kernel.org>,
Junio C Hamano <gitster@pobox.com>
Subject: Re: Git commit generation numbers
Date: Tue, 19 Jul 2011 06:14:38 +0200 [thread overview]
Message-ID: <201107190614.38431.chriscool@tuxfamily.org> (raw)
In-Reply-To: <20110718034106.GB2468@sigill.intra.peff.net>
On Monday 18 July 2011 05:41:06 Jeff King wrote:
> On Sat, Jul 16, 2011 at 11:16:45AM +0200, Christian Couder wrote:
> > If "git tag --contains" and "git branch --contains" give incorrect
> > answers because the commiter date is wrong in some commits, then why
> > not use "git replace" to "change" the commiter date in the commits
> > that have a wrong date? Is it because you don't want to use "git
> > replace", or because there is no script to do it automatically, or is
> > there another reason?
>
> That would work. There are a few tricky things, though:
>
> 1. Most commits have less than 100 skewed commits. But some have many
> (e.g., thousands in the mesa repo). How well does git cope with
> large numbers of replace refs, performance-wise?
If it did not cope well, it should be possible to improve the performance.
Anyway, another way to fix the problem with "git replace" could be to create
branches with commits that have a fixed commiter date and then to use "git
replace" only to connect these branches to the graph.
For example if you have this:
A - B - X1 - X2 - X3 - C - D
where X1, X2 and X3 are skewed, then you can create this:
A - B - X1 - X2 - X3 - C - D
\ Y1 - Y2 - Y3
where Y1, Y2, Y3 are the same as X1, X2, X3 except they are not skewed.
Then you only need to do "git replace X3 Y3" so you create only one replace
ref.
>
> 2. Declaring which commits are skewed is actually tricky. You can find
> a commit whose timestamp is less than the timestamp of one of its
> ancestors. But you don't know whether it is skewed, or the
> ancestor.
>
> If you are implementing a list of commits whose timestamps
> shouldn't be used for traversal cutoff, it doesn't really matter
> who is _right_; you just care about whether the timestamps are
> strictly increasing from that point.
>
> But once you start replacing commits, you need to put in a
> reasonable value for the timestamp. So you may well be replacing a
> perfectly valid commit with one that has bogus, skewed information
> in the commit timestamp.
Perhaps but with "git replace" you can choose to create new replace refs and
deprecate the old replace refs to fix this where you got it wrong.
It would be easier to do that if "git replace" supported sub directories like
"refs/replace/clock-skew/ted-july-2011/", so you could manage the replace refs
more easily.
For example you could create new refs in "refs/replace/clock-skew/ted-
july-2011-2/" if you found a better fix. And then use these new refs instead of
those in "refs/replace/clock-skew/ted-july-2011/".
> 3. Any value you put in is actually going to be a lie during things
> like "git log --pretty=raw". That may be OK. But it is letting an
> optimization meant to make traversal fast and accurate bleed into
> the actual data we show the user.
With replace refs, the user could choose the "lies" told to him/her by
selecting the replace refs or set of replace refs that are used.
As commits are immutable, when they are created with bad data, the best we can
do is let the user choose if they want to see the original or another "fixed"
version. Because the original will always be "true" in a way.
> 4. Sometimes we need to do traversals on the real objects (e.g.,
> because we are doing upload-pack). To get the benefit, those
> traversals would presumably need to look at both the original
> object and the replacement, use the timestamp from the replacement
> for traversal, but otherwise use the original object.
Yeah, or maybe when we do traversals on real objects we could afford not to
rely on commiter date or some other "fragile" data.
Thanks,
Christian.
next prev parent reply other threads:[~2011-07-19 4:16 UTC|newest]
Thread overview: 89+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-14 18:24 Git commit generation numbers Linus Torvalds
2011-07-14 18:37 ` Jeff King
2011-07-14 18:47 ` Linus Torvalds
2011-07-14 18:55 ` Linus Torvalds
2011-07-14 19:12 ` Jeff King
2011-07-14 19:46 ` Ted Ts'o
2011-07-14 19:51 ` Linus Torvalds
2011-07-14 20:07 ` Jeff King
2011-07-14 20:08 ` Ted Ts'o
2011-07-14 19:08 ` Jeff King
2011-07-14 19:23 ` Linus Torvalds
2011-07-14 20:01 ` Jeff King
2011-07-14 20:19 ` Linus Torvalds
2011-07-14 20:31 ` Jeff King
2011-07-15 1:19 ` Linus Torvalds
2011-07-15 2:41 ` Geert Bosch
2011-07-15 7:46 ` Jeff King
2011-07-15 16:10 ` Linus Torvalds
2011-07-15 16:18 ` Shawn Pearce
2011-07-15 16:44 ` Linus Torvalds
2011-07-15 18:42 ` Ted Ts'o
2011-07-15 19:00 ` Linus Torvalds
2011-07-16 9:16 ` Christian Couder
2011-07-18 3:41 ` Jeff King
2011-07-19 4:14 ` Christian Couder [this message]
2011-07-19 20:00 ` Jeff King
2011-07-21 6:29 ` Christian Couder
2011-07-15 18:46 ` Tony Luck
2011-07-15 18:58 ` Linus Torvalds
2011-07-15 19:48 ` Jeff King
2011-07-15 20:07 ` Jeff King
2011-07-15 21:17 ` Linus Torvalds
2011-07-15 21:54 ` Jeff King
2011-07-15 23:10 ` Linus Torvalds
2011-07-15 23:16 ` Linus Torvalds
2011-07-15 23:36 ` Linus Torvalds
2011-07-16 0:42 ` Jeff King
2011-07-16 0:40 ` Jeff King
2011-07-15 9:12 ` Jakub Narebski
2011-07-15 9:17 ` Long, Martin
2011-07-15 15:33 ` Long, Martin
2011-07-15 16:15 ` Drew Northup
2011-07-14 18:52 ` Linus Torvalds
2011-07-14 19:08 ` Jakub Narebski
2011-07-14 20:26 ` Junio C Hamano
2011-07-14 20:41 ` Jeff King
2011-07-14 21:30 ` Junio C Hamano
-- strict thread matches above, loose matches on Subject: below --
2011-07-17 18:27 George Spelvin
2011-07-17 19:00 ` Long, Martin
2011-07-17 19:30 ` Linus Torvalds
2011-07-17 23:39 ` George Spelvin
2011-07-17 23:58 ` Linus Torvalds
2011-07-18 5:13 ` George Spelvin
2011-07-18 10:28 ` Anthony Van de Gejuchte
2011-07-18 11:48 ` George Spelvin
2011-07-20 20:51 ` Nicolas Pitre
2011-07-20 22:16 ` George Spelvin
2011-07-20 23:26 ` david
2011-07-20 23:36 ` Nicolas Pitre
2011-07-21 0:08 ` Phil Hord
2011-07-21 0:18 ` david
2011-07-21 0:37 ` Shawn Pearce
2011-07-21 0:47 ` Phil Hord
2011-07-21 4:26 ` david
2011-07-21 12:43 ` George Spelvin
2011-07-21 19:19 ` Jakub Narebski
2011-07-21 20:27 ` George Spelvin
2011-07-21 20:33 ` Shawn Pearce
2011-07-22 12:18 ` Jakub Narebski
2011-07-22 13:09 ` Nicolas Pitre
2011-07-22 18:02 ` david
2011-07-22 18:34 ` Jakub Narebski
2011-07-22 19:06 ` Linus Torvalds
2011-07-22 22:02 ` Jeff King
2011-07-28 15:00 ` Felipe Contreras
2011-09-06 10:02 ` Ramkumar Ramachandra
2011-07-22 19:08 ` david
2011-07-22 19:40 ` Nicolas Pitre
2011-07-22 18:02 ` david
2011-07-21 0:39 ` Phil Hord
2011-07-21 0:58 ` Nicolas Pitre
2011-07-21 1:09 ` Phil Hord
2011-07-21 12:03 ` Drew Northup
2011-07-21 12:55 ` George Spelvin
2011-07-21 15:57 ` Drew Northup
2011-07-21 16:24 ` Phil Hord
2011-07-21 22:40 ` Pēteris Kļaviņš
2011-07-22 9:30 ` Christian Couder
2011-07-21 17:36 ` George Spelvin
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=201107190614.38431.chriscool@tuxfamily.org \
--to=chriscool@tuxfamily.org \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
--cc=spearce@spearce.org \
--cc=torvalds@linux-foundation.org \
--cc=tytso@mit.edu \
/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).