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

[PATCH v5 0/2] Worktree: for-each function and list command

From
Michael Rappazzo <rappazzo@gmail.com>
Date
Aug 22, 2015, 21:51 UTC
Message-ID
<1440280294-50679-1-git-send-email-rappazzo@gmail.com>
Changes since v4:
 - reduced memory usage by reusing string buffer variables
 - re-scoped variables in the for-each function
 - added tests for 'worktree list' with bare repos
Notes from previous discussion:
 - The following snippet:
> +	/* If the common_dir DOES NOT end with '/.git', then it is bare */
> +	main_is_bare = !strbuf_strip_suffix(&worktree_path, "/.git");

This code is run when the current dir is in a linked worktree (not the primary worktree). In that context, the git config _does_ report that 'core.bare' is true when the primary repo is bare, however `is_bare_repository()` returns false. The worktree_path also needs to the "/.git" removed from it. Therefore, I opted to keep the code like this.

Michael Rappazzo (2):
  worktree: add 'for_each_worktree' function
  worktree: add 'list' command
 Documentation/git-worktree.txt |  11 +++-
 builtin/worktree.c             | 138 +++++++++++++++++++++++++++++++++++++++++
 t/t2027-worktree-list.sh       |  81 ++++++++++++++++++++++++
 3 files changed, 229 insertions(+), 1 deletion(-)
 create mode 100755 t/t2027-worktree-list.sh
-- 
2.5.0
Next: Michael Rappazzo
Message 1 of 6 in “Worktree: for-each function and list command”
  1. 0/2 Worktree: for-each function and list commandMichael Rappazzo, Aug 22, 2015
  2. 1/2 worktree: add 'for_each_worktree' functionMichael Rappazzo, Aug 22, 2015
  3. 2/2 worktree: add 'list' commandMichael Rappazzo, Aug 22, 2015
  4. Junio C HamanoAug 24, 2015
  5. Eric SunshineAug 25, 2015
  6. Mikael MagnussonAug 25, 2015

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.