git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 2/2] checkout: die() on ambiguous tracking branches
Date: Thu, 5 Dec 2019 16:34:17 +0100	[thread overview]
Message-ID: <065c02a7-8ef9-192b-097e-57913db05520@syntevo.com> (raw)
In-Reply-To: <08b8acc1-6925-ad40-faa2-88a16b8d135f@syntevo.com>

Ævar, please let me know if your concern is resolved?

On 27.11.2019 17:09, Alexandr Miloslavskiy wrote:
> 
> 
> On 27.11.2019 16:43, Ævar Arnfjörð Bjarmason wrote:
>> I'll reserve judgement on whether we really should do this for now, my
>> current opinion on the matter is undefined as I haven't re-paged this
>> behavior of checkout into my brain.
>>
>> But a giant red flag here for me is that you say "I understand that this
>> was never intended".
>>
>> Just from a cursory look at this that's not true, for better or worse it
>> *is* intended behavior. Most of the code you're moving around here is
>> what I added in ad8d5104b4 ("checkout: add advice for ambiguous
>> "checkout <branch>"", 2018-06-05), and the very start of that commit
>> message refers to the checkout documentation we have that explicitly
>> documents this edge case.
>>
>> Digging a bit further reveals that we've had this behavior (again,
>> intended, not emergent) since 70c9ac2f19 ("DWIM "git checkout frotz" to
>> "git checkout -b frotz origin/frotz"", 2009-10-18), and had it
>> documented since 00bb4378c7 ("Documentation/git-checkout.txt: document
>> 70c9ac2 behavior", 2012-12-17).
>>
>> So at the very least I'd say you need a v2 where you amend the relevant
>> docs & commit message to make a case to the effect of "we've had this
>> since 2009, but it was never really all that important etc.".
>>
> 
> I'm sorry, can you please clarify?
> 
> My patch addresses the situation where there are *multiple* remote 
> candidates *and* a file with the same name.
> 
> My feeling is that in this case, reverting a file is an unintended 
> surprise.
> 
> I understand previous patches this way:
> ad8d5104 - patch series is mostly for "if there are *multiple* remotes,
>             disambiguate via checkout.defaultRemote". This essentially
>             converts the case of multiple remotes into a single remote.
>             However, this also semi-documents what I'm now preventing.
>             Was that really intended?
> 70c9ac2f - if there is *one* remote, DWIM it.
>             This isn't what I'm changing.
> be4908f1 - if there is *one* remote *and* file, die().
>             This is what I'm extending further.
> 
> If the prevented behavior is documented, could you please quote it 
> explicitly?
> 
>> Such a change should also be changing the docs etc. added in 8d7b558bae
>> ("checkout & worktree: introduce checkout.defaultRemote",
>> 2018-06-05). With this series our docs don't make a lot of sense anymore
>> & don't describe the behavior with the patches applied.
> 
> To my understanding, my patch doesn't affect those pieces of docs? 
> Please correct me if I'm wrong.


  reply	other threads:[~2019-12-05 15:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-27  9:48 [PATCH 0/2] checkout: die() on ambiguous tracking branches Alexandr Miloslavskiy via GitGitGadget
2019-11-27  9:48 ` [PATCH 1/2] parse_branchname_arg(): extract part as new function Alexandr Miloslavskiy via GitGitGadget
2019-11-27  9:48 ` [PATCH 2/2] checkout: die() on ambiguous tracking branches Alexandr Miloslavskiy via GitGitGadget
2019-11-27 14:46   ` Derrick Stolee
2019-11-27 16:42     ` Alexandr Miloslavskiy
2019-11-27 15:43   ` Ævar Arnfjörð Bjarmason
2019-11-27 16:09     ` Alexandr Miloslavskiy
2019-12-05 15:34       ` Alexandr Miloslavskiy [this message]
2019-11-27 16:43 ` [PATCH v2 0/2] " Alexandr Miloslavskiy via GitGitGadget
2019-11-27 16:43   ` [PATCH v2 1/2] parse_branchname_arg(): extract part as new function Alexandr Miloslavskiy via GitGitGadget
2019-11-27 16:43   ` [PATCH v2 2/2] checkout: die() on ambiguous tracking branches Alexandr Miloslavskiy via GitGitGadget
2019-12-01 15:47   ` [PATCH v2 0/2] " Junio C Hamano
2019-12-01 16:52     ` Alexandr Miloslavskiy

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=065c02a7-8ef9-192b-097e-57913db05520@syntevo.com \
    --to=alexandr.miloslavskiy@syntevo.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).