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

Re: [PATCH] bash completion: Fix the . -> .. revision range completion

From
Shawn O. Pearce <spearce@spearce.org>
Date
Jul 13, 2008, 22:06 UTC
Message-ID
<20080713220631.GB12708@spearce.org>
In-Reply-To
<7vskudpiqq.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> wrote:
> Petr Baudis <pasky@suse.cz> writes:
> > When Git sees a string with trailing dot on a place where revision
> > range could occur, it will unconditionally append another dot to
...
> > 	git log git-submodule.<tab>
...
Show 7 quoted lines
> By the way, the above command line is another "dot" related frustration I
> always have.  If you try:
> 
> 	git log v1.5.6.<TAB>
> 
> the completion code adds a dot unconditionally when I want to choose from
> the list of v1.5.6.X tags.

This annoys me too Junio. Its a bug I just never got around to fixing. Based on Petr's comments and yours I'm wondering if this is just not the better patch to apply here:

--8<-- bash completion: Don't offer "a.." as a completion for "a."

If the user is trying to complete "v1.5.3.<tab>" to see all of the available maintenance releases for 1.5.3 we should not give them an extra dot as the completion. Instead if the user wants a ".." or a "..." operator they should key the two dots out on their own. Its the same number of keystrokes either way.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 contrib/completion/git-completion.bash |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 61581fe..9a1c66a 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -324,9 +324,6 @@ __git_complete_revlist ()
 		cur="${cur#*..}"
 		__gitcomp "$(__git_refs)" "$pfx" "$cur"
 		;;
-	*.)
-		__gitcomp "$cur."
-		;;
 	*)
 		__gitcomp "$(__git_refs)"
 		;;
-- 
1.5.6.2.393.g45096

-- 
Shawn.
Previous: Junio C HamanoNext: Petr Baudis
Message 4 of 22 in “bash completion: Fix the . -> .. revision range completion”
  1. bash completion: Fix the . -> .. revision range completionPetr Baudis, Jul 13, 2008
  2. Jakub NarebskiJul 13, 2008
  3. Junio C HamanoJul 13, 2008
  4. Shawn O. PearceJul 13, 2008
  5. Petr BaudisJul 13, 2008
  6. Junio C HamanoJul 13, 2008
  7. Linus TorvaldsJul 13, 2008
  8. Shawn O. PearceJul 14, 2008
  9. Linus TorvaldsJul 14, 2008
  10. Shawn O. PearceJul 14, 2008
  11. Shawn O. PearceJul 14, 2008
  12. Björn SteinbrinkJul 14, 2008
  13. Björn SteinbrinkJul 14, 2008
  14. Andreas EricssonJul 14, 2008
  15. Linus TorvaldsJul 14, 2008
  16. Linus TorvaldsJul 14, 2008
  17. Shawn O. PearceJul 15, 2008
  18. Andreas EricssonJul 15, 2008
  19. Andreas EricssonJul 15, 2008
  20. Andreas EricssonJul 15, 2008
  21. Shawn O. PearceJul 15, 2008
  22. Andreas EricssonJul 16, 2008

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.