All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Jonathan Tan <jonathantanmy@google.com>
Subject: [PATCH v2 0/3] cloning unborn HEAD when other branches are present
Date: Thu, 7 Jul 2022 19:54:21 -0400	[thread overview]
Message-ID: <YsdyLS4UFzj0j/wB@coredump.intra.peff.net> (raw)
In-Reply-To: <xmqqk08ozrid.fsf@gitster.g>

On Thu, Jul 07, 2022 at 11:50:34AM -0700, Junio C Hamano wrote:

> Jeff King <peff@peff.net> writes:
> 
> > If so, do you prefer to go straight there in patch 3 (and drop patch 2,
> > keeping the unborn setup inline), or do you prefer to see it on top?
> > Normally I'd suggest the former, but I worry that doing it all in one
> > patch means it's reorganizing the code _and_ changing the behavior all
> > at once, which is harder to reason about. And I don't see an easy way to
> > reorganize the code without changing the behavior.
> 
> Either way is fine, but the "go straight there" approach may work
> better, I suspect.

Yeah, the diff turned out less noisy than I'd feared. So here's a v2. It
does the refactoring we've been discussing, which is now in patch 2
(since the extra function is no longer needed). And then it was actually
pretty easy to fix the other weird "your unborn master does not match
the remote's master" problem on top. I _think_ that's the right thing to
be doing, but see the discussion in patch 3.

I'll skip the range diff, which is mostly unreadable (the only readable
part is that I did s/empty/unborn/ in the tests, as discussed).

  [1/3]: clone: drop extra newline from warning message
  [2/3]: clone: propagate empty remote HEAD even with other branches
  [3/3]: clone: use remote branch if it matches default HEAD

 builtin/clone.c        | 58 ++++++++++++++++++++++-------------------
 t/t5605-clone-local.sh | 16 +++++++++---
 t/t5702-protocol-v2.sh | 59 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 104 insertions(+), 29 deletions(-)

-Peff

  reply	other threads:[~2022-07-07 23:54 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-06  7:57 [PATCH 0/3] cloning unborn HEAD when other branches are present Jeff King
2022-07-06  8:00 ` [PATCH 1/3] clone: drop extra newline from warning message Jeff King
2022-07-06  8:00 ` [PATCH 2/3] clone: factor out unborn head setup into its own function Jeff King
2022-07-06  8:03 ` [PATCH 3/3] clone: propagate empty remote HEAD even with other branches Jeff King
2022-07-06 18:19   ` Junio C Hamano
2022-07-06 22:01     ` Junio C Hamano
2022-07-07 17:40       ` Jeff King
2022-07-07 18:50         ` Junio C Hamano
2022-07-07 23:54           ` Jeff King [this message]
2022-07-07 23:54             ` [PATCH v2 1/3] clone: drop extra newline from warning message Jeff King
2022-07-07 23:57             ` [PATCH v2 2/3] clone: propagate empty remote HEAD even with other branches Jeff King
2022-07-08 15:41               ` Junio C Hamano
2022-07-08 16:08                 ` Jeff King
2022-07-07 23:59             ` [PATCH v2 3/3] clone: use remote branch if it matches default HEAD Jeff King
2022-07-08 16:28               ` Junio C Hamano
2022-07-08 19:30                 ` Jeff King
2022-07-08 20:33                   ` Junio C Hamano
2022-07-11  9:21                     ` [PATCH v2 4/3] clone: move unborn head creation to update_head() Jeff King
2022-07-11 20:36                       ` Junio C Hamano
2022-07-07 17:23     ` [PATCH 3/3] clone: propagate empty remote HEAD even with other branches Jeff King
2022-07-06 18:17 ` [PATCH 0/3] cloning unborn HEAD when other branches are present Jonathan Tan

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=YsdyLS4UFzj0j/wB@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jonathantanmy@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.