Re: [PATCH v4 1/4] worktree: add per-worktree config files
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Jul 26, 2016, 15:04 UTC
- Message-ID
- <CACsJy8CUxLG5KL-u6hxCjVaydi=bXZ8Qr8RZwKPW16o_cfWVcA@mail.gmail.com>
- In-Reply-To
- <CAGZ79kYET=z-b+U-JN+H5jkRTGHR0oMdTfUZPMRJx50aH-idbw@mail.gmail.com>
On Tue, Jul 26, 2016 at 2:59 AM, Stefan Beller <sbeller@google.com> wrote:
Show 13 quoted lines
> I like the user facing design, but how am I supposed to use it internally?
>
> Say I want to read a value preferably from the worktree I'd do a
> /*
> * maybe I don't even have to set it to 1 as
> * the user is supposed to do that?
> */
> repository_format_worktree_config = 1;
> git_config_get_{string,bool,int} (... as usual ...)
>
> and if I want to read the value globally I would set the variable to 0
> and read? (I would need to restore it, so I'll have a temporary variable
> to keep the original value of repository_format_worktree_config)I would understand if you need an api to write to worktree config or the shared one. But choosing to _read_ from a specific source sounds wrong. The common rule should apply everywhere: read from worktree first, if not found, read again from shared config. Why do you need this?
-- Duy