git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/1] clean: further clean-up of implementation around "--force"

From
Sergey Organov <sorganov@gmail.com>
Date
Mar 4, 2024, 18:46 UTC
Message-ID
<87cys996nf.fsf@osv.gnss.ru>
In-Reply-To
<20240303220600.2491792-2-gitster@pobox.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 23 quoted lines
> We clarified how clean.requireForce interacts with the --dry-run
> option in the previous commit, both in the implementation and in the
> documentation.  Even when "git clean" (without other options) is
> required to be used with "--force" (i.e. either clean.requireForce
> is unset, or explicitly set to true) to protect end-users from
> casual invocation of the command by mistake, "--dry-run" does not
> require "--force" to be used, because it is already its own
> protection mechanism by being a no-op to the working tree files.
>
> The previous commit, however, missed another clean-up opportunity
> around the same area.  Just like in the "--dry-run" mode, the
> command in the "--interactive" mode does not require "--force",
> either.  This is because by going interactive and giving the end
> user one more step to confirm, the mode itself is serving as its own
> protection mechanism.
>
> Let's take things one step further, unify the code that defines
> interaction between `--force` and these two other options.  Just
> like we added explanation for the reason why "--dry-run" does not
> honor `clean.requireForce`, add the same explanation for
> "--interactive".  Finally, add some tests to show the interaction
> between "--force" and "--interactive" (we already have tests that
> show interaction between "--force" and "--dry-run").
Looks fine to me, including the patch itself.

Thanks, -- Sergey Organov

Previous: Junio C HamanoNext: Sergey Organov
Message 4 of 9 in “Re: [PATCH v2] clean: improve -n and -f implementation and documentation”
  1. Junio C HamanoMar 3, 2024
  2. 1/1 clean: further clean-up of implementation around "--force"Junio C Hamano, Mar 3, 2024
  3. Junio C HamanoMar 3, 2024
  4. Sergey OrganovMar 4, 2024
  5. Sergey OrganovMar 4, 2024
  6. Junio C HamanoMar 4, 2024
  7. Sergey OrganovMar 4, 2024
  8. Junio C HamanoMar 4, 2024
  9. Sergey OrganovMar 4, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.