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

Re: [PATCH v2 2/2] worktree: add per-worktree config files

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Sep 30, 2018, 04:32 UTC
Message-ID
<CAPig+cSv4P99ZJ=CtCC7HctfSg5W6sadiknhk9yXSaBDZ81ctw@mail.gmail.com>
In-Reply-To
<20180929153005.10599-3-pclouds@gmail.com>
On Sat, Sep 29, 2018 at 11:30 AM Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:
Show 10 quoted lines
> A new repo extension is added, worktreeConfig. When it is present:
> [...]
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
> diff --git a/Documentation/config.txt b/Documentation/config.txt
> @@ -2,8 +2,9 @@ CONFIGURATION FILE
>  The Git configuration file contains a number of variables that affect
> +the Git commands' behavior. The files `.git/config` and optionally
> +`config.worktree` (see `extensions.worktreeConfig` below) in each
> +repository is used to store the configuration for that repository, and
s/is used/are/used/
Show 11 quoted lines
>  `$HOME/.gitconfig` is used to store a per-user configuration as
>  fallback values for the `.git/config` file. The file `/etc/gitconfig`
>  can be used to store a system-wide default configuration.
> diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt
> @@ -204,6 +204,36 @@ working trees, it can be used to identify worktrees. For example if
> +CONFIGURATION FILE
> +------------------
> +In this mode, specific configuration stays in the path pointed by `git
> +rev-parse --git-path config.worktree`. You can add or update
> +configuration in this file with `git config --worktree`. Older Git
> +versions may will refuse to access repositories with this extension.
s/may will/will/
> diff --git a/Documentation/gitrepository-layout.txt b/Documentation/gitrepository-layout.txt
> @@ -275,6 +280,9 @@ worktrees/<id>/locked::
> +worktrees/<id>/config.worktree::
> +       Working directory specific configuration file.

I wonder if this deserves a quick mention in Documentation/git-worktree.txt since other worktree-related files, such as "worktrees/<id>/locked", are mentioned there.

Show 14 quoted lines
> diff --git a/builtin/config.c b/builtin/config.c
> @@ -645,7 +649,20 @@ int cmd_config(int argc, const char **argv, const char *prefix)
> +       else if (use_worktree_config) {
> +               struct worktree **worktrees = get_worktrees(0);
> +               if (repository_format_worktree_config)
> +                       given_config_source.file = git_pathdup("config.worktree");
> +               else if (worktrees[0] && worktrees[1])
> +                       die(_("--worktree cannot be used with multiple "
> +                             "working trees unless the config\n"
> +                             "extension worktreeConfig is enabled. "
> +                             "Please read \"CONFIGURATION FILE\"\n"
> +                             "section in \"git help worktree\" for details"));
> +               else
> +                       given_config_source.file = git_pathdup("config");

I'm not sure I understand the purpose of allowing --worktree when only a single worktree is present and extensions.worktreeConfig is not set. Can you talk about it a bit more?

Previous: Nguyễn Thái Ngọc DuyNext: Duy Nguyen
Message 21 of 34 in “worktree: add per-worktree config files”
  1. worktree: add per-worktree config filesNguyễn Thái Ngọc Duy, Sep 23, 2018
  2. Eric SunshineSep 23, 2018
  3. Taylor BlauSep 24, 2018
  4. Duy NguyenSep 25, 2018
  5. Duy NguyenSep 29, 2018
  6. Junio C HamanoSep 25, 2018
  7. Duy NguyenSep 26, 2018
  8. Junio C HamanoSep 26, 2018
  9. Wherefor worktrees?Marc Branchaud, Sep 27, 2018
  10. Duy NguyenSep 27, 2018
  11. Ævar Arnfjörð BjarmasonSep 26, 2018
  12. Duy NguyenSep 27, 2018
  13. Ævar Arnfjörð BjarmasonSep 27, 2018
  14. Duy NguyenSep 27, 2018
  15. Duy NguyenSep 29, 2018
  16. 0/2 Per-worktree config filesNguyễn Thái Ngọc Duy, Sep 29, 2018
  17. 1/2 t1300: extract and use test_cmp_config()Nguyễn Thái Ngọc Duy, Sep 29, 2018
  18. Eric SunshineSep 30, 2018
  19. SZEDER GáborSep 30, 2018
  20. 2/2 worktree: add per-worktree config filesNguyễn Thái Ngọc Duy, Sep 29, 2018
  21. Eric SunshineSep 30, 2018
  22. Duy NguyenSep 30, 2018
  23. Eric SunshineSep 30, 2018
  24. Duy NguyenSep 30, 2018
  25. 0/2 Per-worktree config filesNguyễn Thái Ngọc Duy, Oct 2, 2018
  26. 1/2 t1300: extract and use test_cmp_config()Nguyễn Thái Ngọc Duy, Oct 2, 2018
  27. Eric SunshineOct 3, 2018
  28. 2/2 worktree: add per-worktree config filesNguyễn Thái Ngọc Duy, Oct 2, 2018
  29. 0/2 Per-worktree config filesNguyễn Thái Ngọc Duy, Oct 21, 2018
  30. 1/2 t1300: extract and use test_cmp_config()Nguyễn Thái Ngọc Duy, Oct 21, 2018
  31. 2/2 worktree: add per-worktree config filesNguyễn Thái Ngọc Duy, Oct 21, 2018
  32. Junio C HamanoOct 22, 2018
  33. Duy NguyenOct 22, 2018
  34. Junio C HamanoOct 25, 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.