git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Using git to store /etc, redux

From
Ddavid@lang.hm <david@lang.hm>
Date
May 19, 2007, 23:37 UTC
Message-ID
<Pine.LNX.4.64.0705191611150.6938@asgard.lang.hm>
In-Reply-To
<20070519174815.GA5124@hardeman.nu>
On Sat, 19 May 2007, David Härdeman wrote:
Show 18 quoted lines
> I recently had the idea to store and track /etc using git. When googling the 
> topic I came across the "Using git to store /etc" thread from the end of last 
> year which provided some interesting details on what would be necessary.
>
> It seems the file metadata (owner, group, mode, xattrs, etc) was the big 
> stumbling point, so I wrote up a tool over the last few days which allows the 
> metadata to be stored in a separate file which can be stored along with the 
> rest of the data in the repo (or separately).
>
> This is also useful for tripwire type checks and for other types of storage 
> which drops some of the metadata (tar comes to mind)...
>
> The tool (metastore) is available from: git://git.hardeman.nu/metastore.git
>
> Not completely cleaned up yet (it lacks a real README and some Makefile 
> targets) but I hope it might be useful to others (it sure is to me).
>
> Please CC me on any replies.

as I understand the issue, the problem isn't creating a tool to store the metadata, but in integrating things with git.

when checking something in a pre-commit hook needs to run the tool to store the data.

git supports this and it's pretty simple to do this.
however when checking things out there are approaches
1. modify git to have a post-checkout hook to set the metadata to match
    what was stored at checkin and accept the fact that this leaves a
    window where the file has the wrong metadata on it (between when the
    file is written and when the hook runs), or use a staging area to have
    copies of the files during check-in and check-out
2. modify git to know that it needs to check some files out before any
    others and use an expernal program to write the files to disk. Then
    this program can use the data stored at checkin to write the files with
    the appropriate metadata

unforutnantly until one of these is done by someone the utility of programs like your metastore are limited.

David Lang
Previous: David HärdemanNext: David Härdeman
Message 2 of 5 in “Using git to store /etc, redux”
  1. David HärdemanMay 19, 2007
  2. david@lang.hmMay 19, 2007
  3. David HärdemanMay 20, 2007
  4. Jan HudecMay 21, 2007
  5. David HärdemanMay 22, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.