git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Σταύρος Ντέντος" <stdedos@gmail.com>
To: Taylor Blau <me@ttaylorr.com>
Cc: git <git@vger.kernel.org>
Subject: Re: Git does not recognise directory named '${sys:DATA_ROOT_DIR}'
Date: Tue, 3 Sep 2019 17:11:38 +0300	[thread overview]
Message-ID: <CAHMHMxVy7Ud+pOHbfWXX4jzPoPng8TvR2zNgm_B56Srt64BrWw@mail.gmail.com> (raw)
In-Reply-To: <20190903133422.GA51158@syl.lan>

Hey Taylor,

This was happening on a (much) more massive repository; I simply tried
to dumb down the example.

The original folder did had a folder structure 3 levels deep.
Unfortunately, I don't remember if the leaves were files (or
directories themselves). However, since I "replicated" it, I went
ahead and cleaned up my main repo (sigh).

Thank you for reminding me of the empty-tree case :-)

(Reply-all missed the list)
-- 
Until next time,
Ντέντος Σταύρος

On Tue, Sep 3, 2019 at 4:34 PM Taylor Blau <me@ttaylorr.com> wrote:
>
> Hi,
>
> On Tue, Sep 03, 2019 at 03:44:14PM +0300, Σταύρος Ντέντος wrote:
> > Hello there,
> >
> > While the name is obviously a mistake, git refuses to even acknowledge
> > the directory.
> >
> > ```
> > u@h:~/$ mkdir init-test
> > u@h:~/$ cd init-test
> > u@h:~/init-test$ git init
> > Initialized empty Git repository in /home/u/init-test/.git/
> > u@h:~/init-test$ (master #) mkdir \$\{sys\:DATA_ROOT_DIR\}/
> > u@h:~/init-test$ (master #) git status
> > On branch master
> >
> > No commits yet
> >
> > nothing to commit (create/copy files and use "git add" to track)
> > u@h:~/init-test$ (master #) git add
> > .git/                    ${sys:DATA_ROOT_DIR}/
> > u@h:~/init-test$ (master #) git add \$\{sys\:DATA_ROOT_DIR\}/
> > u@h:~/init-test$ (master #) git commit --signoff -m'a'
> > On branch master
> >
> > Initial commit
> >
> > nothing to commit
> > u@h:~/init-test$ (master #)
> > ```
> >
> > Is that expected?
>
> Git does not track empty trees; that is to say 'git add' on an empty
> directory does not change the status of the index.
>
> Try for example:
>
>   $ git init repo && cd repo
>   $ mkdir -p dir
>   $ git add dir
>   $ git status
>
> And note that 'git status' says there are no changes.
>
> On the other hand, 'git add' performs fine even in a directory named
> '${sys:DATA_ROOT_DIR}'; simply create a file (even an empty one) within
> that directory and then run 'git add'. It will stage your "changes" as
> expected.
>
> 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.
>
> Hope this helps.
>
> > Ντέντος Σταύρος
>
> Thanks,
> Taylor

  reply	other threads:[~2019-09-03 14:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-03 12:44 Git does not recognise directory named '${sys:DATA_ROOT_DIR}' Σταύρος Ντέντος
2019-09-03 13:34 ` Taylor Blau
2019-09-03 14:11   ` Σταύρος Ντέντος [this message]
2019-09-03 16:45     ` Philip Oakley
2019-09-03 19:08   ` Junio C Hamano
2019-09-03 19:55     ` Σταύρος Ντέντος

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHMHMxVy7Ud+pOHbfWXX4jzPoPng8TvR2zNgm_B56Srt64BrWw@mail.gmail.com \
    --to=stdedos@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=me@ttaylorr.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).