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

Re: [PATCH] git-completion: add stashes for gitk

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 12, 2015, 18:40 UTC
Message-ID
<xmqqioe62h5g.fsf@gitster.dls.corp.google.com>
In-Reply-To
<xmqq1tku3x3c.fsf@gitster.dls.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 7 quoted lines
> ...  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.

There is another thing your patch made me notice, which is not a problem that is introduced by your desire to include stash entries to the completion.

The way in which the users can name a stash entry is not very descriptive. I often cannot offhand remember what stash@{2} contains, for example, in my tree. So it is not very useful to be offered a choice among stash@{0} stash@{1} stash@{2} and stash@{3} by a TAB completion.

If there were a way for users to say "The one I made to stash away that change" from the command line (I do not mean "git stash list | grep 'that change'"), it would be good. A new syntax to name a stash entry by pattern matching with the message given to "stash save" could be something like (just thinking aloud, not suggesting that this has to be our final design of that syntax):

    $ git log stash@{/$pattern}
and then it mould make a lot of sense for a completion request
    $ git log stash@{<TAB>
to result in something like this:
    "stash@{/avoid unnecessary negation}"
    "stash@{/style fix t4122}"
    ...
Previous: Junio C HamanoNext: Sveinung Kvilhaugsvik
Message 3 of 5 in “git-completion: add stashes for gitk”
  1. git-completion: add stashes for gitkSveinung Kvilhaugsvik, Mar 12, 2015
  2. Junio C HamanoMar 12, 2015
  3. Junio C HamanoMar 12, 2015
  4. Sveinung KvilhaugsvikMar 13, 2015
  5. Junio C HamanoMar 14, 2015

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.