Re: [PATCH] nmbug: mark repository as bare on clone

Subject: Re: [PATCH] nmbug: mark repository as bare on clone

Date: Tue, 15 Apr 2014 10:23:19 -0700

To: David Bremner

Cc: notmuch@notmuchmail.org

From: W. Trevor King


On Sat, Apr 12, 2014 at 01:30:32PM -0300, David Bremner wrote:
> As far as I can figure out, if a git repository is non-bare, then it
> should either have core.worktree set, or the parent directory should
> be the worktree.

If this works in your testing, then +1 from me ;).  However, the
default is the current working directory, not the repo's parent
directory [1]:

  core.worktree
    …
    If --git-dir or GIT_DIR is specified but none of --work-tree,
    GIT_WORK_TREE and core.worktree is specified, the current working
    directory is regarded as the top level of your working tree.

> % cd $HOME && ln -s .nmbug .git && git reset --hard
> 
> would delete a bunch of files.

Actually, that would just clobber existing ~/tags/{message-id}/{tag}
files, which the user likely doesn't have.  To remove files, you'd
need something like:

  $ cd $HOME && ln -s .nmbug .git && git clean -f

Still, these are just quibbles with the commit message.  I'm +1 on the
code change.  My initial bare-resistance [2] was because I didn't
realize that an explicit GIT_WORK_TREE would override the core.bare
setting.

Cheers,
Trevor

[1]: https://www.kernel.org/pub/software/scm/git/docs/git-config.html
[2]: http://article.gmane.org/gmane.mail.notmuch.general/17817

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy
signature.asc (application/pgp-signature)

Thread: