All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Ericsson <ae@op5.se>
To: Kyle Moffett <mrmacman_g4@mac.com>
Cc: Jakub Narebski <jnareb@gmail.com>, git@vger.kernel.org
Subject: Re: Using GIT to store /etc (Or: How to make GIT store all file permission bits)
Date: Mon, 11 Dec 2006 11:39:47 +0100	[thread overview]
Message-ID: <457D3573.2010001@op5.se> (raw)
In-Reply-To: <19476830-E30A-42B7-AD9B-4C417D830C8E@mac.com>

Kyle Moffett wrote:
> On Dec 10, 2006, at 13:26:32, Jakub Narebski wrote:
>> The idea is to not store /etc in git directly, but use import/export 
>> scripts, which for example saves permissions and ownership in some 
>> file also tracked by git on import, and restores correct permissions 
>> on export. That is what I remember from this discussion. This of 
>> course means that you would have to write your own porcelain...
>>
>> What about mentioned in other email IsiSetup?
> 
> The real problem I have with that is you literally have to duplicate all 
> sorts of functionality.  I want to run "foo-status" in /etc and get 
> something useful, but if /etc is not a git directory in and of itself 
> then you have to duplicate most of "git-status" anyways.

Make /etc/.git a symlink to where you store your repo and go to the 
other directory when you want to *restore* configuration. The only "own 
porcelain" you need to write is a simple program that understands "save" 
and "restore" (or some such) and tucks away the meta-data in a file 
somewhere inside the git tree. If you make it in the format

octal-mode path/to/file

you can even get decently human-readable permission diffs, which will 
most likely be prettier and easier to read than anything git currently has.

> 
> GIT already has _some_ idea about file permissions, it just discards 
> most of the data before writing to disk.   Of course, adding POSIX ACLs
> and user-extended-attributes requires a new data format, but those are 
> very similar to filesystem permissions; they differ only in amount of 
> data stored, not in purpose.
> 

The amount of data stored is the issue here. The current implementation 
(which works just fine and does The Right Thing(tm) for code-repos) only 
stores what it has to and uses the spare bits to do other things.

> Import/export scripts literally require wrapping every single GIT 
> command with a script that changes directory a few times, reads from a 
> different checked-out tree, and permutes some extended-attribute data 
> slightly before storing it in the underlying GIT tree.  Even without 
> adding any new functionality whatsoever that doubles the amount of code 
> just for finding your repository and checking command-line arguments, 
> and that's a crazy trade-off to make in any situation.
> 

GIT_DIR=/some/where/else/.git git log -p

Why would you want to read from a different checked-out tree? 
Non-committed data is "changes", committed data is "HEAD" (or 
commit-ish) and marked data is "index". I see no reason what so ever for 
a second checked-out tree.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se

  reply	other threads:[~2006-12-11 10:39 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 [this message]
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     ` Using GIT to store /etc (Or: How to make GIT store all file permission bits) Daniel Barkalow
2006-12-14  5:06       ` 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=457D3573.2010001@op5.se \
    --to=ae@op5.se \
    --cc=git@vger.kernel.org \
    --cc=jnareb@gmail.com \
    --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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.