Re: git add -u nonexistent-file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2010/2/8 SZEDER Gábor <szeder@xxxxxxxxxx>:
> Hi,
>
>
> $ git --version
> git version 1.7.0.rc1.84.g9879
> $ git add -u nonexistent-file
> $ echo $?
> 0
>
> No error message, no error in exit status.
>
> Is it OK this way?  Why?
>
>
> Best,
> Gábor
>

Hi,

I see the same behaviour with git version 1.6.4.2.

>From the man page of git-add

-u, --update
           Update only files that git already knows about, staging
modified content for
           commit and marking deleted files for removal.

So git will only look at files that are already in the repository.

It looks like in the case you've highlighted git is ignoring the extra
non-option parameters on the command line. I'll let other people argue
whether this is by design or omission.

'git add nonexistent-file' works as expected, exiting with an error
message and non-zero exit status.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]