git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] commit: correctly escape @ of stashes
@ 2020-07-03  9:30 Martin Bektchiev via GitGitGadget
  2020-07-06  6:39 ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Martin Bektchiev via GitGitGadget @ 2020-07-03  9:30 UTC (permalink / raw)
  To: git; +Cc: Martin Bektchiev, Martin Bektchiev

From: Martin Bektchiev <martin.bektchiev@progress.com>

Autocomplete suggestions for stashes are broken due to `stash@`
being suggested without escaping.

Reproducible on `GNU bash, version 3.2.57(1)-release` and
`macOS Catalina 10.15.5`.

Signed-off-by: Martin Bektchiev <martin.bektchiev@progress.com>
---
    Correctly escape @ of stashes
    
    Autocomplete suggestions for stashes are broken due to stash@being
    suggested without escaping.
    
    Reproducible on GNU bash, version 3.2.57(1)-release
    (x86_64-apple-darwin19)and macOS Catalina 10.15.5.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-815%2Fmbektchiev%2Fpatch-1-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-815/mbektchiev/patch-1-v1
Pull-Request: https://github.com/git/git/pull/815

 contrib/completion/git-completion.bash | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index de5d0fbbd1..986a7352ef 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -2999,12 +2999,14 @@ _git_stash ()
 				__git_complete_refs
 			else
 				__gitcomp_nl "$(__git stash list \
-						| sed -n -e 's/:.*//p')"
+						| sed -n -e 's/:.*//p' \
+						| sed 's/@/\\@/')"
 			fi
 			;;
 		show,*|apply,*|drop,*|pop,*)
 			__gitcomp_nl "$(__git stash list \
-					| sed -n -e 's/:.*//p')"
+					| sed -n -e 's/:.*//p' \
+					| sed 's/@/\\@/')"
 			;;
 		*)
 			;;

base-commit: a08a83db2bf27f015bec9a435f6d73e223c21c5e
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-07-09  9:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-03  9:30 [PATCH] commit: correctly escape @ of stashes Martin Bektchiev via GitGitGadget
2020-07-06  6:39 ` Junio C Hamano
2020-07-06 23:14   ` Johannes Schindelin
2020-07-08 20:53     ` Junio C Hamano
     [not found]       ` <CAEVR=HRrtT-vae8edN=Ltnp=amApMfUrt0j+6guWYMWZyz8Ohw@mail.gmail.com>
2020-07-09  9:13         ` Johannes Schindelin

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).