Skip to content

fetch: set remote/HEAD if missing

Bence Ferdinandy git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v3 Latest2 patches 10 repliesIn review

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2update_symref: add REF_CREATE_ONLY optionbuiltin/branch.c builtin/checkout.c builtin/clone.c +11 more+37 -21244 replies
2/2fetch: set remote/HEAD if it does not existbuiltin/fetch.c+71 -02 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/2] fetch: set remote/HEAD if missing

This series is a complete rewrite of the RFC without using or touching the code of git remote set-head (that part of the RFC is being handled in a new thread of it's own).

Based on the previous discussions it does an atomic update of remote/HEAD if it doesn't exist and is able to. Since we have git remote set-head for manual handling of remote/HEAD, my idea was that it only outputs minimal information and in general send the user to use remote set-head for figuring out issues. If there is a simple, clear HEAD and is changed it will give the command to use for switching to this and if something went wrong it tells the user to check with remote set-head. I'm not sure if this is really needed to be honest.

A note on tests:

- the first patch changing refs_update_symref passes all tests

- the series in itself breaks many fetch tests currently, most of them seem to stem from the fact that we now have remote/HEAD refs as extra

I'm planning to add a test to fetch for testing not to overwrite existing refs, and of course I'll go and clean up all the tests, but it would be nice to know beforehand if the approach is good and to finalize all the outputs before changing 30 something tests.

Bence Ferdinandy (2):
update_symref: add REF_CREATE_ONLY option
fetch: set remote/HEAD if it does not exist

 builtin/branch.c          |  2 +-
 builtin/checkout.c        |  4 +--
 builtin/clone.c           |  6 ++--
 builtin/fetch.c           | 71 +++++++++++++++++++++++++++++++++++++++
 builtin/notes.c           |  2 +-
 builtin/remote.c          |  6 ++--
 builtin/symbolic-ref.c    |  2 +-
 builtin/worktree.c        |  2 +-
 refs.c                    |  6 ++--
 refs.h                    | 12 +++++--
 refs/files-backend.c      |  8 +++++
 reset.c                   |  2 +-
 sequencer.c               |  2 +-
 setup.c                   |  2 +-
 t/helper/test-ref-store.c |  2 +-
 15 files changed, 108 insertions(+), 21 deletions(-)
Signature · 1 line
2.46.1.546.gaa0cd55cd3.dirty