summaryrefslogtreecommitdiff
path: root/t/t1502-rev-parse-parseopt.sh
diff options
context:
space:
mode:
authorLibravatar Jacob Keller <jacob.keller@gmail.com>2020-05-28 11:10:36 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-05-28 12:53:24 -0700
commitc55b99c3d3359debb8601b6f687c94deab59ad2d (patch)
tree345d0307fa41d76fb2c038b2716cc9b105544a72 /t/t1502-rev-parse-parseopt.sh
parentcompletion: add tests showing subar checkout --detach logic (diff)
downloadtgif-c55b99c3d3359debb8601b6f687c94deab59ad2d.tar.xz
completion: add tests showing subpar switch/checkout --track logic
When the --track option is provided to git switch or git checkout, and no branch is specified by -c or -b, git will interpret the tracking branch to determine the local branch name to use. This "Do What I Mean" logic is similar but distinct from the default DWIM logic of interpreting a unique remote branch name as a request to create and track that branch. For example, `git switch --track origin/master` is interpreted as a request to create a local branch named master that is tracking origin/master. The current completion for git checkout in this regard is only somewhat poor: $git checkout --track <TAB> HEAD master matching-branch matching-tag other/branch-in-other other/master-in-other At least it still includes remote references. The clutter from including all references isn't too bad. However, git switch completion is terrible: $git switch --track <TAB> master matching-branch It only shows local branches, not even allowing any form of completion of the remote references! Add tests which highlight the expected behavior of completing --track on its own. Note that when -c/-C or -b/-B are provided we do expect completing more references, but this will be discussed in a future change that addresses these options specifically. Signed-off-by: Jacob Keller <jacob.keller@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1502-rev-parse-parseopt.sh')
0 files changed, 0 insertions, 0 deletions