unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: "W. Trevor King" <wking@tremily.us>
To: notmuch@notmuchmail.org
Cc: Daniel Kahn Gillmor <dkg@fifthhorseman.net>,
	David Bremner <david@tethera.net>,
	"W. Trevor King" <wking@tremily.us>
Subject: [PATCH 2/4] nmbug: Accept failures to unset core.worktree in clone
Date: Tue, 10 Oct 2017 15:49:50 -0700	[thread overview]
Message-ID: <db22a2d2f7c0d9378d390fd7efef3e2a9e1b1bf0.1507675236.git.wking@tremily.us> (raw)
In-Reply-To: <cover.1507675236.git.wking@tremily.us>
In-Reply-To: <cover.1507675236.git.wking@tremily.us>

Since 6311cfaf (init: do not set unnecessary core.worktree,
2016-09-25, 2.11.0 [1]), Git has no longer set core.worktree when
--separate-git-dir is used.  This broke clone with:

  $ nmbug clone http://nmbug.notmuchmail.org/git/nmbug-tags.git
  Cloning into '/tmp/nmbug-clone.33gg442e'...
  Checking connectivity: 16674, done.
  ['git', '--git-dir', '/home/wking/.nmbug', 'config', '--unset', 'core.worktree'] exited with 5
  $ echo $?
  1

The initial discussion that lead to the Git change is in [2], and
there is some more discussion around this specific change in [3].
There is some useful background on working trees in this 2009 message
[4].  There is also a git-worktree(1) since df0b6cfb (worktree: new
place for "git prune --worktrees", 2015-06-29, 2.5.0 [5]) which grew
the ability to add new worktrees in 799767cc (Merge branch
'es/worktree-add', 2015-07-13, 2.5.0 [6]).  Folks relying on
core.worktree in the --separate-git-dir case fall into the "former
case" in [4], and as Junio pointed out in that message, Git
operations like 'add' don't really work there.

In nmbug we don't want core.worktree, because our effective working
tree is the notmuch database.  By accepting failed core.worktree
unsets, clone will work with Gits older and younger than 2.11.0.

[1]: https://github.com/git/git/commit/6311cfaf93716bcc43dd1151cb1763e3f80d8099
[2]: https://public-inbox.org/git/CALqjkKZO_y0DNcRJjooyZ7Eso7yBMGhvZ6fE92oO4Su7JeCeng@mail.gmail.com/
[3]: https://public-inbox.org/git/87h94d8cwi.fsf@kyleam.com/
[4]: https://public-inbox.org/git/7viqbsw2vn.fsf@alter.siamese.dyndns.org/
[5]: https://github.com/git/git/commit/df0b6cfbda88144714541664fb501146d6465a82
[6]: https://github.com/git/git/commit/799767cc98b2f8e6f82d0de4bef9b5e8fcc16e97

Reported-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
---
 devel/nmbug/nmbug | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/devel/nmbug/nmbug b/devel/nmbug/nmbug
index 755bd7db..c0e7c3c6 100755
--- a/devel/nmbug/nmbug
+++ b/devel/nmbug/nmbug
@@ -308,7 +308,7 @@ def clone(repository):
                 'git', 'clone', '--no-checkout', '--separate-git-dir', NMBGIT,
                 repository, workdir],
             wait=True)
-    _git(args=['config', '--unset', 'core.worktree'], wait=True)
+    _git(args=['config', '--unset', 'core.worktree'], wait=True, expect=(0, 5))
     _git(args=['config', 'core.bare', 'true'], wait=True)
     _git(args=['branch', 'config', 'origin/config'], wait=True)
 
-- 
2.13.6

  parent reply	other threads:[~2017-10-10 22:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-10 22:49 [PATCH 0/3] nmbug: W. Trevor King
2017-10-10 22:49 ` [PATCH 1/4] nmbug: Respect 'expect' in _spawn(..., wait=True) W. Trevor King
2017-10-10 22:49 ` W. Trevor King [this message]
2017-10-10 22:49 ` [PATCH 3/4] nmbug: Auto-checkout in clone if it wouldn't clobber W. Trevor King
2017-12-11 13:10   ` David Bremner
2017-12-11 17:47     ` W. Trevor King
2017-12-11 20:51       ` David Bremner
2017-10-10 23:15 ` [PATCH 0/3] nmbug: Daniel Kahn Gillmor
2017-10-14 12:51 ` Jani Nikula
2017-10-16 17:05   ` [PATCH 0/3] nmbug: clone core.worktree and auto-checkout (was: [PATCH 0/3] nmbug:) W. Trevor King

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: https://notmuchmail.org/

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

  git send-email \
    --in-reply-to=db22a2d2f7c0d9378d390fd7efef3e2a9e1b1bf0.1507675236.git.wking@tremily.us \
    --to=wking@tremily.us \
    --cc=david@tethera.net \
    --cc=dkg@fifthhorseman.net \
    --cc=notmuch@notmuchmail.org \
    /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://yhetil.org/notmuch.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).