{"thread":{"id":"12501","subject":"[PATCH 1/2] bash: add git-branch options","startedAt":"2008-03-04T18:00:58Z","lastAt":"2008-03-05T05:51:38Z","messageCount":3,"participants":["SZEDER Gábor","Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"70979","messageId":"d55a578b4b3f3b7d679b7f8b69497955c7a82a50.1204652001.git.szeder@ira.uka.de","threadId":"12501","inReplyTo":null,"subject":"[PATCH 1/2] bash: add git-branch options","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2008-03-04T18:00:58Z","receivedAt":"2008-03-04T18:00:58Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>\n---\n contrib/completion/git-completion.bash |   11 ++++++++++-\n 1 files changed, 10 insertions(+), 1 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 8f70e1e..8d6733a 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -506,7 +506,16 @@ _git_bisect ()\n \n _git_branch ()\n {\n-\t__gitcomp \"$(__git_refs)\"\n+\tcase \"${COMP_WORDS[COMP_CWORD]}\" in\n+\t--*=*)\tCOMPREPLY=() ;;\n+\t--*)\n+\t\t__gitcomp \"\n+\t\t\t--color --no-color --verbose --abbrev= --no-abbrev\n+\t\t\t--track --no-track\n+\t\t\t\"\n+\t\t;;\n+\t*)\t__gitcomp \"$(__git_refs)\" ;;\n+\tesac\n }\n \n _git_bundle ()\n-- \n1.5.4.3\n\n"},{"id":"70980","messageId":"4fffe1c7adc092af695610a87f97c8684ae0eea6.1204652001.git.szeder@ira.uka.de","threadId":"12501","inReplyTo":"d55a578b4b3f3b7d679b7f8b69497955c7a82a50.1204652001.git.szeder@ira.uka.de","subject":"[PATCH 2/2] bash: git-branch -d and -m lists only local branches","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2008-03-04T18:00:59Z","receivedAt":"2008-03-04T18:00:59Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"But still all branches are listed, if -r is present\n\nSigned-off-by: SZEDER Gábor <szeder@ira.uka.de>\n---\n contrib/completion/git-completion.bash |   19 ++++++++++++++++++-\n 1 files changed, 18 insertions(+), 1 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 8d6733a..49e6df0 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -506,6 +506,17 @@ _git_bisect ()\n \n _git_branch ()\n {\n+\tlocal i c=1 only_local_ref=\"n\" has_r=\"n\"\n+\n+\twhile [ $c -lt $COMP_CWORD ]; do\n+\t\ti=\"${COMP_WORDS[c]}\"\n+\t\tcase \"$i\" in\n+\t\t-d|-m)\tonly_local_ref=\"y\" ;;\n+\t\t-r)\thas_r=\"y\" ;;\n+\t\tesac\n+\t\tc=$((++c))\n+\tdone\n+\n \tcase \"${COMP_WORDS[COMP_CWORD]}\" in\n \t--*=*)\tCOMPREPLY=() ;;\n \t--*)\n@@ -514,7 +525,13 @@ _git_branch ()\n \t\t\t--track --no-track\n \t\t\t\"\n \t\t;;\n-\t*)\t__gitcomp \"$(__git_refs)\" ;;\n+\t*)\n+\t\tif [ $only_local_ref = \"y\" -a $has_r = \"n\" ]; then\n+\t\t\t__gitcomp \"$(__git_heads)\"\n+\t\telse\n+\t\t\t__gitcomp \"$(__git_refs)\"\n+\t\tfi\n+\t\t;;\n \tesac\n }\n \n-- \n1.5.4.3\n\n"},{"id":"71031","messageId":"20080305055138.GC8410@spearce.org","threadId":"12501","inReplyTo":"4fffe1c7adc092af695610a87f97c8684ae0eea6.1204652001.git.szeder@ira.uka.de","subject":"Re: [PATCH 2/2] bash: git-branch -d and -m lists only local branches","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-03-05T05:51:38Z","receivedAt":"2008-03-05T05:51:38Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"SZEDER Gbor <szeder@ira.uka.de> wrote:\n> But still all branches are listed, if -r is present\n> \n> Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>\n\nNice.\n\nBoth patches 1 and 2,\nAcked-by: Shawn O. Pearce <spearce@spearce.org>\n\n> ---\n>  contrib/completion/git-completion.bash |   19 ++++++++++++++++++-\n>  1 files changed, 18 insertions(+), 1 deletions(-)\n\n-- \nShawn.\n"}]}