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

Re: [PATCHv6 4/7] worktree: get worktrees from submodules

From
Duy Nguyen <pclouds@gmail.com>
Date
Dec 9, 2016, 12:46 UTC
Message-ID
<CACsJy8BoPXDYZqqDOSZR-msNjuZgGzFL_mF2xQVsg82jUfdXmw@mail.gmail.com>
In-Reply-To
<CAGZ79kYtEUvuTX09sJm3C0rG0-BrBz4bN0FCs6E5d2jHhtKN6w@mail.gmail.com>
On Fri, Dec 9, 2016 at 1:55 AM, Stefan Beller <sbeller@google.com> wrote:
Show 16 quoted lines
> On Thu, Dec 8, 2016 at 2:09 AM, Duy Nguyen <pclouds@gmail.com> wrote:
>> On Thu, Dec 8, 2016 at 8:46 AM, Stefan Beller <sbeller@google.com> wrote:
>>>
>>>         worktree = xcalloc(1, sizeof(*worktree));
>>>         worktree->path = strbuf_detach(&worktree_path, NULL);
>>> @@ -101,7 +101,8 @@ static struct worktree *get_main_worktree(void)
>>
>> All the good stuff is outside context lines again.. Somewhere between
>> here we call add_head_info() which calls resolve_ref_unsafe(), which
>> always uses data from current repo, not the submodule we want it to
>> look at.
>
> Unrelated side question: What would you think of "variable context line
> configuration" ? e.g. you could configure it to include anything from
> up that line
> that is currently shown after the @@ which is the function signature line.

Hmm.. no idea. I once dreamt of writing "Diff-Options: -U10" in the commit message and let git-log and everybody use that option automatically, though. I guess it's unrelated to your question :D

Show 9 quoted lines
> As to the add_head_info/resolve_ref_unsafe what impact does that have?
> It produces a wrong head info but AFAICT it will never die(), such that for the
> purposes of this series (which only wants to know if a submodule uses the
> worktree feature) it should be fine.
>
> It is highly misleading though for others to build upon this.
> So maybe I'll only add the functionality internally in worktree.c
> and document why the values are wrong, and only expose the
> "int submodule_uses_worktrees(const char *path)" ?

Yeah for submodule use then it should be ok. But people may start using it for something else, not realizing that it does not work as expected.

-- 
Duy
Previous: Stefan BellerNext: Brandon Williams
Message 10 of 20 in “[PATCHv6 0/7] submodule embedgitdirs”
  1. Stefan BellerDec 8, 2016
  2. 1/7 submodule: use absolute path for computing relative path connectingStefan Beller, Dec 8, 2016
  3. Duy NguyenDec 8, 2016
  4. 2/7 submodule helper: support super prefixStefan Beller, Dec 8, 2016
  5. Duy NguyenDec 8, 2016
  6. Stefan BellerDec 8, 2016
  7. 4/7 worktree: get worktrees from submodulesStefan Beller, Dec 8, 2016
  8. Duy NguyenDec 8, 2016
  9. Stefan BellerDec 8, 2016
  10. Duy NguyenDec 9, 2016
  11. Brandon WilliamsDec 9, 2016
  12. Stefan BellerDec 9, 2016
  13. 7/7 submodule: add absorb-git-dir functionStefan Beller, Dec 8, 2016
  14. Duy NguyenDec 8, 2016
  15. 5/7 worktree: add function to check if worktrees are in useStefan Beller, Dec 8, 2016
  16. Duy NguyenDec 8, 2016
  17. Duy NguyenDec 8, 2016
  18. Stefan BellerDec 8, 2016
  19. 3/7 test-lib-functions.sh: teach test_commit -C <dir>Stefan Beller, Dec 8, 2016
  20. 6/7 move connect_work_tree_and_git_dir to dir.hStefan Beller, Dec 8, 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.