git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Git Mailing List <git@vger.kernel.org>,
	Junio C Hamano <gitster@pobox.com>
Subject: Small "git clean" annoyance
Date: Thu, 31 Mar 2011 15:01:33 -0700	[thread overview]
Message-ID: <AANLkTinQscpkRDftLmCrQR+Aq5RacGyurd3kb15y=1FK@mail.gmail.com> (raw)

I don't have a patch for this, and I guess it doesn't much matter, but
I just found this annoying:

  [torvalds@i5 git]$ mkdir -m 0 tmp
  [torvalds@i5 git]$ git clean -dqfx
  warning: failed to remove tmp/
  [torvalds@i5 git]$ rmdir tmp

and the reason is simply that git gives up if the directory is
unreadable and thus cannot be opened.

Which is kind of understandable, but at the same time, if it's empty,
a "rmdir()" will just work. So git gave up a bit too soon.

(In case anybody wonders, the reason I had empty unreadable
directories around is not because I commonly do "mkdir -m 0", but
simply because they got created when I was running a system call
fuzzer for testing).

Now, I realize that if the directory isn't empty, and is unreadable,
we really should give up (although a better error message about _why_
we failed may be in order) rather than try to chmod it or anything
like that. But the simple "try to rmdir it" might be a good addition
for the trivial case.

                     Linus

             reply	other threads:[~2011-03-31 22:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-31 22:01 Linus Torvalds [this message]
2011-04-01  7:34 ` Small "git clean" annoyance Alex Riesen
2011-04-01  7:41   ` Matthieu Moy
2011-04-01  8:29   ` Erik Faye-Lund
2011-04-01  9:20     ` Alex Riesen
2011-04-01 14:48   ` Linus Torvalds

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='AANLkTinQscpkRDftLmCrQR+Aq5RacGyurd3kb15y=1FK@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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).