Updated 2018-04-16 21:20:17 by AMG

git is a Fast Distributed Version Control System (DVCS).

Response  edit

I don't think trying to understand any other VCS in terms of git is a good idea. git is so horribly unintuitive and dependent on its internal datastructure model that it's a losing proposition.
- mst, on git and fossil, Tcl Chatroom, 2013-12-15

Tools  edit

gitk
a history visualization tool written in Tcl/Tk.
fossil2git
Support scripts to maintain a system for mirroring a set of fossil repositories to one or more git repositories.

See Also  edit

git timestamps
RJM 2010-10-05: a page regarding an attempt to allow timestamp preservation of files

Critique  edit

Why SQLite Does Not Use Git
10 things I hate about Git, Steve Bennett, 2012-02-24
The most damning point is number 7, Unsafe Version Control. A bad actor can irrevocably destroy the contents of a repository. Fossil doesn't have this hole.

Description  edit

Git is popular version control system designed to handle very large projects with speed and efficiency; it is used mainly for various open source projects, most notably the Linux kernel.

Branches in git are kind of like variables in Tcl. When one makes a commit, one creates a commit object, that "contains" the parent commit(s) and a directory tree specifying the current state of one's working directory, kind of like:
proc commit {} {
    upvar #0 $::current_branch current
    set current [list commit $::current_tree $current]
}

(Rather than referencing things with pointers to Tcl_Objs however, things are referenced with 160-bit sha1 hashes.) Deleting a branch is like unsetting a variable: if that variable held the only reference to a particular value (commit), then the commit is gone too, but if anything else held another reference (e.g., it was merged into another branch, which results in a commit with more than one parent), then the commit is still there.

Of course, since all of it is stored on disk, it would be impractical to use a refcount scheme to reclaim unused memory. Instead git has a garbage collector git-gc. Until that is run, deleted commits (and whatever) can still be accessed by giving explicit hash numbers.

Zarutian 2007-07-16: Can git be obtained or compiled into a multiplatform starkit? Hard when one has only an thumbdrive/ipod to store stuff.

Lars H 2008-06-05: Since it's a Unixy collection of many programs that do one thing each, I suspect this would be tricky (can't exec something in a vfs, can you?). Apparently there has been some work [1] on turning it into a library, but that only got part of the way.

Makes me wonder, though… Could there be a semi-automatic way of turning a suite of C programs (like git, or at least the git plumbing) into a loadable extension which exposes each program as a Tcl command? (I expect one would have to do things like turning static C variables into fields of some dynamically allocated struct, to ensure reentrancy, but C is not my forte.)

FWIW, I later noticed that git has a concept of builtin command, with something rather close to a Tcl_CmdProc for every built-in subcommand of git. Probably not too hard to wrap manually, provided the built-in commands don't try to exec each other.

A thing that seems to be special about Git is that it tracks content (e.g. procedure definitions) rather than files (as CVS, SVN, and Mercurial does). See [2].