Commit 0408c6b
completion: replace overloaded track term for __git_complete_refs
The __git_complete_refs uses the "--track" option to specify when to
enable listing of unique remote branches which are used by the DWIM
logic of git checkout and git switch.
Using the term '--track' here is confusing because the git commands
themselves have '--track' as an argument. Additionally, the completion
logic for _git_switch also checks for --track. Keeping the meaning of
track_opt and --track for __git_complete_refs straight from the --track
git switch and git checkout option is difficult when reading this code.
Use the option '--dwim' instead, indicating this is about enabling or
disabling logic related to DWIM mode. Also rename the local variable
track_opt to dwim_opt to further reduce the confusion when reading the
completion code for _git_switch.
Because it is plausible for users to have developed their own
completions which rely on __git_complete_ref, keep --track as a synonym
for --dwim, even though we no longer use it in any of the core git
completion logic. Add a comment explaining why it remains as an
alternative spelling for --dwim.
Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent c81ca56 commit 0408c6b
1 file changed
+15
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
749 | 749 | | |
750 | 750 | | |
751 | 751 | | |
752 | | - | |
| 752 | + | |
753 | 753 | | |
754 | 754 | | |
755 | 755 | | |
756 | 756 | | |
757 | 757 | | |
758 | 758 | | |
759 | 759 | | |
760 | | - | |
| 760 | + | |
761 | 761 | | |
762 | 762 | | |
763 | 763 | | |
764 | 764 | | |
765 | | - | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
766 | 768 | | |
767 | 769 | | |
768 | 770 | | |
| |||
771 | 773 | | |
772 | 774 | | |
773 | 775 | | |
774 | | - | |
| 776 | + | |
775 | 777 | | |
776 | 778 | | |
777 | 779 | | |
| |||
1370 | 1372 | | |
1371 | 1373 | | |
1372 | 1374 | | |
1373 | | - | |
| 1375 | + | |
1374 | 1376 | | |
1375 | 1377 | | |
1376 | | - | |
| 1378 | + | |
1377 | 1379 | | |
1378 | | - | |
| 1380 | + | |
1379 | 1381 | | |
1380 | 1382 | | |
1381 | 1383 | | |
| |||
2225 | 2227 | | |
2226 | 2228 | | |
2227 | 2229 | | |
2228 | | - | |
| 2230 | + | |
2229 | 2231 | | |
2230 | 2232 | | |
2231 | | - | |
| 2233 | + | |
2232 | 2234 | | |
2233 | 2235 | | |
2234 | 2236 | | |
2235 | 2237 | | |
2236 | | - | |
| 2238 | + | |
2237 | 2239 | | |
2238 | 2240 | | |
2239 | 2241 | | |
2240 | 2242 | | |
2241 | 2243 | | |
2242 | 2244 | | |
2243 | | - | |
| 2245 | + | |
2244 | 2246 | | |
2245 | | - | |
| 2247 | + | |
2246 | 2248 | | |
2247 | 2249 | | |
2248 | | - | |
| 2250 | + | |
2249 | 2251 | | |
2250 | 2252 | | |
2251 | 2253 | | |
| |||
0 commit comments