zsh-workers
 help / color / mirror / Atom feed
* PATCH: 5.8: add information to git-clean completion
@ 2020-08-27  9:45 Heinrich, Jens
  2020-08-27 16:51 ` Oliver Kiddle
  0 siblings, 1 reply; 3+ messages in thread
From: Heinrich, Jens @ 2020-08-27  9:45 UTC (permalink / raw)
  To: zsh-workers

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

Hi,

Is this ok?
If not: What should I change?

Greets
Jens

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-add-doubled-force-to-git-clean-completion.patch --]
[-- Type: text/x-patch; name="0001-add-doubled-force-to-git-clean-completion.patch", Size: 1088 bytes --]

From 1527729abf42b97c64b55a31b6e0538842f92b5f Mon Sep 17 00:00:00 2001
From: Jens Heinrich <J.Heinrich@ub.uni-frankfurt.de>
Date: Thu, 27 Aug 2020 11:26:11 +0200
Subject: [PATCH] add doubled --force to git-clean completion

this is needed to remove nested repositories
---
 Completion/Unix/Command/_git | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 05e2a2361..d54d4ddd6 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -549,6 +549,7 @@ _git-clean () {
   _arguments -C -S -s $endopt \
     '-d[also remove untracked directories]' \
     '(-f --force)'{-f,--force}'[required when clean.requireForce is true (default)]' \
+    '(-f --force)'{-f,--force}'[required twice to remove nested git repositories]' \
     '(-i --interactive)'{-i,--interactive}'[show what would be done and clean files interactively]' \
     '(-n --dry-run)'{-n,--dry-run}'[only show what would and what would not be removed]' \
     '(-q --quiet)'{-q,--quiet}"[don't print names of files removed]" \
-- 
2.25.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PATCH: 5.8: add information to git-clean completion
  2020-08-27  9:45 PATCH: 5.8: add information to git-clean completion Heinrich, Jens
@ 2020-08-27 16:51 ` Oliver Kiddle
  2020-08-28  2:32   ` Daniel Shahaf
  0 siblings, 1 reply; 3+ messages in thread
From: Oliver Kiddle @ 2020-08-27 16:51 UTC (permalink / raw)
  To: Heinrich, Jens; +Cc: zsh-workers

"Heinrich, Jens" wrote:
> Is this ok?
> If not: What should I change?

> this is needed to remove nested repositories
> +++ b/Completion/Unix/Command/_git
>      '(-f --force)'{-f,--force}'[required when clean.requireForce is true (default)]' \
> +    '(-f --force)'{-f,--force}'[required twice to remove nested git repositories]' \

As a minimum, the exclusion list can't remain. This is the '(-f --force)' 
part at the beginning which says that those two options are mutually
exclusive. If the option can be repeated we need to put \* in instead to
allow that.

Going further, it depends how much effort you want to go to. It could
check whether -f has already been specified on the command-line and
adjust the description accordingly. And perhaps it could even check the
state of clean.requireForce.

I don't think the new description is ideal because it loses the
indication of what a single use of the option does. If you don't want
to add clever logic to alter the description, then we need to squash
both descriptions together as tersely as possible. When shortening
descriptions also keep in mind that truncation removes what comes at the
end so you want important words first. Perhaps something like:

  \*{-f,--force}'[required unless clean.requireForce is false; repeat to clean nested repositories]'

That's still longer than is ideal.

What exactly does the repeated use of -f do? Is it removing nested
repositories or doing a clean in them. From my cursory testing, nested
repositories seem to be ignored no-matter what arguments I give. Is it
perhaps only submodules that it does anything with. If so, "submodules"
is shorter than "nested repositories".

Thanks

Oliver


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PATCH: 5.8: add information to git-clean completion
  2020-08-27 16:51 ` Oliver Kiddle
@ 2020-08-28  2:32   ` Daniel Shahaf
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Shahaf @ 2020-08-28  2:32 UTC (permalink / raw)
  To: Oliver Kiddle; +Cc: Heinrich, Jens, zsh-workers

Oliver Kiddle wrote on Thu, 27 Aug 2020 18:51 +0200:
> What exactly does the repeated use of -f do? Is it removing nested
> repositories or doing a clean in them. From my cursory testing, nested
> repositories seem to be ignored no-matter what arguments I give.

According to the current release of Documentation/git-clean.txt:

[[[
-f::
--force::
	If the Git configuration variable clean.requireForce is not set
	to false, 'git clean' will refuse to delete files or directories
	unless given -f or -i.  Git will refuse to modify untracked
	nested git repositories (directories with a .git subdirectory)
	unless a second -f is given.
]]]

So, for the description, how about:

    required by default; twice, removes untracked nested repositories

> Is it
> perhaps only submodules that it does anything with. If so, "submodules"
> is shorter than "nested repositories".


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-28  2:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-27  9:45 PATCH: 5.8: add information to git-clean completion Heinrich, Jens
2020-08-27 16:51 ` Oliver Kiddle
2020-08-28  2:32   ` Daniel Shahaf

zsh-workers

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/zsh-workers

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 zsh-workers zsh-workers/ http://inbox.vuxu.org/zsh-workers \
		zsh-workers@zsh.org
	public-inbox-index zsh-workers

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.workers


code repositories for the project(s) associated with this inbox:

	https://git.vuxu.org/mirror/zsh/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git