From: Junio C Hamano <gitster@pobox•com>
To: Phil Hord <phil.hord@gmail•com>
Cc: Jens Lehmann <Jens.Lehmann@web•de>,
Git Mailing List <git@vger•kernel.org>,
Heiko Voigt <hvoigt@hvoigt•net>,
Michael J Gruber <git@drmicha•warpmail.net>,
Marc Branchaud <marcnarc@xiplink•com>,
"W. Trevor King" <wking@tremily•us>
Subject: Re: [PATCH] submodule deinit: clarify work tree removal message
Date: Tue, 16 Apr 2013 22:16:11 -0700 [thread overview]
Message-ID: <7vppxthh44.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <CABURp0rkeYc7K0COhc1+96Q2Ox2TaNRpMSmQYOiwBpgPJbsafA@mail.gmail.com> (Phil Hord's message of "Tue, 16 Apr 2013 09:32:21 -0400")
Phil Hord <phil.hord@gmail•com> writes:
> On Mon, Apr 1, 2013 at 3:02 PM, Jens Lehmann <Jens.Lehmann@web•de> wrote:
>> Okay, so here is the patch for that. If someone could point out
>> a portable and efficient way to check if a directory is already
>> empty I would be happy to use that to silence the "Cleaned
>> directory" message currently printed also when deinit is run on
>> an already empty directory.
>
> isemptydir() {
> test -d "$(find $1 -maxdepth 0 -empty)"
> }
Hrm, -maxdepth and -empty are not even in POSIX. Folks on GNU
platforms and BSDs (I checked NetBSD 6 and OpenBSD 5.2) should be
fine, but it makes other platforms unhappy.
What is this check used for? To avoid running "rmdir" on non-empty
ones? Saying "cleaning foo/" (or "cleaned foo/") when foo/ is
already empty is not a crime; not omitting an empty one may actually
be a better behaviour from the point of view of repeatability and
uniformity.
next prev parent reply other threads:[~2013-04-17 5:16 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-06 21:11 [PATCH v4] submodule: add 'deinit' command Jens Lehmann
2013-02-12 17:11 ` Phil Hord
2013-02-12 18:03 ` Junio C Hamano
2013-02-13 19:33 ` Jens Lehmann
2013-02-13 19:56 ` Junio C Hamano
2013-02-17 20:06 ` [PATCH v5] " Jens Lehmann
2013-02-17 22:32 ` Junio C Hamano
2013-02-18 19:20 ` Jens Lehmann
2013-03-04 21:20 ` [PATCH v6] " Jens Lehmann
2013-03-05 7:29 ` Heiko Voigt
2013-03-05 15:45 ` Junio C Hamano
2013-03-06 6:52 ` Heiko Voigt
2013-03-12 15:39 ` [PATCH v4] " Phil Hord
2013-03-12 16:22 ` Junio C Hamano
2013-03-18 20:54 ` Jens Lehmann
2013-03-19 1:45 ` Junio C Hamano
2013-04-01 19:02 ` [PATCH] submodule deinit: clarify work tree removal message Jens Lehmann
2013-04-16 13:32 ` Phil Hord
2013-04-16 20:47 ` [PATCH] submodule deinit: don't output "Cleared directory" when directory is empty Jens Lehmann
2013-04-17 5:16 ` Junio C Hamano [this message]
2013-04-17 20:30 ` [PATCH] submodule deinit: clarify work tree removal message Jens Lehmann
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=7vppxthh44.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox$(echo .)com \
--cc=Jens.Lehmann@web$(echo .)de \
--cc=git@drmicha$(echo .)warpmail.net \
--cc=git@vger$(echo .)kernel.org \
--cc=hvoigt@hvoigt$(echo .)net \
--cc=marcnarc@xiplink$(echo .)com \
--cc=phil.hord@gmail$(echo .)com \
--cc=wking@tremily$(echo .)us \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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