git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Adding empty directory gives bogus error message
@ 2007-06-10 20:46 Jonas Fonseca
  2007-06-11 12:30 ` Jeff King
  0 siblings, 1 reply; 16+ messages in thread
From: Jonas Fonseca @ 2007-06-10 20:46 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2007-06-12 21:51 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-10 20:46 Adding empty directory gives bogus error message Jonas Fonseca
2007-06-11 12:30 ` 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

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).