git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Daniel Barkalow <barkalow@iabervon.org>
To: Kyle Moffett <mrmacman_g4@mac.com>
Cc: git@vger.kernel.org
Subject: Re: Using GIT to store /etc (Or: How to make GIT store all file permission bits)
Date: Wed, 13 Dec 2006 13:10:01 -0500 (EST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0612131156500.20138@iabervon.org> (raw)
In-Reply-To: <8900B938-1360-4A67-AB15-C9E84255107B@mac.com>

On Tue, 12 Dec 2006, Kyle Moffett wrote:

> Hmm, ok.  It would seem to be a reasonable requirement that if you want to
> change any of the "preserve_*_attributes" config options you need to blow away
> and recreate your index, no?  I would probably change the underlying index
> format pretty completely and stick a new version tag inside it.

You should be able to promote an insufficient-version index to a 
new-version index that's needs to be refreshed for every entry. (And then 
update-index would take care of the necessary rewrite-everything in the 
normal way). But I suspect that the right thing is to require that the 
repository be created with a "commits-include-directories-not-trees" flag, 
and this means that you always use the extra-detailed index, and the 
options only affect what information is filtered out in transit between 
the directory object and the index. Having more information in the index 
is merely a potential waste of space, not a correctness issue (we have 
extra information for trees in the index now, remember); it just means 
that there are more things that will cause git to reread the file, rather 
than declaring it unchanged with a stat().

For that matter, it may be best for the directory objects to record what 
information in them is real, and keep the "what's content" mask in the 
index as well. If it changes over the history of a repository, you want to 
correctly interpret the historical commits.

> Ok, seems straightforward enough.  One other thing that crossed my mind was
> figuring out how to handle hardlinks.  The simplest solution would be to add
> an extra layer of indirection between the "file inode" and the "file data".
> Instead of your directory pointing to a "file-data" blob and "file-attributes"
> object, it would point to an "file-inode" object with embedded attribute data
> and a pointer to the file contents blob.
>
> I remember reading some discussions from the early days of GIT about how that
> was considered and discarded because the extra overhead wouldn't give any real
> tangible benefit.  On the other hand for something like /etc the added
> benefits of tracking extended attributes and hardlinks might outweigh the cost
> of a bunch of extra objects in the database.  A bit of care with the
> construction of the index file should make it sufficiently efficient for
> day-to-day usage.

I was thinking this could be internal to the directory object, but you 
probably want to support hardlinks shared between dentries in different 
directory objects, so you're probably right that this makes sense. 

Alternatively, you could use a single "directory" object for the whole 
state (including subdirectories), making hardlinks out of the object 
clearly impossible, or you could use some scheme for sharing 
sub-"directory" objects that would imply that hardlinks are within an 
object (the hard part here is finding things when their locations aren't 
predictable by name).

	-Daniel

  parent reply	other threads:[~2006-12-13 18:16 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-10 13:40 Using GIT to store /etc (Or: How to make GIT store all file permission bits) Kyle Moffett
2006-12-10 14:49 ` Jeff Garzik
2006-12-10 15:30   ` Jakub Narebski
2006-12-10 18:10     ` Kyle Moffett
2006-12-10 18:18       ` Jakub Narebski
2006-12-10 18:26       ` Jakub Narebski
2006-12-10 18:35         ` Kyle Moffett
2006-12-11 10:39           ` Andreas Ericsson
2006-12-11 10:55             ` Jeff Garzik
2006-12-11 12:13             ` Josef Weidendorfer
2006-12-11 13:33               ` Johannes Schindelin
2006-12-11 15:07                 ` Josef Weidendorfer
2006-12-10 15:06 ` Santi Béjar
2006-12-10 17:46   ` Kyle Moffett
2006-12-10 18:10     ` Jakub Narebski
2007-01-10  1:39   ` David Lang
2007-01-10  2:30     ` Shawn O. Pearce
2007-01-10 18:34       ` David Lang
2007-01-12  0:55         ` Shawn O. Pearce
2006-12-11 10:50 ` Nikolai Weibull
2006-12-12  3:45 ` Daniel Barkalow
2006-12-12 13:49   ` Kyle Moffett
2006-12-12 15:53     ` Andy Parkins
2006-12-12 22:49       ` Using git as a general backup mechanism (was Re: Using GIT to store /etc) Steven Grimm
2006-12-12 22:57         ` Johannes Schindelin
2006-12-12 23:06           ` Steven Grimm
2006-12-13  0:01             ` Johannes Schindelin
2006-12-12 23:15         ` Martin Langhoff
2006-12-12 23:23           ` Martin Langhoff
2006-12-12 23:43         ` Using git as a general backup mechanism Junio C Hamano
2006-12-14 23:33           ` Steven Grimm
2006-12-15  0:33             ` Junio C Hamano
2006-12-13 18:10     ` Daniel Barkalow [this message]
2006-12-14  5:06       ` Using GIT to store /etc (Or: How to make GIT store all file permission bits) Chris Riddoch

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

  List information: http://vger.kernel.org/majordomo-info.html

* 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.0612131156500.20138@iabervon.org \
    --to=barkalow@iabervon.org \
    --cc=git@vger.kernel.org \
    --cc=mrmacman_g4@mac.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).