git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 0/2] checkout: learn the checkout.guess config variable

From
Denton Liu <liu.denton@gmail.com>
Date
Oct 7, 2020, 05:09 UTC
Message-ID
<cover.1602047333.git.liu.denton@gmail.com>
In-Reply-To
<cover.1601810233.git.liu.denton@gmail.com>

If a user does not wish to use DWIM behaviour, they must manually specify git checkout --no-guess each time. Teach checkout and switch to honour the checkout.guess config variable instead.

Changes since v1:
* Replace enumerated priority list with bullet points
Denton Liu (2):
  Documentation/config/checkout: replace sq with backticks
  checkout: learn to respect checkout.guess
 Documentation/config/checkout.txt      | 21 +++++++----
 Documentation/git-checkout.txt         |  3 ++
 Documentation/git-switch.txt           |  3 ++
 builtin/checkout.c                     |  7 +++-
 contrib/completion/git-completion.bash | 25 ++++++++-----
 t/t2024-checkout-dwim.sh               | 11 ++++++
 t/t2060-switch.sh                      |  5 ++-
 t/t9902-completion.sh                  | 52 ++++++++++++++++++++++++++
 8 files changed, 108 insertions(+), 19 deletions(-)
Range-diff against v1:
1:  f08d3f796a = 1:  f08d3f796a Documentation/config/checkout: replace sq with backticks
2:  8172602f6f ! 2:  2678680a08 checkout: learn to respect checkout.guess
    @@ builtin/checkout.c: static int switch_branches(const struct checkout_opts *opts,
     
      ## contrib/completion/git-completion.bash ##
     @@ contrib/completion/git-completion.bash: _git_bundle ()
    - # To decide between the following rules in priority order
    - # 1) the last provided of "--guess" or "--no-guess" explicitly enable or
    - #    disable completion of DWIM logic respectively.
    + # Helper function to decide whether or not we should enable DWIM logic for
    + # git-switch and git-checkout.
    + #
    +-# To decide between the following rules in priority order
    +-# 1) the last provided of "--guess" or "--no-guess" explicitly enable or
    +-#    disable completion of DWIM logic respectively.
     -# 2) If the --no-track option is provided, take this as a hint to disable the
    -+# 2) If checkout.guess is false, disable completion of DWIM logic.
    -+# 3) If the --no-track option is provided, take this as a hint to disable the
    - #    DWIM completion logic
    +-#    DWIM completion logic
     -# 3) If GIT_COMPLETION_CHECKOUT_NO_GUESS is set, disable the DWIM completion
    -+# 4) If GIT_COMPLETION_CHECKOUT_NO_GUESS is set, disable the DWIM completion
    - #    logic, as requested by the user.
    +-#    logic, as requested by the user.
     -# 4) Enable DWIM logic otherwise.
    -+# 5) Enable DWIM logic otherwise.
    ++# To decide between the following rules in decreasing priority order:
    ++# - the last provided of "--guess" or "--no-guess" explicitly enable or
    ++#   disable completion of DWIM logic respectively.
    ++# - If checkout.guess is false, disable completion of DWIM logic.
    ++# - If the --no-track option is provided, take this as a hint to disable the
    ++#   DWIM completion logic
    ++# - If GIT_COMPLETION_CHECKOUT_NO_GUESS is set, disable the DWIM completion
    ++#   logic, as requested by the user.
    ++# - Enable DWIM logic otherwise.
      #
      __git_checkout_default_dwim_mode ()
      {
-- 
2.28.0.942.g77c4c6094c
Previous: Johannes SchindelinNext: Denton Liu
Message 8 of 14 in “checkout: learn the checkout.guess config variable”
  1. 0/2 checkout: learn the checkout.guess config variableDenton Liu, Oct 4, 2020
  2. 1/2 Documentation/config/checkout: replace sq with backticksDenton Liu, Oct 4, 2020
  3. 2/2 checkout: learn to respect checkout.guessDenton Liu, Oct 4, 2020
  4. Junio C HamanoOct 4, 2020
  5. Denton LiuOct 6, 2020
  6. Junio C HamanoOct 6, 2020
  7. Johannes SchindelinOct 6, 2020
  8. 0/2 checkout: learn the checkout.guess config variableDenton Liu, Oct 7, 2020
  9. 1/2 Documentation/config/checkout: replace sq with backticksDenton Liu, Oct 7, 2020
  10. 2/2 checkout: learn to respect checkout.guessDenton Liu, Oct 7, 2020
  11. Junio C HamanoOct 7, 2020
  12. 0/2 checkout: learn the checkout.guess config variableDenton Liu, Oct 8, 2020
  13. 1/2 Documentation/config/checkout: replace sq with backticksDenton Liu, Oct 8, 2020
  14. 2/2 checkout: learn to respect checkout.guessDenton Liu, Oct 8, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.