{"thread":{"id":"38412","subject":"bash completion for git branch/checkout/etc doesn't escape metacharacters","startedAt":"2015-01-20T19:15:50Z","lastAt":"2015-01-20T19:15:50Z","messageCount":1,"participants":["Kevin Stenerson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"254944","messageId":"CAPcx8dzgnChWpTn6po1NF65Mr_hPadUbbNCKHJqght7OG6ksFw@mail.gmail.com","threadId":"38412","inReplyTo":null,"subject":"bash completion for git branch/checkout/etc doesn't escape metacharacters","fromName":"Kevin Stenerson","fromEmail":"kevin@reflexionhealth.com","sentAt":"2015-01-20T19:15:50Z","receivedAt":"2015-01-20T19:15:50Z","isPatch":false,"sender":{"key":"kevin@reflexionhealth.com","avatar":null},"body":"The bash completion provided with git doesn't escape or quote parens\nin tag or branch names.\nAlternatively, it doesn't reject branch or tag names with parenthesis\nas an invalid name (as it does for names with spaces or tabs)\nBash treats parentheses in unquoted words as a word separator.\n\nWhen encountering this problem I was using git version 2.2.2 and bash\nversion 4.3.11\n\nSteps to reproduce with bash:\n\n    mkdir foo\n    cd foo\n    git init foo\n    touch bar\n    git add bar\n    git commit -m \"Went to a bar\"\n\nThen for tags\n\n    git tag 'v1.0.0(215)'\n\nOr branches\n\n    git branch 'mybranch(myuser)'\n\nAnd the actual bash completion\n\n    git checkout   # Use completion here -- it won't escape the parenthesis\n    git checkout master\n    git branch -d   # Use completion here -- it won't escape the parenthesis\n\nSimilarily, when typing a name with an escape character such as\n\"mytag\\(\", it won't complete the name from that point.\n\nThis appears to be true for other bash meta characters as well such as\n'<', '>', '|', ';', '&'\n\n-----------\nKevin Stenerson\nkevin@reflexionhealth.com\n"}]}