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

Re: [PATCH 6/7] submodule--helper: replace connect-gitdir-workingtree by ensure-core-worktree

From
BWBrandon Williams <bmwill@google.com>
Date
Aug 10, 2018, 22:02 UTC
Message-ID
<20180810220251.GC211322@google.com>
In-Reply-To
<CAGZ79kb+QyCuBw+e8ShU3Ts9GL+bhzb=i2F+5B0jb9eWk5Sj1w@mail.gmail.com>
On 08/10, Stefan Beller wrote:
Show 12 quoted lines
> > > +             cfg_file = xstrfmt("%s/config", subrepo.gitdir);
> >
> > As I mentioned here:
> > https://public-inbox.org/git/20180807230637.247200-1-bmwill@google.com/T/#t
> >
> > This lines should probably be more like:
> >
> >   cfg_file = repo_git_path(&subrepo, "config");
> >
> 
> Why? You did not mention the benefits for writing it this way
> here or on the reference. Care to elaborate?

Its more future proof especially because we have the difference bettwen commondir and gitdir for worktrees. Using the "repo_git_path" function handles path rewritting when using worktrees. Here (when working with worktrees) "subrepo.gitdir" refers to the worktree specific gitdir while "subrepo.commondir" refers to the global common gitdir where the repository config actually lives.

-- 
Brandon Williams
Previous: Stefan BellerNext: Stefan Beller
Message 10 of 24 in “Resend of sb/submodule-update-in-c”
  1. 0/7 Resend of sb/submodule-update-in-cStefan Beller, Aug 3, 2018
  2. 2/7 git-submodule.sh: rename unused variablesStefan Beller, Aug 3, 2018
  3. 1/7 git-submodule.sh: align error reporting for update mode to use pathStefan Beller, Aug 3, 2018
  4. 3/7 builtin/submodule--helper: factor out submodule updatingStefan Beller, Aug 3, 2018
  5. 4/7 builtin/submodule--helper: store update_clone information in a structStefan Beller, Aug 3, 2018
  6. 5/7 builtin/submodule--helper: factor out method to update a single submoduleStefan Beller, Aug 3, 2018
  7. 6/7 submodule--helper: replace connect-gitdir-workingtree by ensure-core-worktreeStefan Beller, Aug 3, 2018
  8. Brandon WilliamsAug 10, 2018
  9. Stefan BellerAug 10, 2018
  10. Brandon WilliamsAug 10, 2018
  11. 7/7 submodule--helper: introduce new update-module-mode helperStefan Beller, Aug 3, 2018
  12. Junio C HamanoAug 3, 2018
  13. 0/7 Resend of sb/submodule-update-in-cStefan Beller, Aug 13, 2018
  14. 1/7 git-submodule.sh: align error reporting for update mode to use pathStefan Beller, Aug 13, 2018
  15. 2/7 git-submodule.sh: rename unused variablesStefan Beller, Aug 13, 2018
  16. 3/7 builtin/submodule--helper: factor out submodule updatingStefan Beller, Aug 13, 2018
  17. 4/7 builtin/submodule--helper: store update_clone information in a structStefan Beller, Aug 13, 2018
  18. 5/7 builtin/submodule--helper: factor out method to update a single submoduleStefan Beller, Aug 13, 2018
  19. 6/7 submodule--helper: replace connect-gitdir-workingtree by ensure-core-worktreeStefan Beller, Aug 13, 2018
  20. 7/7 submodule--helper: introduce new update-module-mode helperStefan Beller, Aug 13, 2018
  21. Duy NguyenAug 18, 2018
  22. Stefan BellerAug 20, 2018
  23. Junio C HamanoAug 14, 2018
  24. Stefan BellerAug 14, 2018

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.