Skip to content

Detached HEADs in new worktrees considered harmful

Michael J Gruber git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6Documentation/git-worktree: spell --detach correctlyDocumentation/git-worktree.txt+1 -11 reply
2/6t6014: test prune with detached HEADs in separate worktreest/t6014-rev-list-all.sh+25 -01 reply
3/6rev-list: list all heads with --allrefs/files-backend.c+11 -41 reply
4/6WIP: mess only with mark_reachablereachable.c refs.h refs/files-backend.c+25 -10 replies
5/6WIP: fix unborn branch caserefs/files-backend.c+2 -00 replies
6/6revisions: list all worktree HEADs with --allDocumentation/rev-list-options.txt refs/files-backend.c+2 -20 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH/WIP 0/6] Detached HEADs in new worktrees considered harmful

Before someone loses their HEAD I should put this series out (again).

1/6 is a tiny documentation fix.

2/6 demonstrates that "git prune" in the main worktree loses HEADs in other worktrees, and vice versa.

In fact, one should rethink the meaning of "git rev-list --all" in the context of per-worktree refs such as HEAD.

3/6 is a possible fix (making "--all" mean "all refs in all worktrees") but may be too intrusive.

4/6, 5/6, 6/6 are some WIP patches about making 3/6 less intrusive and fixing some cases where do_head_ref_worktrees() has problems that do_head_ref() doesn't have.

Michael J Gruber (6):
Documentation/git-worktree: spell --detach correctly
t6014: test prune with detached HEADs in separate worktrees
rev-list: list all heads with --all
WIP: mess only with mark_reachable
fix unborn branch case
revisions: list all worktree HEADs with --all

 Documentation/git-worktree.txt     |  2 +-
 Documentation/rev-list-options.txt |  2 +-
 reachable.c                        |  2 +-
 refs.h                             |  1 +
 refs/files-backend.c               | 34 +++++++++++++++++++++++++++++++++-
 t/t6014-rev-list-all.sh            | 25 +++++++++++++++++++++++++
 6 files changed, 62 insertions(+), 4 deletions(-)
Signature · 1 line
2.7.2.618.g7a61b68