git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Does GIT has vc keywords like CVS/Subversion?

From
Linus Torvalds <torvalds@osdl.org>
Date
Oct 10, 2006, 17:14 UTC
Message-ID
<Pine.LNX.4.64.0610101005420.3952@g5.osdl.org>
In-Reply-To
<20061010164927.GC16412@spearce.org>
On Tue, 10 Oct 2006, Shawn Pearce wrote:
Show 10 quoted lines
> 
> 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
Previous: Shawn PearceNext: Junio C Hamano
Message 11 of 12 in “Does GIT has vc keywords like CVS/Subversion?”
  1. Dongsheng SongOct 9, 2006
  2. Liu YubaoOct 9, 2006
  3. Petr BaudisOct 9, 2006
  4. Linus TorvaldsOct 9, 2006
  5. Martin LanghoffOct 9, 2006
  6. Johannes SchindelinOct 9, 2006
  7. Martin LanghoffOct 9, 2006
  8. Junio C HamanoOct 9, 2006
  9. Rene ScharfeOct 10, 2006
  10. Shawn PearceOct 10, 2006
  11. Linus TorvaldsOct 10, 2006
  12. Junio C HamanoOct 10, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.