From: Junio C Hamano <gitster@pobox.com>
To: Sveinung Kvilhaugsvik <sveinung84@users.sourceforge.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] git-completion: add stashes for gitk
Date: Thu, 12 Mar 2015 11:11:03 -0700 [thread overview]
Message-ID: <xmqq1tku3x3c.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1426120961-2273-1-git-send-email-sveinung84@users.sourceforge.net> (Sveinung Kvilhaugsvik's message of "Thu, 12 Mar 2015 01:42:41 +0100")
Sveinung Kvilhaugsvik <sveinung84@users.sourceforge.net> writes:
> Auto complete stashed modifications for gitk. This makes them easier to
> discover and faster to view.
>
> Signed-off-by: Sveinung Kvilhaugsvik <sveinung84@users.sourceforge.net>
> ---
> contrib/completion/git-completion.bash | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index c21190d..3a23abb 100644
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -2644,6 +2644,8 @@ __gitk_main ()
> ;;
> esac
> __git_complete_revlist
> + __gitcomp_nl_append "$(git --git-dir="$(__gitdir)" stash list \
> + | sed -n -e 's/:.*//p')"
I do not find it particularly useful to expand "gitk st<TAB>" to
"gitk st" and offer "sting stash@{0} stash@{1} stash@{2} stash@{3}"
('sting' happens to be just one of the names of my branches) as
possible choices.
Because I happen to have only four stash entries right now, it may
still be manageable, but the stash entries can be dozens for some
people.
Once you have dozens of branches and tags, you learn to avoid "gitk
<TAB>" (or "git log <TAB>") to prevent the completion code from
dumping all these refnames at you. Instead, you would give a few
characters before hitting the <TAB> to limit the completion. But
this change makes it harder if what you want happens to start with
es-tee something, as you would get many stash@{...} entries along
with it. Also, when you have no ref that is named es-tee something,
"gitk st<TAB>" completes to "gitk stash@{", as if the problem the
change tries to cure is "it is unnecessarily hard to type at-mark
open-brace".
I do not have to be the target audience, though. Maybe this is
useful for some people.
A bigger question is why this change is made to gitk completion. If
this completion were useful for "gitk", wouoldn't it be equally
useful for "git log"?
Thanks.
next prev parent reply other threads:[~2015-03-12 18:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-12 0:42 [PATCH] git-completion: add stashes for gitk Sveinung Kvilhaugsvik
2015-03-12 18:11 ` Junio C Hamano [this message]
2015-03-12 18:40 ` Junio C Hamano
2015-03-13 17:25 ` Sveinung Kvilhaugsvik
2015-03-14 5:18 ` Junio C Hamano
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq1tku3x3c.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=sveinung84@users.sourceforge.net \
/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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.