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

Re: Unix root dir as a work tree

From
João Carlos Mendes Luís <jonny@jonny.eng.br>
Date
Feb 8, 2010, 12:17 UTC
Message-ID
<4B7000C7.30507@jonny.eng.br>
In-Reply-To
<fcaeb9bf1002071803o343bed87u2e1df2ef77db607f@mail.gmail.com>
Nguyen Thai Ngoc Duy wrote:
Show 25 quoted lines
> 2010/2/8 João Carlos Mendes Luís <jonny@jonny.eng.br>:
>   
>> Hi,
>>
>>   Sorry if this is a FAQ, but I could not find any reference.
>>
>>   I have been using CVS as a version control system for unix configuration
>> files for a long time.  I know it has some limitations, and I know git also
>> has its.  But I expect to work around all of them using etckeeper.
>>
>>   The problem is that etckeeper was created with /etc only in mind, and I
>> want to keep track of important files everywhere, not only below /etc (think
>> /opt, /usr/local).  The obvious solution appear to create the repository at
>> the system root, and not at /etc, but it did not work.  I think, because of
>> a bug.
>>
>>  Now, I have a patch that appears to work, but since I am a beginner to git,
>> I don't know if this is the best way to implement it, if it has any side
>> effects, or even if it works for other operating systems (probably they
>> don't even have the bug).  Would any git wizard care to look at it, check if
>> it is ok, and maybe commit in HEAD or give me any advice against my patch?
>>     
>
> How did you set GIT_DIR and GIT_WORK_TREE? What command failed?
>   

Did not set any env special variable. I expect git to find those automatically.

Any command which needs a work tree fails.  git-add, git-status, etc.
It thinks that its root is "/.git", instead of "/".  Easy to repeat.

cd / git init git add etc/motd # this works cd etc git add resolv.conf # this does not work without my patch

Previous: Nguyen Thai Ngoc DuyNext: Nguyen Thai Ngoc Duy
Message 3 of 4 in “Unix root dir as a work tree”
  1. João Carlos Mendes LuísFeb 8, 2010
  2. Nguyen Thai Ngoc DuyFeb 8, 2010
  3. João Carlos Mendes LuísFeb 8, 2010
  4. Nguyen Thai Ngoc DuyFeb 8, 2010

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.