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

[PATCH v2 0/1] Some left-over add-on for bw/config-h

From
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
Date
Nov 14, 2018, 13:59 UTC
Message-ID
<pull.78.v2.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.78.git.gitgitgadget@gmail.com>

Back when bw/config-h was developed (and backported to Git for Windows), I came up with a patch to use git_dir if commondir is NULL, and contributed that as v1 of this patch. However, it was deemed a bug if that happens, so let's instead detect that condition and report it.

Change since v1:
 * Be loud about this bug instead of papering over it.
Johannes Schindelin (1):
  config: report a bug if git_dir exists without commondir
 config.c | 2 ++
 1 file changed, 2 insertions(+)
base-commit: 8858448bb49332d353febc078ce4a3abcc962efe
Published-As: https://github.com/gitgitgadget/git/releases/tags/pr-78%2Fdscho%2Fbw%2Fconfig-h-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-78/dscho/bw/config-h-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/78
Range-diff vs v1:
 1:  a3854e4ed8 ! 1:  0767f98378 do_git_config_sequence(): fall back to git_dir if commondir is NULL
     @@ -1,8 +1,9 @@
      Author: Johannes Schindelin <johannes.schindelin@gmx.de>
      
     -    do_git_config_sequence(): fall back to git_dir if commondir is NULL
     +    config: report a bug if git_dir exists without commondir
      
     -    Just some defensive programming.
     +    This did happen at some stage, and was fixed relatively quickly. Make
     +    sure that we detect very quickly, too, should that happen again.
      
          Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
      
     @@ -14,7 +15,7 @@
       	if (opts->commondir)
       		repo_config = mkpathdup("%s/config", opts->commondir);
      +	else if (opts->git_dir)
     -+		repo_config = mkpathdup("%s/config", opts->git_dir);
     ++		BUG("git_dir without commondir");
       	else
       		repo_config = NULL;
       
-- 
gitgitgadget
Previous: Jeff KingNext: Johannes Schindelin via GitGitGadget
Message 5 of 7 in “Some left-over add-on for bw/config-h”
  1. 0/1 Some left-over add-on for bw/config-hJohannes Schindelin via GitGitGadget, Nov 13, 2018
  2. 1/1 do_git_config_sequence(): fall back to git_dir if commondir is NULLJohannes Schindelin via GitGitGadget, Nov 13, 2018
  3. Junio C HamanoNov 14, 2018
  4. Jeff KingNov 14, 2018
  5. 0/1 Some left-over add-on for bw/config-hJohannes Schindelin via GitGitGadget, Nov 14, 2018
  6. 1/1 config: report a bug if git_dir exists without commondirJohannes Schindelin via GitGitGadget, Nov 14, 2018
  7. Jeff KingNov 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.