Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:49:18

Greg Brockman [off-list ref] writes:
quoted
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help