From: Duy Nguyen Date: Tue, 26 Jul 2016 15:04:12 GMT Subject: Re: [PATCH v4 1/4] worktree: add per-worktree config files Message-ID: In-Reply-To: On Tue, Jul 26, 2016 at 2:59 AM, Stefan Beller wrote: > 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