Re: git rm --pathspec-from-file does not work in subdirectories

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

 



Dietrich Epp <depp@xxxxxxxx> writes:

> How to reproduce: cd into a subdirectory and use git rm
> --pathspec-from-file. For example, in Git's repo, at the top level:
>
> $ git rm --pathspec-from-file=/dev/null
> fatal: No pathspec was given. Which files should I remove?
> $ cd compat
> $ git rm --pathspec-from-file=/dev/null
> fatal: --pathspec-from-file is incompatible with pathspec arguments

Thanks for a report.

I think this reveals issues with not just the --pathspec-from-file
which has been added relatively recently, but potentially a larger
issue "git rm" from subdirectory has.

When run from a subdirectory, "git rm" without pathspec behaves
as if a single "." (i.e. everything underneath the current
directory) is given as the pathspec.  Of course, this is incompatible
with reading of the pathspec elements from a file and unfortunately
it cannot be disabled, so there currently is no way to use the option
if you are in a subdirectory.

But a potentially larger problem is that "git rm -r" will remove
everything under the current directory unless you are at the top
level of the working tree, even when the user does not give "." to
explicitly say "I want everything under the current directory gone".

I wonder if the attached patch would make both issues better.




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

  Powered by Linux