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

Re: cg-status and empty directories

From
Andreas Ericsson <ae@op5.se>
Date
Feb 27, 2006, 15:22 UTC
Message-ID
<44031941.1020806@op5.se>
In-Reply-To
<3afbacad0602270643k9fdd255w8f3769ad77c54e65@mail.gmail.com>
Jim MacBaine wrote:
Show 21 quoted lines
> Hello,
> 
> Short story: Recently I noticed a change in the way, cogito handles
> empty directories.  Before, empty directories have been silently
> ignored. Now cg-status always lists the status of empty directories as
> unknown, but it still refuses to add them. If there is a good reason
> for this behaviour, can someone enlighten me?
> 
> Long story: I'm using cogito to track and distribute changes on the
> /etc directories of a few (almost) identical machines.  Whenever I
> install a package which modifies somthing in /etc, I commit those
> changes.  But with cg-status reporting all the empty directories as
> "unknown", my brain needs a long time to parse the list and find the
> really unknown files which shall be put under version control.
> 
> Many packages put empty directories under /etc, and although only a
> few of those directories are actually needed, the automatic removal of
> those packages will fail if I remove the empty directories manually.  
> Equally, the removal will fail, if I put a .placeholder file into
> those direrectories and cg-add it.  Is there a simple way out?
> 
I'm afraid not.

You should also note that git doesn't track permissions exactly. It just notices an execution bit and uses it to determine if it should write the working tree using (0666 ^ umask) or (0777 ^ umask). This makes it fairly unsuitable for /etc tracking unless you add some sort of permission restoring thing to it.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
Previous: Jim MacBaineNext: Jim MacBaine
Message 2 of 7 in “cg-status and empty directories”
  1. Jim MacBaineFeb 27, 2006
  2. Andreas EricssonFeb 27, 2006
  3. Jim MacBaineFeb 27, 2006
  4. Do not ever list empty directories in git-ls-files --othersPetr Baudis, Mar 26, 2006
  5. Optionally do not list empty directories in git-ls-files --othersPetr Baudis, Mar 26, 2006
  6. Junio C HamanoMar 26, 2006
  7. Petr BaudisMar 26, 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.