git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] branch: Fix --track on a remote-tracking non-branch
@ 2013-09-06 10:40 Johan Herland
  2013-09-06 10:40 ` [PATCH 1/5] t2024: Fix inconsequential typos Johan Herland
                   ` (6 more replies)
  0 siblings, 7 replies; 15+ messages in thread
From: Johan Herland @ 2013-09-06 10:40 UTC (permalink / raw)
  To: gitster; +Cc: Johan Herland, git, Per Cederqvist

Hi,

Per Cederqvist alerted me to a change in v1.8.3.2 that broke his
build/test infrastructure. Specifically, before 41c21f2 (branch.c:
Validate tracking branches with refspecs instead of refs/remotes/*)
Git allowed a local branch to --track anything within refs/remotes/*,
and in 41c21f2, I changed the rules to require a configured remote
with a matching fetch refspec when setting up the upstream configuration
variables (so that there was no ambiguity on how to set
branch.<name>.remote and branch.<name>.merge).

So far so good.

However, in addition to requiring a matching remote/refspec, I also
(for reasons that are still unclear to me) added a requirement that
the resulting remote ref name (to be stored into branch.<name>.merge)
must start with "refs/heads/" (see the last line of
branch.c:check_tracking_branch()).

Although it is typically the case that an upstream branch is a proper
(refs/heads/*) branch in the remote repo (which explains why we have
not noticed this until now), I think it is _wrong_ of Git to _require_
this when configuring the upstream.

Per's setup that triggered this series is described in more detail in
patch #4/5 (which introduces a testcase illustrating the breakage),
and the actual fix (which simply removes the extra refs/heads/*
requirement on the remote ref) is in patch #5/5.

The two first patches are unrelated trivial fixes that I encountered
while working on this, and patch #3 is a small documentation update
suggested by Per.

...Johan


Johan Herland (4):
  t2024: Fix inconsequential typos
  t3200: Minor fix when preparing for tracking failure
  Refer to branch.<name>.remote/merge when documenting --track
  t3200: Add test demonstrating minor regression in 41c21f2

Per Cederqvist (1):
  branch.c: Relax unnecessary requirement on upstream's remote ref name

 Documentation/git-branch.txt |  6 ++++--
 branch.c                     |  3 +--
 t/t2024-checkout-dwim.sh     |  4 ++--
 t/t3200-branch.sh            | 37 ++++++++++++++++++++++++++++++++++++-
 4 files changed, 43 insertions(+), 7 deletions(-)

--
1.8.3.GIT

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2013-09-08 20:58 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-06 10:40 [PATCH 0/5] branch: Fix --track on a remote-tracking non-branch Johan Herland
2013-09-06 10:40 ` [PATCH 1/5] t2024: Fix inconsequential typos Johan Herland
2013-09-06 17:32   ` Junio C Hamano
2013-09-06 20:53     ` Johan Herland
2013-09-06 10:40 ` [PATCH 2/5] t3200: Minor fix when preparing for tracking failure Johan Herland
2013-09-06 10:40 ` [PATCH 3/5] Refer to branch.<name>.remote/merge when documenting --track Johan Herland
2013-09-06 10:40 ` [PATCH 4/5] t3200: Add test demonstrating minor regression in 41c21f2 Johan Herland
2013-09-06 10:40 ` [PATCH 5/5] branch.c: Relax unnecessary requirement on upstream's remote ref name Johan Herland
2013-09-06 17:29 ` [PATCH 0/5] branch: Fix --track on a remote-tracking non-branch Junio C Hamano
2013-09-08 20:58 ` [PATCHv2 " Johan Herland
2013-09-08 20:58   ` [PATCHv2 1/5] t2024: Fix &&-chaining and a couple of typos Johan Herland
2013-09-08 20:58   ` [PATCHv2 2/5] t3200: Minor fix when preparing for tracking failure Johan Herland
2013-09-08 20:58   ` [PATCHv2 3/5] Refer to branch.<name>.remote/merge when documenting --track Johan Herland
2013-09-08 20:58   ` [PATCHv2 4/5] t3200: Add test demonstrating minor regression in 41c21f2 Johan Herland
2013-09-08 20:58   ` [PATCHv2 5/5] branch.c: Relax unnecessary requirement on upstream's remote ref name Johan Herland

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).