git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 6/6] revisions: list all worktree HEADs with --all

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Feb 26, 2016, 16:39 UTC
Message-ID
<99338f7eca7172a2e168c1ac2cfdb0ffc84f8a28.1456504190.git.git@drmicha.warpmail.net>
In-Reply-To
<cover.1456504190.git.git@drmicha.warpmail.net>
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
Notes:
    Note that ever since
    f0298cf (revision walker: include a detached HEAD in --all, 2009-01-16)
    the documentation failed to mention the inclusion of HEAD with "--all".
 Documentation/rev-list-options.txt | 2 +-
 refs/files-backend.c               | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt
index 4f009d4..fe37956 100644
--- a/Documentation/rev-list-options.txt
+++ b/Documentation/rev-list-options.txt
@@ -134,7 +134,7 @@ parents) and `--max-parents=-1` (negative numbers denote no upper limit).
 
 --all::
 	Pretend as if all the refs in `refs/` are listed on the
-	command line as '<commit>'.
+	command line as '<commit>', as well as the HEADs of all worktrees.
 
 --branches[=<pattern>]::
 	Pretend as if all the refs in `refs/heads` are listed
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 1614854..e717db0 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -1802,7 +1802,7 @@ int head_ref_worktrees(each_ref_fn fn, void *cb_data)
 
 int head_ref_submodule(const char *submodule, each_ref_fn fn, void *cb_data)
 {
-	return do_head_ref(submodule, fn, cb_data);
+	return do_head_ref_worktrees(submodule, fn, cb_data);
 }
 
 int for_each_ref(each_ref_fn fn, void *cb_data)
-- 
2.7.2.618.g7a61b68
Previous: Michael J GruberNext: Junio C Hamano
Message 10 of 11 in “Detached HEADs in new worktrees considered harmful”
  1. 0/6 Detached HEADs in new worktrees considered harmfulMichael J Gruber, Feb 26, 2016
  2. 1/6 Documentation/git-worktree: spell --detach correctlyMichael J Gruber, Feb 26, 2016
  3. Junio C HamanoFeb 26, 2016
  4. 2/6 t6014: test prune with detached HEADs in separate worktreesMichael J Gruber, Feb 26, 2016
  5. Junio C HamanoFeb 26, 2016
  6. 3/6 rev-list: list all heads with --allMichael J Gruber, Feb 26, 2016
  7. Duy NguyenFeb 27, 2016
  8. 4/6 WIP: mess only with mark_reachableMichael J Gruber, Feb 26, 2016
  9. 5/6 WIP: fix unborn branch caseMichael J Gruber, Feb 26, 2016
  10. 6/6 revisions: list all worktree HEADs with --allMichael J Gruber, Feb 26, 2016
  11. Junio C HamanoFeb 26, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.