git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Using git for file archival/backup purposes - deletion strategy
@ 2007-12-26 22:43 Martin Langhoff
  2007-12-27  9:18 ` Johannes Sixt
  2007-12-27 16:36 ` Charles Bailey
  0 siblings, 2 replies; 4+ messages in thread
From: Martin Langhoff @ 2007-12-26 22:43 UTC (permalink / raw)
  To: Git Mailing List

Hi list!

I am drafting a tool to use GIT as a behind-the-scenes archival/backup
tool for web applications. There's been countless threads covering
generic file archival, discussing /etc and homedirs, so I am pretty
comfortable with the mechanics and the whole idea. This is a fairly
narrow use, where the web apps are reasonable well behaved -- most
(all?) of the caveats in ~ and /etc archival seem to be under control.

What I am not 100% clear on is the "old history" deletion strategy.
The history will be *strictly* linear, so my intention is to keep the
last N commits, by overriding the parent of the Nth commit that git
log lists with a "shallow" entry in $GIT_DIR/shallow as documented in
Documentation/technical/shallow.txt , and call gc after that.

Is that the correct way to "forget" old history? Searching high and
low in the list, I fail to find a definitive answer. Shallow and
grafts entries are discussed as ways of doing this, but I can't find a
"correct" way of doing this.

BTW I've just done a git clone --depth 10 ~/src/git and while I do get
a clearly "shallow" checkout, with a tiny .git/objects directory, I
can't find any file called shallow, or grafts. .git/config doesn't say
anything either, and alternates is empty. I frankly cannot tell how
git recognizes it as a shallow repo.

Ah! Local clones won't honour --depth!. A clone from git.kernel.org
does get its .git/shallow file.

So the question is: is it safe (and enough) to add the SHA1 to the
.git/shallow file and call git gc? Is there a better way?

cheers,


m

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-12-27 22:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-26 22:43 Using git for file archival/backup purposes - deletion strategy Martin Langhoff
2007-12-27  9:18 ` Johannes Sixt
2007-12-27 16:36 ` Charles Bailey
2007-12-27 22:08   ` Martin Langhoff

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).