Commit d773c63
bash: offer only paths after '--'
Many git commands use '--' to separate subcommands, options, and refs
from paths. However, the programmable completion for several of these
commands does not respect the '--', and offer subcommands, options, or
refs after a '--', although only paths are permitted. e.g. 'git bisect
-- <TAB>' offers subcommands, 'git log -- --<TAB>' offers options and
'git log -- git<TAB>' offers all gitgui tags.
The completion for the following commands share this wrong behaviour:
am add bisect commit diff log reset shortlog submodule gitk.
To avoid this, we check the presence of a '--' on the command line first
and let the shell do filename completion, if one is found.
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 1db4a75 commit d773c63
1 file changed
+30
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
451 | 451 | | |
452 | 452 | | |
453 | 453 | | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
454 | 466 | | |
455 | 467 | | |
456 | 468 | | |
| |||
497 | 509 | | |
498 | 510 | | |
499 | 511 | | |
| 512 | + | |
| 513 | + | |
500 | 514 | | |
501 | 515 | | |
502 | 516 | | |
| |||
511 | 525 | | |
512 | 526 | | |
513 | 527 | | |
| 528 | + | |
| 529 | + | |
514 | 530 | | |
515 | 531 | | |
516 | 532 | | |
| |||
613 | 629 | | |
614 | 630 | | |
615 | 631 | | |
| 632 | + | |
| 633 | + | |
616 | 634 | | |
617 | 635 | | |
618 | 636 | | |
| |||
632 | 650 | | |
633 | 651 | | |
634 | 652 | | |
| 653 | + | |
| 654 | + | |
635 | 655 | | |
636 | 656 | | |
637 | 657 | | |
| |||
734 | 754 | | |
735 | 755 | | |
736 | 756 | | |
| 757 | + | |
| 758 | + | |
737 | 759 | | |
738 | 760 | | |
739 | 761 | | |
| |||
1085 | 1107 | | |
1086 | 1108 | | |
1087 | 1109 | | |
| 1110 | + | |
| 1111 | + | |
1088 | 1112 | | |
1089 | 1113 | | |
1090 | 1114 | | |
| |||
1097 | 1121 | | |
1098 | 1122 | | |
1099 | 1123 | | |
| 1124 | + | |
| 1125 | + | |
1100 | 1126 | | |
1101 | 1127 | | |
1102 | 1128 | | |
| |||
1143 | 1169 | | |
1144 | 1170 | | |
1145 | 1171 | | |
| 1172 | + | |
| 1173 | + | |
1146 | 1174 | | |
1147 | 1175 | | |
1148 | 1176 | | |
| |||
1349 | 1377 | | |
1350 | 1378 | | |
1351 | 1379 | | |
| 1380 | + | |
| 1381 | + | |
1352 | 1382 | | |
1353 | 1383 | | |
1354 | 1384 | | |
| |||
0 commit comments