From: Linus Torvalds <torvalds@osdl.org>
To: Shawn Pearce <spearce@spearce.org>
Cc: Martin Langhoff <martin.langhoff@gmail.com>, git@vger.kernel.org
Subject: Re: Does GIT has vc keywords like CVS/Subversion?
Date: Tue, 10 Oct 2006 10:14:54 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0610101005420.3952@g5.osdl.org> (raw)
In-Reply-To: <20061010164927.GC16412@spearce.org>
On Tue, 10 Oct 2006, Shawn Pearce wrote:
>
> Now I'd like to take these snapshots every so often, load them
> into Git on a special branch just for the snapshots, then generate
> a merge commit on that branch which merges the real commit that
> corresponds as closely as possible to to this snapshot into the
> snapshot branch. Part of the reason for doing this is to look
> for unexpected differences between what Git has and what the file
> revision storage tool has.
>
> But doing that is nearly impossible, so I don't.
Well, it probably wouldn't be too nasty to try to have a "find nearest
commit" kind of thing. It's not quite as simple as bisection, but you
could probably use a bisection-like algorithm to do something like a
binary search to try to guess which tree is the closest.
In other words, if you just give git a "range" of commits to look at, and
let a bisection-line thing pick a mid-way point, you can then compare the
mid-way point and the end-points (more than two) against the target tree,
and then pick the range that looks "closer".
I wouldn't guarantee that it finds the best candidate (since the "closer"
choice will inevitably not guarantee a monotonic sequence), but I think
you could probably most of the time find something that is reasonably
close.
If you do a lot of branching, you'd have to be a lot smarter about it
(since you'd not have _one_ commit for beginning/end), but in a
straight-line tree it should be really trivial, and in a branchy one I
think it should still be quite doable.
I dunno. It might be useful even if it's just a heuristic, in a "try to
find a commit in the range X..Y that generates the smallest diff when
compared against this tree". If it finds something sucky, you can try to
look at the history of one of the files that generates a big diff, and try
to give a better range - the automation should hopefully have given you
_some_ clues.
Linus
next prev parent reply other threads:[~2006-10-10 17:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-09 1:25 Does GIT has vc keywords like CVS/Subversion? Dongsheng Song
2006-10-09 2:44 ` Liu Yubao
2006-10-09 2:59 ` Petr Baudis
2006-10-09 16:13 ` Linus Torvalds
2006-10-09 21:08 ` Martin Langhoff
2006-10-09 22:48 ` Johannes Schindelin
2006-10-09 22:57 ` Martin Langhoff
2006-10-09 22:55 ` Junio C Hamano
2006-10-10 7:37 ` Rene Scharfe
2006-10-10 16:49 ` Shawn Pearce
2006-10-10 17:14 ` Linus Torvalds [this message]
2006-10-10 17:41 ` Junio C Hamano
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.0610101005420.3952@g5.osdl.org \
--to=torvalds@osdl.org \
--cc=git@vger.kernel.org \
--cc=martin.langhoff@gmail.com \
--cc=spearce@spearce.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).