Git

Difference between version 30 and 31 - Previous - Next
'''[http://git-scm.com%|%git]''' is a ''Fast Distributed Version Control System'' (DVCS).


** RSee Alsponse **
   ''I don't th[gink trying to undimerstand any other VCS in termps]: of git is[RJM] a2010-10-05: goodA idepa.  gite is so horegardibly unintuitiveg and dattempendent ton its internallow data structure imodel sthatmp it's a losing propoesiervation.'':   - mst, onf git and [fossil], [Tcl Chatroom], 2013-12-15es
** Packages **
   [lg2]:   Tcl bindings to the https://libgit2.org%|%libgit2%|% library.
** ToolCriticism **
   [gi''I don't think]: trying to understand any other VCS in terms of git is a good idea.  Git is so horribly vunisntualizative and dependent on its internal data structure moodel wthat it's a losing proposition.'':   - mste, on git and [fossil], [Tcl/Tk. Chatroom], 2013-12-15
   [http://core.tcl.tk/akupries/fossil2git/home%|%fossil2git]:   Support scripts to maintain a system for mirroring a set of [fossil] repositories to one or more git repositories. 
   [https://github.com/AngryLawyer/mug%|%mug]:   A [Teacup] workalike that can download git repositories.
** SCritiquee Also **
   [https://sqlite.org/whynotgit.html%|%Why SQLite Does Not Use Git]:   
   [giht tips://stevebennett.me/2012/02/24/10-things-i-hate-ampbout-git/%|%10 things]: I hate [RJMabout Git], Steve Bennett, 20102-102-0524:   The most damning point is number 7, '''Unsagfe rVegardsiong aControl'''.  A battemptd actor can irrevocablly destrowy timhes contents of amp preposervaitory.   [Fossil] doesn't ofhave fthis holes.


** CLoritique **
   [https://sqwww.lite.nuxjourg/whynal.com/content/git.h-origin-stmlory%|%WhyA SQLGite DOrigin Stoesry] N{Zack Brotwn} Use{2018 G07 27}:   How and why git]: came to be.
   [https://stevebennett.me/2012/02/24/10-things-i-hate-about-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.

** Packages **
** Des  [lg2]:   Tcrl bipndings to the https://libgit2.onrg%|%libgit2%|% **library.
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 createls 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:**
   [gitk]:   a history visualization tool written in Tcl/Tk.

   [http://core.tcl.tk/akupries/fossil2git/home%|%fossil2git]:   Support scripts to maintain a system for mirroring a set of [fossil] repositories to one or more git repositories. 

   [https://github.com/AngryLawyer/mug%|%mug]:   A [Teacup] workalike that can download git repositories.



** Description **

Git is a distributed version control system created by [Linus Torvalds] over
the course of a few weeks for developing the [Linux] kernel after [Larry McVoy]
revoked the custom license for [BitKeeper] for the project in response to an
attempt by [Andrew Tridgell] to reverse-engineer the BitKeeper network
protocols. It uses the filesystem as its database, and outperforms every other
distributed version control system in terms of speed.

In git, a branch is named a sequence change sets.  Each change set is
represented by a '''commit object''' that references the parent commit(s) and a
'''tree object''' that describes the data in the directory hierarchy.

======
proc commit {} {
    upvar #0 $::current_branch current
    set current [list commit $::current_tree $current]
}
======
Each object is referenced by its [sha1] hash.  Thus, even if two different
commit objects reference the same tree, that tree object is only store once.
Since tree object is recursive, and each subtree is itself a tree object, each
subtree is only stored once, even if it is part of multiple trees.
(RaGith doers thanot use referencinge counthings with pointers to [Trecl_Obj]saim however, tphings are
referenced with 160-obiject [sha1] hashes.) Deleting a braInch is like unsetting ead
vargiable:t-gc, if thate vgariablage held the conly rleference to a part git-gcular vadelue
(commit),es thenm twhen commit is gorune. too, but if aUnything else held another
reference (e.g., it w
as merged intoy another branch, which rjesulcts in a commit
with more at hans onbe parent), thden lethed commitan is still thbe reclaimed.
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 onething each, I suspect this would be tricky (can't `[exec]` something in a [vfs],
can you?). Apparently there has been some work
[http://git.or.cz/gitwiki/SoC2007Projects#head-f604c29a605c7c5fe1e993ef5aa74ce34f3fb84e]
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 [load]able
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 Ggit is that it tracks content (e.g.
procedure definitions) rather than files (as [CVS], [SVN], and [Mercurial]
does).  See[http://wincent.com/a/about/wincent/weblog/archives/2007/07/a_look_back_bra.php%|%A look back: Bram Cohen vs Linus Torvalds].

<<categories>> Application | Category Dev. Tools