> 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 <gits...@pobox.com> wrote:
>
> Taylor Blau <m...@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)

Reply via email to