* BUG - git clean
@ 2013-10-11 18:53 jones.noamle
2013-10-12 10:36 ` Di Xu
0 siblings, 1 reply; 2+ messages in thread
From: jones.noamle @ 2013-10-11 18:53 UTC (permalink / raw)
To: git
Passing to git clean wrong (non-existent) paths together with valid
ones, causes it to delete stuff that it shouldn't.
Am I right?
Script to reproduce:
mkdir test
cd test
git init .
mkdir ba
mkdir ba/ca
# So far so good.
# Should clean directory "ba/ca"
git clean -dn -- ba/ca
# Should clean "ba/ca" and ignore non-existent "j"
# Instead, it wants to delete "ba" totally.
git clean -dn -- ba/ca j
git --version
---------------------------------------------------------------------
Output:
+ mkdir test
+ cd test
+ git init .
Initialized empty Git repository in /home/notroot/test/.git/
+ mkdir ba
+ mkdir ba/ca
+ git clean -dn -- ba/ca
Would remove ba/ca/
+ git clean -dn -- ba/ca j
Would remove ba/
+ git --version
git version 1.7.9.5
---------------------------------------------------------------------
Thanks!
Noam
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: BUG - git clean
2013-10-11 18:53 BUG - git clean jones.noamle
@ 2013-10-12 10:36 ` Di Xu
0 siblings, 0 replies; 2+ messages in thread
From: Di Xu @ 2013-10-12 10:36 UTC (permalink / raw)
To: git
> mkdir test
> cd test
> git init .
> mkdir ba
> mkdir ba/ca
>
> # So far so good.
> # Should clean directory "ba/ca"
> git clean -dn -- ba/ca
>
> # Should clean "ba/ca" and ignore non-existent "j"
> # Instead, it wants to delete "ba" totally.
> git clean -dn -- ba/ca j
actually, my git will also do it wrong when 'j' exist, do
these after your script:
$ git clean -dn ba/ca j
Would remove ba/
$ mkdir j
$ git clean -dn ba/ca j
Would remove ba/ #here missing 'ca'
Would remove j/
I think it's the problem of directory path manipulation.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-10-12 10:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-11 18:53 BUG - git clean jones.noamle
2013-10-12 10:36 ` Di Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).