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

Re: /etc in git?

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Jan 19, 2006, 22:22 UTC
Message-ID
<Pine.LNX.4.64.0601191700120.25300@iabervon.org>
In-Reply-To
<7v64ogkdtu.fsf@assigned-by-dhcp.cox.net>
On Wed, 18 Jan 2006, Junio C Hamano wrote:
Show 12 quoted lines
> Adam Hunt <kinema@gmail.com> writes:
> 
> > Do you have any more details by chance?  Does it work?  Does it work
> > well?  How does one do it?
> 
> I personally feel it is a horrible and stupid thing to do, if by
> "version control /etc" you mean to have /.git which controls
> /etc/hosts and stuff in place.  It would work (git does not
> refuse to run as root).  But being a *source* control system, we
> deliberately refuse to store the full permission bits, so if
> your /etc/shadow is mode 0600 while /etc/hosts is mode 0644, you
> have to make sure they stay that way after checking things out.

At some point, people considered setting up an object type that would have all of the bits. That is, if you want a directory to come out literally the same as it went in, uid/gid/sticky-bit and all, you'd do something special to make this happen.

I think you could do some nifty stuff where you have git take care of /etc, and make all your changes to clones of the repository, push them, and check them out. I bet you could even have three-way merge on package installs this way; install the package into a fake root that has the /etc generated by the install of the previous version of the package (i.e., without your changes), commit that head, then merge that head into your master branch etc (in a non-real working tree, of course), check over the result, commit, push to the real repository, and check out. For that matter, you could probably generate the "package added replacing previous package" commit without using a working tree, directly from the package.

(Sure, it's currently set up for source control only, but the original theory was general content, and it should be good at producing exactly the right directory structure if it had a type to represent exact stuff like that)

	-Daniel
*This .sig left intentionally blank*
Previous: Joel Becker
Message 16 of 16 in “/etc in git?”
  1. Adam HuntJan 19, 2006
  2. Junio C HamanoJan 19, 2006
  3. Adam HuntJan 19, 2006
  4. H. Peter AnvinJan 19, 2006
  5. Junio C HamanoJan 19, 2006
  6. Ryan AndersonJan 19, 2006
  7. Junio C HamanoJan 19, 2006
  8. Support precise tracking of file modesPetr Baudis, Jan 19, 2006
  9. Junio C HamanoJan 19, 2006
  10. Petr BaudisJan 19, 2006
  11. Alex RiesenJan 20, 2006
  12. Peter BaumannJan 20, 2006
  13. Ryan AndersonJan 20, 2006
  14. Junio C HamanoJan 20, 2006
  15. Joel BeckerJan 19, 2006
  16. Daniel BarkalowJan 19, 2006

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.