Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: Fix a bug in _git's clone completion
- X-seq: zsh-workers 25539
- From: "Mikael Magnusson" <mikachu@xxxxxxxxx>
- To: "zsh workers" <zsh-workers@xxxxxxxxxx>
- Subject: Re: PATCH: Fix a bug in _git's clone completion
- Date: Thu, 28 Aug 2008 20:04:14 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=vhT8dPmV7Od3wSWWup6gDksMgoqGRdz7vncOvbcg4Vw=; b=XwaxW7XvXpxdJbComUHEOOgO7uQB6uqwASyXS/sw7kuwwGMGdNpKRoDxhSbKzLNn32 lC9+YpQsYf1kWyRIbBCSiSJrzNZnrafkugTV704CA3qN1cz59bZ/OaEiPHBeMGyMbIU0 +/vYhvN5evfu4INwKEjaFdt6B0EgxdasCq04g=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=Yyi9opFsQcZkpdX/qioqa5H5Mb5PoijJ7yQITQPzZ5+8T9J4MTb9Ne3lhSNMPMjIo4 l/TyTIHIMFKQ7K9b/7CUA6EeZBu9e+UqLP39HqkkOs0ViM3uKIjyaWTYwbZ+ZJ+OfB/Y ZydaKvUIZYciJV1e1zESj0Fv0c8DBbxq10c4o=
- In-reply-to: <20080828160152.GE6330@xxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20080828160152.GE6330@xxxxxxxxxxxxxxx>
2008/8/28 Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>:
> There was a backslash missing at a line end, which screwed up things.
>
> Also, I don't understand the completion after 'git clone --bare <tab>'.
> It does not give me *any* completions, while I would expect the same
> completions as without the --bare option.
>
> If I do 'git clone --bare -<tab>', I only get a small subset of the
> remaining options. I don't know what is happening here.
No idea here...
> Finally, I do not understand why the end of the _arguments call was
> done like this:
>
> [snip]
> ':repository:__git_any_repositories' \-
> '*:directory:_directories' && ret=0-
> [snap]
>
> ...and not just: '*:repository:__git_any_repositories' && ret 0
>
> If someone can explain, please do ahead. :)
This is because
SYNOPSIS
git clone ... <repository> [<directory>]
Ie, you can give an optional argument where to clone to. The * is bogus
though.
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index d6cda20..4a50b39 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -1611,14 +1611,14 @@ _git-clean () {
'*:file:_files' && ret=0
}
-# TODO: The --no-checkout is undocumented.
(( $+functions[_git-clone] )) ||
_git-clone () {
- _arguments \
+ _arguments -S \
'--bare[make a bare GIT repository]' \
+ '--mirror[clone refs into refs/* instead of refs/remotes/origin/*]' \
'(-l --local)'{-l,--local}'[perform a local cloning of a repository]' \
- '(-s --shared)'{-s,--shared}'[share the objects with the source
repository (warning: see man page)]' \
+ '(-s --shared)'{-s,--shared}'[share the objects with the source
repository (warning: see man page)]' \
'--reference[reference repository]:repository:_directories' \
'(-q --quiet)'{-q,--quiet}'[operate quietly]' \
'(-n --no-checkout)'{-n,--no-checkout}'[do not checkout HEAD
after clone is complete]' \
@@ -1628,7 +1628,7 @@ _git-clone () {
$template_arg \
'--depth[create a shallow clone, given number of revisions deep]:
:_guard "[[\:digit\:]]##" depth' \
':repository:__git_any_repositories' \
- '*:directory:_directories' && ret=0
+ ':directory:_directories' && ret=0
}
(( $+functions[_git-commit] )) ||
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author