Re: [RFH] "git clean" deletes excluded files in untracked directories

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

 



Jeff King <peff@xxxxxxxx> writes:

> If you have an untracked directory that contains excluded files, like
> this:
>
>   mkdir foo
>   echo content >foo/one
>   echo content >foo/two
>   echo "foo/one" >.gitignore
>
> then "git clean -d" will notice that "foo" is untracked and recursively
> delete it and its contents, including the ignored "foo/one".

Hmph, starting from an empty repository and doing the above four
commands, and "git clean" without "-d" does not bother removing
either foo/one or foo/two.  Is this correct?

It gets worse.  Following the above four commands and then these two:

    >foo/three
    git add foo/two

and "git clean" (with or without "-d") suddenly notices that
"foo/three" is expendable, but not foo/one nor foo/two, which sounds
about right.

Honestly, as I do not use "git clean" myself, I do not know what the
"right" behaviour is for that command.  Anything it does seems just
arbitrary and wrong to me ;-)

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