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

Re: Git does not recognise directory named '${sys:DATA_ROOT_DIR}'

From
ΣΝΣταύρος Ντέντος <stdedos@gmail.com>
Date
Sep 3, 2019, 19:55 UTC
Message-ID
<CAHMHMxX192aM5owHjvi3s06ZykcQAHsVneBsfv9YvbeYM-XTXA@mail.gmail.com>
In-Reply-To
<xmqqa7bltcyu.fsf@gitster-ct.c.googlers.com>
> Makes me wonder if git status could maybe warn about empty trees as 'untracked'?

Well, I "suppose" git-add could warn you that you are adding an empty tree (and I'd like if that happened, implicit vs explicit action i.e. ignoring). However, I assume the no-empty-tree case was a design decision; hence, it's been 2.2# versions without such warning.

I doubt it would be considered to be added now.
On Tue, Sep 3, 2019 at 10:08 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 12 quoted lines
>
> Taylor Blau <me@ttaylorr.com> writes:
>
> > If you wish to keep this directory "empty", but stored in Git, a common
> > convention is to create an empty '.gitkeep' file in the directory. This
> > file is not special in any way to Git, rather it serves as _a_ file to
> > keep the directory non-empty.
>
> Hmph, I thought the common convention was to create a ".gitignore"
> file in the directory with catch-all pattern, so that no matter what
> cruft you had there "git add" will not add anything from it, if you
> wish to keep this directory "empty".

I believe Taylor is talking about explicitly keeping a directory empty, that may or may not, in the future, contain files (that will be tracked) [1]. You are infering that, regardless if there are files or will be added in the future, you don't want to check anything in.

While [1] is a very niche corner case (and maybe it doesn't make sense to the most of us, true), there is a "debian-equivalent" behavior https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=812223

(I cannot find the definition of this behavior, but you can see an example usecase)

Previous: Junio C Hamano
Message 6 of 6 in “Git does not recognise directory named '${sys:DATA_ROOT_DIR}'”
  1. Σταύρος ΝτέντοςSep 3, 2019
  2. Taylor BlauSep 3, 2019
  3. Σταύρος ΝτέντοςSep 3, 2019
  4. Philip OakleySep 3, 2019
  5. Junio C HamanoSep 3, 2019
  6. Σταύρος ΝτέντοςSep 3, 2019

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.