Re: git add -p with new file

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

 



On Fri, Dec 09, 2016 at 01:43:24PM -0500, Ariel wrote:

> > It's contrary to the rest of git-add for specifying pathspecs to
> > actually make things _more_ inclusive rather than less.
> 
> Is it? Because git add without -p is happy to add new files.

I was just speaking there of whether the presence of the file on the
command-line was relevant. In other words, "git add -u untracked-file"
does not countermand the "-u" to say "also add this file".

> > Historically "add -p" has been more like "add -u" in updating tracked
> > files.
> 
> But it doesn't have to be that way. You could make add -p identical to add
> without options, except the -p prompts to review diffs first.

The question is whether you would annoy people using "-p" if you started
including untracked files by default. I agree because it's inherently an
interactive process that we can be looser with backwards compatibility.

Perhaps a config option would be the best path forward (even if we were
to switch the default to "true", it leaves an escape hatch for people
who do not like the new behavior).

> > We have "-A" for "update everything _and_ new files". It doesn't
> > seem unreasonable to me to have a variant of "-p" that is similar.
> 
> That seems unnecessarily complex because -p asks about each file, so you
> will never find new files added without realizing it.

If you care about adding new files, wouldn't you just always use "-P"
instead of "-p"?

-Peff



[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]