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

Re: [PATCH 5/6] worktree move: refuse to move worktrees with submodules

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 21, 2017, 02:47 UTC
Message-ID
<xmqqvapy5vdy.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170420101024.7593-6-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:
Show 6 quoted lines
> Submodules contains .git files with relative paths. After a worktree
> move, these files need to be updated or they may point to nowhere.
>
> This is a bandage patch to make sure "worktree move" don't break
> people's worktrees by accident. When .git file update code is in
> place, this validate_no_submodules() could be removed.

Right. I am OK with "small steps first" approach like this. We'd need to document the limitation, though, i.e. "Note that you cannot move the primary working tree. Also you cannot move a working tree that has a submodule."

Again drop "yet" from the error message. Our aspiration does not ease the pain the end users get when they are given the error message.

Previous: Nguyễn Thái Ngọc DuyNext: Nguyễn Thái Ngọc Duy
Message 12 of 15 in “nd/worktree-move update”
  1. 0/6 nd/worktree-move updateNguyễn Thái Ngọc Duy, Apr 20, 2017
  2. 1/6 worktree.c: add validate_worktree()Nguyễn Thái Ngọc Duy, Apr 20, 2017
  3. Junio C HamanoApr 21, 2017
  4. Duy NguyenApr 24, 2017
  5. 2/6 worktree.c: add update_worktree_location()Nguyễn Thái Ngọc Duy, Apr 20, 2017
  6. Junio C HamanoApr 21, 2017
  7. 3/6 worktree move: new commandNguyễn Thái Ngọc Duy, Apr 20, 2017
  8. Junio C HamanoApr 21, 2017
  9. 4/6 worktree move: accept destination as directoryNguyễn Thái Ngọc Duy, Apr 20, 2017
  10. Junio C HamanoApr 21, 2017
  11. 5/6 worktree move: refuse to move worktrees with submodulesNguyễn Thái Ngọc Duy, Apr 20, 2017
  12. Junio C HamanoApr 21, 2017
  13. 6/6 worktree remove: new commandNguyễn Thái Ngọc Duy, Apr 20, 2017
  14. Junio C HamanoApr 21, 2017
  15. Jeff KingApr 21, 2017

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.