git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: [RFH] "git clean" deletes excluded files in untracked directories
Date: Tue, 22 Jul 2014 14:39:27 -0700	[thread overview]
Message-ID: <xmqq8unlf4z4.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20140702191114.GA3474@sigill.intra.peff.net> (Jeff King's message of "Wed, 2 Jul 2014 15:11:14 -0400")

Jeff King <peff@peff.net> 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 ;-)

  reply	other threads:[~2014-07-22 21:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-02 18:44 [PATCH] t7300: repair filesystem permissions with test_when_finished Jeff King
2014-07-02 19:01 ` Jonathan Nieder
2014-07-02 19:03   ` Jeff King
2014-07-02 20:05     ` Junio C Hamano
2014-07-02 20:06       ` Junio C Hamano
2014-07-02 19:11 ` [RFH] "git clean" deletes excluded files in untracked directories Jeff King
2014-07-22 21:39   ` Junio C Hamano [this message]
2014-07-22 22:53     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq8unlf4z4.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).