git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Sergey Organov <sorganov@gmail.com>
Cc: git@vger.kernel.org, "Jean-Noël AVILA" <avila.jn@gmail.com>,
	"Kristoffer Haugsbakk" <code@khaugsbakk.name>
Subject: Re: [PATCH v2] clean: improve -n and -f implementation and documentation
Date: Mon, 04 Mar 2024 11:03:13 -0800	[thread overview]
Message-ID: <xmqqo7btom4u.fsf@gitster.g> (raw)
In-Reply-To: <87h6hl96z7.fsf@osv.gnss.ru> (Sergey Organov's message of "Mon, 04 Mar 2024 21:39:40 +0300")

Sergey Organov <sorganov@gmail.com> writes:

>> The reason for the behaviour can be explained this way:
>>
>>  * "git clean" (with neither -i nor -n.  The user wants the default
>>    mode that has no built-in protection will be stopped without -f.
>>
>>  * "git clean -n".  The user wants the dry-run mode that has its own
>>    protection, i.e. being always no-op to the files, so there is no
>>    need to fail here for the lack of "-f".
>>
>>  * "git clean --interactive".  The user wants the interactive mode
>>    that has its own protection, i.e. giving the end-user a chance to
>>    say "oh, I didn't mean to remove these files, 'q'uit from this
>>    mistake", so there is no need to fail here for the lack of "-f".
>
> Well, if we remove -i from error message as well, then yes, this makes
> sense.
> ...
> I then suggest to consider to remove mention of -i from
> clean.requireForce description as well.

The follow-up patch you just reviewed in the other thread does
exactly that.

This is a tangent, but before finalizing the version that complains
"clean.requireForce is in effect and you did not give me -f" without
mentioning "-i" or "-n", I asked gemini.google.com to proofread the
patch and and one of its suggestion was to use this:

    "clean.requireForce is true.  Use -f to override, or consider
    using -n (dry-run) or -i (interactive) for a safer workflow."

as a possibly cleaner message.  It is the opposite of what both of
us concluded to be good in this exchange, but in some sense, it does
sound more helpful to end users, which I somehow found amusing.




  parent reply	other threads:[~2024-03-04 19:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <7le6ziqzb.fsf_-_@osv.gnss.ru>
2024-03-03 22:05 ` [PATCH v2] clean: improve -n and -f implementation and documentation Junio C Hamano
2024-03-03 22:06   ` [PATCH 1/1] clean: further clean-up of implementation around "--force" Junio C Hamano
2024-03-03 22:18     ` Junio C Hamano
2024-03-04 18:46     ` Sergey Organov
2024-03-04 18:39   ` [PATCH v2] clean: improve -n and -f implementation and documentation Sergey Organov
2024-03-04 18:41     ` Junio C Hamano
2024-03-04 18:48       ` Sergey Organov
2024-03-04 19:03     ` Junio C Hamano [this message]
2024-03-04 20:19       ` Sergey Organov
2024-01-09 20:20 what should "git clean -n -f [-d] [-x] <pattern>" do? Junio C Hamano
2024-02-29 19:07 ` [PATCH] clean: improve -n and -f implementation and documentation Sergey Organov
2024-03-03  9:50   ` [PATCH v2] " Sergey Organov

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=xmqqo7btom4u.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=avila.jn@gmail.com \
    --cc=code@khaugsbakk.name \
    --cc=git@vger.kernel.org \
    --cc=sorganov@gmail.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).