Re: [PATCH] Fix off by one error in prep_exclude.

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

 



Junio C Hamano schrieb:
> Johannes Sixt <j.sixt@xxxxxxxxxxxxx> writes:
> 
>> The "problem" is not only with git-clean, but also in others, like
>> git-ls-files. Try this in you favorite repository:
>>
>>    $ git ls-files -o /*bin
>>
>> The output does not make a lot of sense. (Here it lists the contents of
>> /bin and /sbin.) Not that it hurts with ls-files, but
>>
>>    $ git clean -f /
>>
>> is basically a synonym for
>>
>>    $ rm -rf /
> 
> Yeah, /*bin is not inside the repository so it should not even
> be reported as "others".  Shouldn't the commands detect this and
> reject feeding such paths outside the work tree to the core,
> which always expect you to talk about paths inside?

That's what I had expected. But look:

   $ git ls-files -o /
   [... tons of file names ...]

   $ git ls-files -o ..
   fatal: '..' is outside repository

   $ git clean -n /    # with Shawn's patch
   Would remove /bin/
   [... etc ...]

   $ git clean -n ..
   fatal: '..' is outside repository

Some mechanism for this is already there; it's just not complete enough.

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

  Powered by Linux