Re: [PATCH] Add clean.requireForce option, and add -f option to git-clean to override it

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]