git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>, "Jeff King" <peff@peff.net>,
	"Johannes Schindelin" <johannes.schindelin@gmx.de>,
	"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>,
	"Thomas Gummerer" <t.gummerer@gmail.com>,
	"Eric Sunshine" <sunshine@sunshineco.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH v6 0/8] ambiguous checkout UI & checkout.defaultRemote
Date: Sat,  2 Jun 2018 11:50:34 +0000	[thread overview]
Message-ID: <20180602115042.18167-1-avarab@gmail.com> (raw)
In-Reply-To: <20180601211015.11919-1-avarab@gmail.com>

Typo & grammar fixes suggested by Eric Sunshine. tbdiff from v5:
    
    1: ab4529d9f5 = 1: ab4529d9f5 checkout tests: index should be clean after dwim checkout
    2: c8bbece403 = 2: c8bbece403 checkout.h: wrap the arguments to unique_tracking_name()
    3: 4fc5ab27fa ! 3: 881fe63f4f checkout.c: introduce an *_INIT macro
        @@ -1,6 +1,6 @@
         Author: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
         
        -    checkout.[ch]: introduce an *_INIT macro
        +    checkout.c: introduce an *_INIT macro
             
             Add an *_INIT macro for the tracking_name_data similar to what exists
             elsewhere in the codebase, e.g. OID_ARRAY_INIT in sha1-array.h. This
    4: fbce6df584 ! 4: 72ddaeddd3 checkout.c]: change "unique" member to "num_matches"
        @@ -1,6 +1,6 @@
         Author: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
         
        -    checkout.[ch]: change "unique" member to "num_matches"
        +    checkout.c]: change "unique" member to "num_matches"
             
             Internally track how many matches we find in the check_tracking_name()
             callback. Nothing uses this now, but it will be made use of in a later
    5: 6e016d43d7 = 5: 5e8c82680b checkout: pass the "num_matches" up to callers
    6: 07b11b133d = 6: 07e667f80a builtin/checkout.c: use "ret" variable for return
    7: 97e84f6e1c ! 7: 0a148182e6 checkout: add advice for ambiguous "checkout <branch>"
        @@ -8,9 +8,9 @@
                 exactly one remote (call it <remote>) with a matching name, treat
                 as equivalent to [...] <remote>/<branch.
             
        -    This is a really useful feature. The problem is that when you and
        -    another remote (e.g. a fork) git won't find a unique branch name
        -    anymore, and will instead print this nondescript message:
        +    This is a really useful feature. The problem is that when you add
        +    another remote (e.g. a fork), git won't find a unique branch name
        +    anymore, and will instead print this unhelpful message:
             
                 $ git checkout master
                 error: pathspec 'master' did not match any file(s) known to git
        @@ -19,12 +19,12 @@
             
                 $ ./git --exec-path=$PWD checkout master
                 error: pathspec 'master' did not match any file(s) known to git.
        -        hint: The argument 'master' matched more than one remote tracking branch.
        +        hint: 'master' matched more than one remote tracking branch.
                 hint: We found 26 remotes with a reference that matched. So we fell back
                 hint: on trying to resolve the argument as a path, but failed there too!
                 hint:
        -        hint: If you meant to check out a remote tracking branch on e.g. 'origin'
        -        hint: you can do so by fully-qualifying the name with the --track option:
        +        hint: If you meant to check out a remote tracking branch on, e.g. 'origin',
        +        hint: you can do so by fully qualifying the name with the --track option:
                 hint:
                 hint:     git checkout --track origin/<name>
             
        @@ -97,12 +97,12 @@
          		int ret = checkout_paths(&opts, new_branch_info.name);
         +		if (ret && dwim_remotes_matched > 1 &&
         +		    advice_checkout_ambiguous_remote_branch_name)
        -+			advise(_("The argument '%s' matched more than one remote tracking branch.\n"
        ++			advise(_("'%s' matched more than one remote tracking branch.\n"
         +				 "We found %d remotes with a reference that matched. So we fell back\n"
         +				 "on trying to resolve the argument as a path, but failed there too!\n"
         +				 "\n"
        -+				 "If you meant to check out a remote tracking branch on e.g. 'origin'\n"
        -+				 "you can do so by fully-qualifying the name with the --track option:\n"
        ++				 "If you meant to check out a remote tracking branch on, e.g. 'origin',\n"
        ++				 "you can do so by fully qualifying the name with the --track option:\n"
         +				 "\n"
         +				 "    git checkout --track origin/<name>"),
         +			       argv[0],
    8: a5cc070ebf ! 8: f3a52a26a2 checkout & worktree: introduce checkout.defaultRemote
        @@ -175,8 +175,8 @@
          	 *   (c) Otherwise, if "--" is present, treat it like case (1).
          	 *
         @@
        - 				 "If you meant to check out a remote tracking branch on e.g. 'origin'\n"
        - 				 "you can do so by fully-qualifying the name with the --track option:\n"
        + 				 "If you meant to check out a remote tracking branch on, e.g. 'origin',\n"
        + 				 "you can do so by fully qualifying the name with the --track option:\n"
          				 "\n"
         -				 "    git checkout --track origin/<name>"),
         +				 "    git checkout --track origin/<name>\n"

Ævar Arnfjörð Bjarmason (8):
  checkout tests: index should be clean after dwim checkout
  checkout.h: wrap the arguments to unique_tracking_name()
  checkout.c: introduce an *_INIT macro
  checkout.c]: change "unique" member to "num_matches"
  checkout: pass the "num_matches" up to callers
  builtin/checkout.c: use "ret" variable for return
  checkout: add advice for ambiguous "checkout <branch>"
  checkout & worktree: introduce checkout.defaultRemote

 Documentation/config.txt       | 26 +++++++++++++++
 Documentation/git-checkout.txt |  9 ++++++
 Documentation/git-worktree.txt |  9 ++++++
 advice.c                       |  2 ++
 advice.h                       |  1 +
 builtin/checkout.c             | 41 ++++++++++++++++++-----
 builtin/worktree.c             |  4 +--
 checkout.c                     | 37 ++++++++++++++++++---
 checkout.h                     |  4 ++-
 t/t2024-checkout-dwim.sh       | 59 ++++++++++++++++++++++++++++++++++
 t/t2025-worktree-add.sh        | 21 ++++++++++++
 11 files changed, 197 insertions(+), 16 deletions(-)

-- 
2.17.0.290.gded63e768a


  reply	other threads:[~2018-06-02 11:51 UTC|newest]

Thread overview: 95+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-02 10:54 [PATCH] checkout & worktree: introduce a core.DWIMRemote setting Ævar Arnfjörð Bjarmason
2018-05-02 15:21 ` Duy Nguyen
2018-05-02 18:00   ` Eric Sunshine
2018-05-02 18:09     ` Duy Nguyen
2018-05-02 18:25     ` Ævar Arnfjörð Bjarmason
2018-05-03 13:18       ` [PATCH v2] checkout & worktree: introduce checkout.implicitRemote Ævar Arnfjörð Bjarmason
2018-05-03 15:14         ` Duy Nguyen
2018-05-04  7:54           ` Ævar Arnfjörð Bjarmason
2018-05-04 14:58             ` Duy Nguyen
2018-05-04 18:02               ` Ævar Arnfjörð Bjarmason
2018-05-04  9:58         ` Eric Sunshine
2018-05-24 19:47           ` [PATCH v3] " Ævar Arnfjörð Bjarmason
2018-05-25  8:12             ` Junio C Hamano
2018-05-25 14:42               ` Duy Nguyen
2018-05-25 18:38                 ` Ævar Arnfjörð Bjarmason
2018-05-26 12:49                   ` Duy Nguyen
2018-05-31  7:45             ` Ævar Arnfjörð Bjarmason
2018-05-31 19:52               ` [PATCH v4 0/9] ambiguous checkout UI & checkout.defaultRemote Ævar Arnfjörð Bjarmason
2018-06-01 21:10                 ` [PATCH v5 0/8] " Ævar Arnfjörð Bjarmason
2018-06-02 11:50                   ` Ævar Arnfjörð Bjarmason [this message]
2018-06-05 14:40                     ` [PATCH v7 " Ævar Arnfjörð Bjarmason
2018-06-05 14:40                     ` [PATCH v7 1/8] checkout tests: index should be clean after dwim checkout Ævar Arnfjörð Bjarmason
2018-06-05 15:45                       ` SZEDER Gábor
2018-07-27 17:48                         ` [PATCH] tests: make use of the test_must_be_empty function Ævar Arnfjörð Bjarmason
2018-07-27 21:50                           ` Junio C Hamano
2018-07-31  0:17                           ` SZEDER Gábor
2018-08-22 17:48                           ` [PATCH] t6018-rev-list-glob: fix 'empty stdin' test SZEDER Gábor
2018-08-22 17:53                             ` Eric Sunshine
2018-08-22 18:59                               ` SZEDER Gábor
2018-08-22 20:30                                 ` Eric Sunshine
2018-08-22 18:01                             ` Junio C Hamano
2018-08-22 18:50                             ` Junio C Hamano
2018-08-22 19:23                               ` Jeff King
2018-08-22 19:50                                 ` [PATCH] rev-list: make empty --stdin not an error Jeff King
2018-08-22 20:42                                   ` Junio C Hamano
2018-08-22 21:37                                     ` Jeff King
2018-08-22 21:50                                       ` Junio C Hamano
2018-08-22 21:55                                         ` Jeff King
2018-08-22 21:41                                     ` Junio C Hamano
2018-06-05 14:40                     ` [PATCH v7 2/8] checkout.h: wrap the arguments to unique_tracking_name() Ævar Arnfjörð Bjarmason
2018-06-05 14:40                     ` [PATCH v7 3/8] checkout.c: introduce an *_INIT macro Ævar Arnfjörð Bjarmason
2018-06-05 14:40                     ` [PATCH v7 4/8] checkout.c: change "unique" member to "num_matches" Ævar Arnfjörð Bjarmason
2018-06-05 14:40                     ` [PATCH v7 5/8] checkout: pass the "num_matches" up to callers Ævar Arnfjörð Bjarmason
2018-06-05 14:40                     ` [PATCH v7 6/8] builtin/checkout.c: use "ret" variable for return Ævar Arnfjörð Bjarmason
2018-06-05 14:40                     ` [PATCH v7 7/8] checkout: add advice for ambiguous "checkout <branch>" Ævar Arnfjörð Bjarmason
2018-06-05 14:40                     ` [PATCH v7 8/8] checkout & worktree: introduce checkout.defaultRemote Ævar Arnfjörð Bjarmason
2018-06-02 11:50                   ` [PATCH v6 1/8] checkout tests: index should be clean after dwim checkout Ævar Arnfjörð Bjarmason
2018-06-02 11:50                   ` [PATCH v6 2/8] checkout.h: wrap the arguments to unique_tracking_name() Ævar Arnfjörð Bjarmason
2018-06-02 11:50                   ` [PATCH v6 3/8] checkout.c: introduce an *_INIT macro Ævar Arnfjörð Bjarmason
2018-06-02 11:50                   ` [PATCH v6 4/8] checkout.c]: change "unique" member to "num_matches" Ævar Arnfjörð Bjarmason
2018-06-02 11:50                   ` [PATCH v6 5/8] checkout: pass the "num_matches" up to callers Ævar Arnfjörð Bjarmason
2018-06-02 11:50                   ` [PATCH v6 6/8] builtin/checkout.c: use "ret" variable for return Ævar Arnfjörð Bjarmason
2018-06-02 11:50                   ` [PATCH v6 7/8] checkout: add advice for ambiguous "checkout <branch>" Ævar Arnfjörð Bjarmason
2018-06-02 11:50                   ` [PATCH v6 8/8] checkout & worktree: introduce checkout.defaultRemote Ævar Arnfjörð Bjarmason
2018-06-03  7:58                     ` Eric Sunshine
2018-06-01 21:10                 ` [PATCH v5 1/8] checkout tests: index should be clean after dwim checkout Ævar Arnfjörð Bjarmason
2018-06-01 21:10                 ` [PATCH v5 2/8] checkout.h: wrap the arguments to unique_tracking_name() Ævar Arnfjörð Bjarmason
2018-06-01 21:10                 ` [PATCH v5 3/8] checkout.[ch]: introduce an *_INIT macro Ævar Arnfjörð Bjarmason
2018-06-01 22:40                   ` Eric Sunshine
2018-06-01 21:10                 ` [PATCH v5 4/8] checkout.[ch]: change "unique" member to "num_matches" Ævar Arnfjörð Bjarmason
2018-06-01 22:41                   ` Eric Sunshine
2018-06-01 21:10                 ` [PATCH v5 5/8] checkout: pass the "num_matches" up to callers Ævar Arnfjörð Bjarmason
2018-06-01 21:10                 ` [PATCH v5 6/8] builtin/checkout.c: use "ret" variable for return Ævar Arnfjörð Bjarmason
2018-06-01 21:10                 ` [PATCH v5 7/8] checkout: add advice for ambiguous "checkout <branch>" Ævar Arnfjörð Bjarmason
2018-06-01 22:52                   ` Eric Sunshine
2018-06-01 21:10                 ` [PATCH v5 8/8] checkout & worktree: introduce checkout.defaultRemote Ævar Arnfjörð Bjarmason
2018-05-31 19:52               ` [PATCH v4 1/9] checkout tests: index should be clean after dwim checkout Ævar Arnfjörð Bjarmason
2018-06-01  4:06                 ` Junio C Hamano
2018-06-01 19:43                   ` Ævar Arnfjörð Bjarmason
2018-05-31 19:52               ` [PATCH v4 2/9] checkout.h: wrap the arguments to unique_tracking_name() Ævar Arnfjörð Bjarmason
2018-05-31 19:52               ` [PATCH v4 3/9] checkout.[ch]: move struct declaration into *.h Ævar Arnfjörð Bjarmason
2018-05-31 21:45                 ` Thomas Gummerer
2018-06-01  2:14                   ` Junio C Hamano
2018-06-01  9:56                     ` Ævar Arnfjörð Bjarmason
2018-05-31 19:52               ` [PATCH v4 4/9] checkout.[ch]: introduce an *_INIT macro Ævar Arnfjörð Bjarmason
2018-06-01  4:16                 ` Junio C Hamano
2018-05-31 19:52               ` [PATCH v4 5/9] checkout.[ch]: change "unique" member to "num_matches" Ævar Arnfjörð Bjarmason
2018-05-31 19:52               ` [PATCH v4 6/9] checkout: pass the "num_matches" up to callers Ævar Arnfjörð Bjarmason
2018-05-31 19:52               ` [PATCH v4 7/9] builtin/checkout.c: use "ret" variable for return Ævar Arnfjörð Bjarmason
2018-05-31 19:52               ` [PATCH v4 8/9] checkout: add advice for ambiguous "checkout <branch>" Ævar Arnfjörð Bjarmason
2018-06-01  4:32                 ` Junio C Hamano
2018-06-01  5:11                   ` Junio C Hamano
2018-06-01  9:54                     ` Ævar Arnfjörð Bjarmason
2018-06-04  1:58                       ` Junio C Hamano
2018-06-01  9:50                   ` Ævar Arnfjörð Bjarmason
2018-06-01  7:53                 ` Eric Sunshine
2018-06-01 19:59                   ` Ævar Arnfjörð Bjarmason
2018-05-31 19:52               ` [PATCH v4 9/9] checkout & worktree: introduce checkout.defaultRemote Ævar Arnfjörð Bjarmason
2018-05-31 21:49                 ` Stefan Beller
2018-06-01  8:04                   ` Eric Sunshine
2018-06-01  9:47                   ` Ævar Arnfjörð Bjarmason
2018-05-31 22:22                 ` Thomas Gummerer
2018-06-01  2:17                   ` Junio C Hamano
2018-05-04  7:14       ` [PATCH] checkout & worktree: introduce a core.DWIMRemote setting Eric Sunshine
2018-05-04  7:23         ` Eric Sunshine

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180602115042.18167-1-avarab@gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=johannes.schindelin@gmx.de \
    --cc=pclouds@gmail.com \
    --cc=peff@peff.net \
    --cc=sunshine@sunshineco.com \
    --cc=t.gummerer@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).