git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Duy Nguyen <pclouds@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>,
	Michael J Gruber <git@drmicha.warpmail.net>,
	Max Nordlund <max.nordlund@sqore.com>
Subject: Re: [PATCH 2/3] t0001: work around the bug that reads config file before repo setup
Date: Fri, 9 Sep 2016 07:22:18 -0400	[thread overview]
Message-ID: <20160909112217.gfalcbtiy2tzzhm5@sigill.intra.peff.net> (raw)
In-Reply-To: <CACsJy8DmbdGODY+qT38OSkaegSpdO7yAt6e67sHB=_BT8Y7=_Q@mail.gmail.com>

On Fri, Sep 09, 2016 at 05:32:21PM +0700, Duy Nguyen wrote:

> On Fri, Sep 9, 2016 at 3:02 AM, Jeff King <peff@peff.net> wrote:
> > On Thu, Sep 08, 2016 at 08:47:18PM +0700, Nguyễn Thái Ngọc Duy wrote:
> >
> >> git-init somehow reads '.git/config' at current directory and sets
> >> log_all_ref_updates based on this file. Because log_all_ref_updates is
> >> not unspecified (-1) any more. It will not be written to the new repo's
> >> config file (see create_default_files() function).
> >>
> >> This will affect our tests in the next patch as we will compare the
> >> config file and expect that core.logallrefupdates is already set to true
> >> by "git init main-worktree".
> >
> > This is a bug for more than worktrees, and is something I'm working on
> > fixing
> 
> Great! test_expect_failure it is. But I'll make a separate patch,
> independent from this series though.

If you're curious what the fix looks like, it's in:

  https://github.com/peff/git jk/config-repo-setup

The actual fix is in the final patch, but it needed a lot of preparatory
work to avoid breaking various programs that made bad assumptions (and
in the process, I uncovered a ton of other minor bugs).

This is just a preview in case you're interested, for two reasons:

  1. I literally _just_ put the finishing touches on it, and it's
     extensive and tricky enough that I really should give it one more
     proofread.

  2. There may be other related fallouts from the bug related to running
     "git init /path/to/foo" when "/path/to/foo" already exists (and in
     that case we _do_ want to read its config, but not the config from
     an existing repository). This may all just work fine, but I need to
     think about some tests.

-Peff

  reply	other threads:[~2016-09-09 11:22 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-23 12:35 Bug with git worktrees and git init Max Nordlund
2016-08-23 15:21 ` Michael J Gruber
2016-08-24  9:35   ` Duy Nguyen
2016-09-08 13:47     ` [PATCH 0/3] Fix git-init in linked worktrees Nguyễn Thái Ngọc Duy
2016-09-08 13:47       ` [PATCH 1/3] init: correct re-initialization from a linked worktree Nguyễn Thái Ngọc Duy
2016-09-08 19:37         ` Junio C Hamano
2016-09-09 10:36           ` Duy Nguyen
2016-09-08 13:47       ` [PATCH 2/3] t0001: work around the bug that reads config file before repo setup Nguyễn Thái Ngọc Duy
2016-09-08 19:44         ` Junio C Hamano
2016-09-08 20:02         ` Jeff King
2016-09-09 10:32           ` Duy Nguyen
2016-09-09 11:22             ` Jeff King [this message]
2016-09-09 17:45               ` Jacob Keller
2016-09-08 13:47       ` [PATCH 3/3] init: do not set core.worktree more often than necessary Nguyễn Thái Ngọc Duy
2016-09-08 19:54         ` Junio C Hamano
2016-09-09 10:33           ` Duy Nguyen
2016-09-21 11:29       ` [PATCH v2 0/3] Fix git-init in linked worktrees Nguyễn Thái Ngọc Duy
2016-09-21 11:29         ` [PATCH v2 1/3] init: correct re-initialization from a linked worktree Nguyễn Thái Ngọc Duy
2016-09-21 11:29         ` [PATCH v2 2/3] init: do not set core.worktree more often than necessary Nguyễn Thái Ngọc Duy
2016-09-21 18:44           ` Junio C Hamano
2016-09-22 10:06             ` Duy Nguyen
2016-09-22 17:27               ` Junio C Hamano
2016-09-23 11:12                 ` [PATCH v2 4/3] init: combine set_git_dir_init() and init_db() into one Nguyễn Thái Ngọc Duy
2016-09-23 15:18                   ` Junio C Hamano
2016-09-23 22:53                   ` Junio C Hamano
2016-09-24 18:55                     ` Junio C Hamano
2016-09-25  3:13                       ` Duy Nguyen
2016-09-25  3:14                         ` [PATCH v3 1/5] init: correct re-initialization from a linked worktree Nguyễn Thái Ngọc Duy
2016-09-25  3:14                           ` [PATCH v3 2/5] init: call set_git_dir_init() from within init_db() Nguyễn Thái Ngọc Duy
2016-09-25  3:14                           ` [PATCH v3 3/5] init: kill set_git_dir_init() Nguyễn Thái Ngọc Duy
2016-09-25  3:14                           ` [PATCH v3 4/5] init: do not set unnecessary core.worktree Nguyễn Thái Ngọc Duy
2016-09-25  3:14                           ` [PATCH v3 5/5] init: kill git_link variable Nguyễn Thái Ngọc Duy
2016-09-21 11:29         ` [PATCH v2 3/3] init: reuse original_git_dir in set_git_dir_init() Nguyễn Thái Ngọc Duy
2016-09-21 18:18         ` [PATCH v2 0/3] Fix git-init in linked worktrees Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160909112217.gfalcbtiy2tzzhm5@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=max.nordlund@sqore.com \
    --cc=pclouds@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).