Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Linus Torvalds <torvalds@osdl.org>
Cc: git@vger.kernel.org
Subject: Re: Do "git add" as a builtin
Date: Thu, 18 May 2006 01:13:46 -0700	[thread overview]
Message-ID: <7v64k3698l.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <Pine.LNX.4.64.0605171321020.10823@g5.osdl.org> (Linus Torvalds's message of "Wed, 17 May 2006 13:23:19 -0700 (PDT)")

Linus Torvalds <torvalds@osdl.org> writes:

> On Wed, 17 May 2006, Junio C Hamano wrote:
>> 
>> By "not seeing the point", do you mean you do not agree with
>> what bba319b5 and 45e48120 tried to do to help users?
>
> Naah, I just didn't see why, and didn't bother to go exploring.
>
> How about this patch on top of the previous one?

Well, not good as-is.  This makes it barf on this sequence:

	$ rm -f junk
        $ cd junk
        $ git init-db
        $ date >frotz
        $ mkdir nitfol
        $ date >nitfol/rezrov
	$ git add .		;# OK up to this point - added everything.

	$ git add .		;# This is bogus because...
        fatal: pathspec '' did not match any files
	$ git add nitfol	;# ...this does not barf.

I admit I did not spot it when I read the code, but this part
gets an empty string for 'match' when pathspec is '.'.

> +		/* Existing file? We must have ignored it */
> +		match = pathspec[i];
> +		if (!lstat(match, &st))
> +			continue;
> +		die("pathspec '%s' did not match any files", match);

That's why '.' barfs but nitfol doesn't.

  reply	other threads:[~2006-05-18  8:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-17 16:33 Do "git add" as a builtin Linus Torvalds
2006-05-17 19:06 ` Junio C Hamano
2006-05-17 20:23   ` Linus Torvalds
2006-05-18  8:13     ` Junio C Hamano [this message]
2006-05-18  8:34       ` Junio C Hamano
2006-05-18  8:52         ` [WARNING] Please be careful when using "git add" from "next" branch Junio C Hamano
2006-05-19  6:28           ` FIXED: " Junio C Hamano
2006-05-18 15:26         ` Do "git add" as a builtin Linus Torvalds
2006-05-18 16:25           ` Linus Torvalds
2006-05-18 16:35             ` Linus Torvalds
2006-05-18 16:50               ` Junio C Hamano
2006-05-18 17:22                 ` Linus Torvalds
2006-05-18 15:06       ` Linus Torvalds

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=7v64k3698l.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=torvalds@osdl.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