Re: [RFC/PATCH] git-add: Don't exclude explicitly-specified tracked files

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

 



Greg Brockman <gdb@xxxxxxx> writes:

>> What should happen if the user did these instead, after adding "dir" as an
>> ignored entry, and adding dir/file but not dir/untracked to the index?
>>
>>  (1)    git add dir/file dir/untracked    ; explicitly named
>>  (2)    git add dir/*                     ; have shell glob--same as (1)
>>  (3)    git add "dir/*"                   ; have git glob
>>  (4)    git add dir                       ; have git recurse
>
> In all four cases, the output I get is:
> """
> The following paths are ignored by one of your .gitignore files:
> dir
> Use -f if you really want to add them.
> fatal: no files added
> """
>
> Note that this is also the output if you run
>
> (5) rm dir/untracked && git add "dir/*"

Here is the one that troubles me the most:

 (6) git add dir/f*

This _looks_ like very explicitly named from git's point of view, but from
the end user's point of view it is not.  Depending on presense (or absense)
of another file whose name begins with 'f' in the directory, the add will
be either prevented or silently accepted.

I am not sure what the best solution would be; I tend to think the current
behaviour is slightly saner in the face of shell globbing.
--
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]