bash completion for git branch/checkout/etc doesn't escape metacharacters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The bash completion provided with git doesn't escape or quote parens
in tag or branch names.
Alternatively, it doesn't reject branch or tag names with parenthesis
as an invalid name (as it does for names with spaces or tabs)
Bash treats parentheses in unquoted words as a word separator.

When encountering this problem I was using git version 2.2.2 and bash
version 4.3.11

Steps to reproduce with bash:

    mkdir foo
    cd foo
    git init foo
    touch bar
    git add bar
    git commit -m "Went to a bar"

Then for tags

    git tag 'v1.0.0(215)'

Or branches

    git branch 'mybranch(myuser)'

And the actual bash completion

    git checkout   # Use completion here -- it won't escape the parenthesis
    git checkout master
    git branch -d   # Use completion here -- it won't escape the parenthesis

Similarily, when typing a name with an escape character such as
"mytag\(", it won't complete the name from that point.

This appears to be true for other bash meta characters as well such as
'<', '>', '|', ';', '&'

-----------
Kevin Stenerson
kevin@xxxxxxxxxxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]