Skip to content

Commit 8cdfabd

Browse files
committed
- Update instructions and template for obtaining list of git branches
1 parent c413d31 commit 8cdfabd

File tree

8 files changed

+12
-12
lines changed

8 files changed

+12
-12
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ mygit status:
7777
- --help
7878
- --verbose
7979
- --branch
80-
- $(git branch 2>/dev/null)
80+
- $(git branch --format='%(refname:short)' 2>/dev/null)
8181

8282
mygit init:
8383
- --bare
@@ -169,7 +169,7 @@ branches to your suggestions, use the following:
169169

170170
```yaml
171171
mygit:
172-
- $(git branch 2>/dev/null)
172+
- $(git branch --format='%(refname:short)' 2>/dev/null)
173173
```
174174

175175
The `2> /dev/null` is used so that if the command is executed in a directory
@@ -186,10 +186,10 @@ mygit checkout:
186186
- -b
187187
188188
mygit checkout*--branch:
189-
- $(git branch 2>/dev/null)
189+
- $(git branch --format='%(refname:short)' 2>/dev/null)
190190
191191
mygit checkout*-b:
192-
- $(git branch 2>/dev/null)
192+
- $(git branch --format='%(refname:short)' 2>/dev/null)
193193
```
194194

195195
The above will suggest git branches for commands that end with `-b` or `--branch`.
@@ -202,7 +202,7 @@ mygit checkout:
202202
- -b
203203
204204
mygit checkout*--branch: &branches
205-
- $(git branch 2>/dev/null)
205+
- $(git branch --format='%(refname:short)' 2>/dev/null)
206206
207207
mygit checkout*-b: *branches
208208
```

lib/completely/templates/sample.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ mygit status:
99
- --help
1010
- --verbose
1111
- --branch
12-
- $(git branch 2>/dev/null)
12+
- $(git branch --format='%(refname:short)' 2>/dev/null)
1313

1414
mygit init:
1515
- --bare

spec/approvals/cli/generated-script

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ _mygit_completions() {
2929

3030
case "$compline" in
3131
'status'*)
32-
while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_mygit_completions_filter "--help --verbose --branch $(git branch 2>/dev/null)")" -- "$cur")
32+
while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_mygit_completions_filter "--help --verbose --branch $(git branch --format='%(refname:short)' 2>/dev/null)")" -- "$cur")
3333
;;
3434

3535
'commit'*)

spec/approvals/cli/generated-script-alt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ _mycomps() {
2929

3030
case "$compline" in
3131
'status'*)
32-
while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_mycomps_filter "--help --verbose --branch $(git branch 2>/dev/null)")" -- "$cur")
32+
while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_mycomps_filter "--help --verbose --branch $(git branch --format='%(refname:short)' 2>/dev/null)")" -- "$cur")
3333
;;
3434

3535
'commit'*)

spec/approvals/cli/generated-wrapped-script

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ give_comps() {
3030
echo $''
3131
echo $' case "$compline" in'
3232
echo $' \'status\'*)'
33-
echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_mygit_completions_filter "--help --verbose --branch $(git branch 2>/dev/null)")" -- "$cur")'
33+
echo $' while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_mygit_completions_filter "--help --verbose --branch $(git branch --format=\'%(refname:short)\' 2>/dev/null)")" -- "$cur")'
3434
echo $' ;;'
3535
echo $''
3636
echo $' \'commit\'*)'

spec/approvals/cli/test/completely-tester-1.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ _mygit_completions() {
3737

3838
case "$compline" in
3939
'status'*)
40-
while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_mygit_completions_filter "--help --verbose --branch $(git branch 2>/dev/null)")" -- "$cur")
40+
while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_mygit_completions_filter "--help --verbose --branch $(git branch --format='%(refname:short)' 2>/dev/null)")" -- "$cur")
4141
;;
4242

4343
'commit'*)

spec/approvals/cli/test/completely-tester-2.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ _mygit_completions() {
3737

3838
case "$compline" in
3939
'status'*)
40-
while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_mygit_completions_filter "--help --verbose --branch $(git branch 2>/dev/null)")" -- "$cur")
40+
while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_mygit_completions_filter "--help --verbose --branch $(git branch --format='%(refname:short)' 2>/dev/null)")" -- "$cur")
4141
;;
4242

4343
'commit'*)

spec/approvals/cli/test/completely-tester.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ _mygit_completions() {
3737

3838
case "$compline" in
3939
'status'*)
40-
while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_mygit_completions_filter "--help --verbose --branch $(git branch 2>/dev/null)")" -- "$cur")
40+
while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_mygit_completions_filter "--help --verbose --branch $(git branch --format='%(refname:short)' 2>/dev/null)")" -- "$cur")
4141
;;
4242

4343
'commit'*)

0 commit comments

Comments
 (0)