From: Jonas Fonseca <fonseca@diku.dk>
To: git@vger.kernel.org
Subject: Adding empty directory gives bogus error message
Date: Sun, 10 Jun 2007 22:46:48 +0200 [thread overview]
Message-ID: <20070610204648.GA32214@diku.dk> (raw)
Hello,
During a talk with madduck on #git today, we stumbled upon this
confusing error message:
$ mkdir repo
$ cd repo/
$ git init
Initialized empty Git repository in .git/
$ mkdir empty
$ git add empty/
The following paths are ignored by one of your .gitignore files:
empty/ (directory)
Use -f if you really want to add them.
$ git add -f empty/
fatal: unable to index file empty/
First, it misleads the user by assuming that something was added to
.gitignore or another exclude file, and the second error message is not
very helpful.
Looking at the code, I am not sure how this can be fixed. Simply
printing a warning when finding "some" empty directory might do, but it
is not the best way to help somebody new to git. Refusing to add
anything when finding an empty directory deep in some hierarchy is not a
good option either.
Git 1.4 silently did nothing, so 1.5 at least tries to be more clueful.
Anyway, I thought I would mention it and see what happens. ;)
--
Jonas Fonseca
next reply other threads:[~2007-06-10 20:47 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-10 20:46 Jonas Fonseca [this message]
2007-06-11 12:30 ` Adding empty directory gives bogus error message Jeff King
2007-06-11 13:39 ` [PATCH 1/3] refactor dir_add_name Jeff King
2007-06-11 14:13 ` Johannes Schindelin
2007-06-11 16:23 ` Junio C Hamano
2007-06-11 19:46 ` Jeff King
2007-06-12 7:13 ` Junio C Hamano
2007-06-12 12:19 ` Jeff King
2007-06-12 21:51 ` Jonas Fonseca
2007-06-11 13:39 ` [PATCH 2/3] dir_struct: add collect_ignored option Jeff King
2007-06-11 13:39 ` [PATCH 3/3] builtin-add: simplify (and increase accuracy of) exclude handling Jeff King
2007-06-11 15:01 ` Jonas Fonseca
2007-06-11 15:54 ` Jeff King
2007-06-11 19:15 ` Jonas Fonseca
2007-06-11 19:48 ` Jeff King
2007-06-12 21:42 ` Jonas Fonseca
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070610204648.GA32214@diku.dk \
--to=fonseca@diku.dk \
--cc=git@vger.kernel.org \
/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.
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 NNTP newsgroup(s).