git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josh Triplett <josh@freedesktop.org>
To: Michael Spang <mspang@uwaterloo.ca>
Cc: git@vger.kernel.org, Junio C Hamano <junkio@cox.net>
Subject: Re: [PATCH] Add clean.requireForce option, and add -f option to git-clean to override it
Date: Mon, 23 Apr 2007 19:03:53 -0700	[thread overview]
Message-ID: <462D6589.7060206@freedesktop.org> (raw)
In-Reply-To: <462D5C4D.3050004@uwaterloo.ca>

[-- Attachment #1: Type: text/plain, Size: 963 bytes --]

Michael Spang wrote:
> Josh Triplett wrote:
>> +if [ "$disabled" = true ]; then
>> +	echo "clean.requireForce set and -n or -f not given; refusing to clean"
>> +	exit 1
>> +fi
> 
> How is it useful to abort completely? Wouldn't it be better to behave
> like -n unless -f is given?

I don't think so, for a couple of reasons.

* I want to make it really obvious that git-clean did nothing.  Spewing piles
  of output quickly obscures the error message, and doesn't convey "git-clean
  did nothing" at a glance.

* -n takes time, especially with a large working copy.  Doing nothing takes
  very little time.  The original use case motivating this patch came from the
  idea of a git $HOME, and wanting to make sure git-clean won't delete
  everything untracked in $HOME.  git-clean -n would take a long time here,
  and I don't want to do it implicitly, particularly if I meant to clean a git
  repository *under* $HOME.

- Josh Triplett


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

  reply	other threads:[~2007-04-24  2:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-24  0:18 [PATCH] Add clean.requireForce option, and add -f option to git-clean to override it Josh Triplett
2007-04-24  1:24 ` Michael Spang
2007-04-24  2:03   ` Josh Triplett [this message]
2007-04-24  2:05     ` Josh Triplett

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=462D6589.7060206@freedesktop.org \
    --to=josh@freedesktop.org \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=mspang@uwaterloo.ca \
    /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).