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

[PATCH v2 0/2] completion: improvements for git stash

From
Thomas Gummerer <t.gummerer@gmail.com>
Date
Apr 19, 2018, 23:25 UTC
Message-ID
<20180419232514.16572-1-t.gummerer@gmail.com>
In-Reply-To
<20180417212945.24002-1-t.gummerer@gmail.com>
Previous round was at <20180417212945.24002-1-t.gummerer@gmail.com>.
Thanks Junio for your input on the previous round.

This round drops what was 1/3 in the previous round. We keep completing the options for 'git stash save', so calling the variable 'save_opts' and defining what would be 'push_opts' as 'save_opts' + '--message' makes sense.

2/3 (now 1/2) was mostly rewritten. We now no longer suggest 'save' in 'git stash <tab>', complete 'git stash s<tab>' will complete to 'git stash show', but 'git stash sa<tab>' (or longer) will keep completing to 'git stash save', as the user most likely already knows about 'git stash save', and wanted to type that. We also keep completing the options for 'git stash save' on 'git stash save --<tab>'.

3/3 (now 2/2) stays the same as in the previous round.

I didn't find a good way to implement "reluctant completion" (I'm also by no means an expert in bash completion, so there may well be a way I couldn't find by googl'ing around), so I left that out of this series.

I don't think it's strictly necessary for the deprecation either, as we can just print a warning message when the user actually uses 'git stash save' at some point, which would make a message printed when using the completion redundant anyway. I feel like that warning message is not something we're quite ready for yet and I'd rather wait a few more releases before doing that though.

Thomas Gummerer (2):
  completion: stop showing 'save' for stash by default
  completion: make stash -p and alias for stash push -p
 contrib/completion/git-completion.bash | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
-- 
2.17.0.252.gfe0a9eaf31
Previous: Thomas GummererNext: Thomas Gummerer
Message 7 of 12 in “completion: improvements for git stash”
  1. 0/3 completion: improvements for git stashThomas Gummerer, Apr 17, 2018
  2. 1/3 completion: rename save_opts to default_opts for stashThomas Gummerer, Apr 17, 2018
  3. 2/3 completion: stop completing 'save' as stash subcommandThomas Gummerer, Apr 17, 2018
  4. 3/3 completion: make stash -p and alias for stash push -pThomas Gummerer, Apr 17, 2018
  5. Junio C HamanoApr 18, 2018
  6. Thomas GummererApr 18, 2018
  7. 0/2 completion: improvements for git stashThomas Gummerer, Apr 19, 2018
  8. 1/2 completion: stop showing 'save' for stash by defaultThomas Gummerer, Apr 19, 2018
  9. Duy NguyenApr 20, 2018
  10. Thomas GummererApr 22, 2018
  11. 2/2 completion: make stash -p and alias for stash push -pThomas Gummerer, Apr 19, 2018
  12. Junio C HamanoApr 20, 2018

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.