git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "David Spångberg" <david@tunna.org>
To: git@vger.kernel.org
Subject: Weird behavior/bug for git clean in untracked directory
Date: Wed, 04 Oct 2017 21:06:18 +0200	[thread overview]
Message-ID: <8760bu7mxh.fsf@tunna.org> (raw)

Hello

I'm a little bit confused about the behavior of git clean when trying to
clean multiple files/directories at once. For instance if I create two
directories with an empty file in an new git repository as such:

  mkdir tmprepo
  cd tmprepo
  git init
  mkdir a b
  touch a/file b/file

and try to clean both these files at the same time with git clean as
such:

  git clean -f a/file b/file

then git will not clean any of the files. However, if I separate the
cleaning into two separate calls like this:

  git clean -f a/file
  git clean -f b/file

then both directories will be cleaned. The git clean manual page suggests
git clean should support multiple paths/directories:

  SYNOPSIS
         git clean [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] <path>...

  DESCRIPTION
         ...
         If any optional <path>... _arguments_ are given, only those _paths_ are affected.

The expected behavior for me would be that there should be no difference
between the first `git clean...' with two files and the two
`git clean...' with one file each.

I've tested on the following git versions so far:

  * 2.1.4
  * 2.14.2
  * 2.14.2.959.g6663358d3 (currently latest on next branch)


Best regards,
David

                 reply	other threads:[~2017-10-04 19:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=8760bu7mxh.fsf@tunna.org \
    --to=david@tunna.org \
    --cc=git@vger.kernel.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).