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

Re: [PATCH v2 2/6] worktree: stop supporting moving worktrees manually

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Jan 18, 2016, 18:24 UTC
Message-ID
<CAPig+cThX3vj8KOLf9CB6bqp-stDrwWs_mddW68YkAVrjzhA+Q@mail.gmail.com>
In-Reply-To
<1453116094-4987-3-git-send-email-pclouds@gmail.com>
On Mon, Jan 18, 2016 at 6:21 AM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:
Show 21 quoted lines
> The current update_linked_gitdir() has a bug that can create "gitdir"
> file in non-multi-worktree setup. Worse, sometimes it can write relative
> path to "gitdir" file, which will not work (e.g. "git worktree list"
> will display the worktree's location incorrectly)
>
> Instead of fixing this, we step back a bit. The original design was
> probably not well thought out. For now, if the user manually moves a
> worktree, they have to fix up "gitdir" file manually or the worktree
> will get pruned.
>
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
> diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt
> @@ -33,10 +33,8 @@ The working tree's administrative files in the repository (see
>  If you move a linked working tree to another file system, or
> -within a file system that does not support hard links, you need to run
> -at least one git command inside the linked working tree
> -(e.g. `git status`) in order to update its administrative files in the
> -repository so that they do not get automatically pruned.
> +within a file system that does not support hard links, you need to update
> +$GIT_DIR/worktrees/<id>/gitdir so that they do not get automatically pruned.

It seems kind of sad to change this text in this patch and then immediately change it again in the next patch. You could instead combine the two patches (and add a "Helped-by: Eric" if you want to credit me).

Previous: Nguyễn Thái Ngọc DuyNext: Nguyễn Thái Ngọc Duy
Message 4 of 15 in “Kill and replace update_linked_gitdir()”
  1. 0/6 Kill and replace update_linked_gitdir()Nguyễn Thái Ngọc Duy, Jan 18, 2016
  2. 1/6 worktree.c: fix indentationNguyễn Thái Ngọc Duy, Jan 18, 2016
  3. 2/6 worktree: stop supporting moving worktrees manuallyNguyễn Thái Ngọc Duy, Jan 18, 2016
  4. Eric SunshineJan 18, 2016
  5. 3/6 worktree.txt: how to fix up after moving a worktreeNguyễn Thái Ngọc Duy, Jan 18, 2016
  6. Eric SunshineJan 18, 2016
  7. Duy NguyenJan 19, 2016
  8. 4/6 abspath.c: add and use real_path_dup()Nguyễn Thái Ngọc Duy, Jan 18, 2016
  9. 5/6 setup.c: record the location of .git fileNguyễn Thái Ngọc Duy, Jan 18, 2016
  10. 6/6 worktree: new command to fix up worktree's info after movingNguyễn Thái Ngọc Duy, Jan 18, 2016
  11. Philip OakleyJan 18, 2016
  12. Junio C HamanoJan 19, 2016
  13. 0/2 Kill and replace update_linked_gitdir()Nguyễn Thái Ngọc Duy, Jan 22, 2016
  14. 1/2 worktree.c: fix indentationNguyễn Thái Ngọc Duy, Jan 22, 2016
  15. 2/2 worktree: stop supporting moving worktrees manuallyNguyễn Thái Ngọc Duy, Jan 22, 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.