Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: 5.8: add information to git-clean completion



"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




Messages sorted by: Reverse Date, Date, Thread, Author