git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Riesen <raa.lkml@gmail.com>
To: Andreas Gruenbacher <agruen@suse.de>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [BUG] Git add <device file> silently fails
Date: Sat, 17 Apr 2010 16:44:05 +0200	[thread overview]
Message-ID: <u2s81b0412b1004170744u4cc3c0e1z6d7019fe405a67ec@mail.gmail.com> (raw)
In-Reply-To: <201004171624.17797.agruen@suse.de>

On Sat, Apr 17, 2010 at 16:24, Andreas Gruenbacher <agruen@suse.de> wrote:
> However, when trying to add a device special file, update_callback() ends up
> never getting called, no error message is produced, and git add silently
> fails:
>
>        $ sudo mknod foobar c 1 3
>        $ git add foobar
>   $ echo $?
>        0

I think something like this should make the accident more
noticable:

diff --git a/builtin/add.c b/builtin/add.c
index 87d2980..9c4a5f2 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -347,6 +347,8 @@ static int add_files(struct dir_struct *dir, int flags)
 		die("no files added");
 	}

+	if (!dir->nr)
+		die("No files selected for addition");
 	for (i = 0; i < dir->nr; i++)
 		if (add_file_to_cache(dir->entries[i]->name, flags)) {
 			if (!ignore_add_errors)

  reply	other threads:[~2010-04-17 14:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-17 14:24 [BUG] Git add <device file> silently fails Andreas Gruenbacher
2010-04-17 14:44 ` Alex Riesen [this message]
2010-04-17 15:00   ` Andreas Gruenbacher
2010-04-17 15:27     ` Alex Riesen
2010-04-17 16:38   ` Junio C Hamano
2010-04-17 17:32     ` Alex Riesen
2010-04-17 18:23       ` Alex Riesen
2010-04-17 17:57     ` Andreas Gruenbacher
2010-04-19  5:15       ` Junio C Hamano

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=u2s81b0412b1004170744u4cc3c0e1z6d7019fe405a67ec@mail.gmail.com \
    --to=raa.lkml@gmail.com \
    --cc=agruen@suse.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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.
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).