[PATCH 4/4] nmbug: Add an 'init' command

2014-09-15 Thread David Bremner
"W. Trevor King"  writes:

>
> Give it a spin to kick the tires, and reply to the v4 patch saying
> that none of the pieces fell off while you were kicking it ;).
> Basically, it's just waiting for review and a consensus that it's a
> solid change.

v3 crashed when merging quite often for me. I'm sortof waiting to see if
it happens again with v4, at which point I guess I'll send my repo by
carrier pigeon to Trevor.

Unfortunately there hasn't been enough nmbug activity to trigger the
bug, so get reviewing patches everyone ;).

d


[PATCH 4/4] nmbug: Add an 'init' command

2014-09-15 Thread David Edmondson
On Mon, Sep 15 2014, W. Trevor King wrote:
> On Mon, Sep 15, 2014 at 05:13:50PM +0100, David Edmondson wrote:
>> On Sun, Jul 06 2014, W. Trevor King wrote:
>> > For folks that want to start versioning a new tag-space, instead
>> > of cloning one that someone else has already started.
>> 
>> I tried this patch, and it (appeared) to work for me. Given that the
>> procedure for creating a new tag repository is arcane, could this
>> patch (or a version of it) be pushed?
>
> Rewriting this patch is the first thing on my list after nmbug's
> Python translation lands [1].

What is required to make that happen?


[PATCH 4/4] nmbug: Add an 'init' command

2014-09-15 Thread David Edmondson
On Sun, Jul 06 2014, W. Trevor King wrote:
> For folks that want to start versioning a new tag-space, instead of
> cloning one that someone else has already started.

I tried this patch, and it (appeared) to work for me. Given that the
procedure for creating a new tag repository is arcane, could this patch
(or a version of it) be pushed?

> The empty-blob hash-object call avoids errors like:
>
>   $ nmbug commit
>   error: invalid object 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 for 
> 'tags/...'
>   fatal: git-write-tree: error building trees
>   'git HASH(0x9ef3eb8) write-tree' exited with nonzero value
> ---
>  devel/nmbug/nmbug | 19 +++
>  1 file changed, 19 insertions(+)
>
> diff --git a/devel/nmbug/nmbug b/devel/nmbug/nmbug
> index c9ac046..b64dab9 100755
> --- a/devel/nmbug/nmbug
> +++ b/devel/nmbug/nmbug
> @@ -30,6 +30,7 @@ my %command = (
>commit => \_commit,
>fetch  => \_fetch,
>help   => \_help,
> +  init   => \_init,
>log=> \_log,
>merge  => \_merge,
>pull   => \_pull,
> @@ -152,6 +153,18 @@ sub do_clone {
>git ('config', 'core.bare', 'true');
>  }
>  
> +sub do_init {
> +  my $tempwork = tempdir ('/tmp/nmbug-init.XX', CLEANUP => 1);
> +  system ('git', 'init', '--separate-git-dir', $NMBGIT, $tempwork) == 0
> +or die "'git init' exited with nonzero value\n";
> +  git ('config', '--unset', 'core.worktree');
> +  git ('config', 'core.bare', 'true');
> +  # create an empty blob (e69de29bb2d1d6434b8b29ae775ad8c2e48c5391)
> +  git ('hash-object', '-w', '--stdin');
> +  git ( { GIT_WORK_TREE => $tempwork }, 'commit', '--allow-empty',
> +'-m', 'Start a new nmbug repository' );
> +}
> +
>  sub is_committed {
>my $status = shift;
>return scalar (@{$status->{added}} ) + scalar (@{$status->{deleted}} ) == 
> 0;
> @@ -610,6 +623,12 @@ Create a local nmbug repository from a remote source.  
> This wraps
>  C, adding some options to avoid creating a working tree
>  while preserving remote-tracking branches and upstreams.
>  
> +=item B
> +
> +Create a local nmbug repository from scratch.  This wraps C
> +and performs other setup to support subsequent status and commit
> +commands.
> +
>  =item B
>  
>  Update the notmuch database from git. This is mainly useful to discard
> -- 
> 1.9.1.353.gc66d89d


[PATCH 4/4] nmbug: Add an 'init' command

2014-09-15 Thread W. Trevor King
On Mon, Sep 15, 2014 at 08:09:11PM +0200, David Bremner wrote:
> W. Trevor King writes:
> > Give it a spin to kick the tires, and reply to the v4 patch saying
> > that none of the pieces fell off while you were kicking it ;).
> > Basically, it's just waiting for review and a consensus that it's
> > a solid change.
> 
> v3 crashed when merging quite often for me.

I didn't actually change anything there, because I was unable to
reproduce the crash (as I point out in my v4 message, ?I've also left
off the merge/pull checkouts, since I haven't been able to reproduce
David's error locally?? [1]).  Any advice on reproducing the merge
errors would be helpful :).

Cheers,
Trevor

[1]: id:e630b6763e9d0771718afee41ea15b29bb4a1de8.1409935538.git.wking at 
tremily.us
 http://article.gmane.org/gmane.mail.notmuch.general/19007

-- 
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
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: 



[PATCH 4/4] nmbug: Add an 'init' command

2014-09-15 Thread W. Trevor King
On Mon, Sep 15, 2014 at 05:32:59PM +0100, David Edmondson wrote:
> On Mon, Sep 15 2014, W. Trevor King wrote:
> > On Mon, Sep 15, 2014 at 05:13:50PM +0100, David Edmondson wrote:
> >> On Sun, Jul 06 2014, W. Trevor King wrote:
> >> > For folks that want to start versioning a new tag-space, instead
> >> > of cloning one that someone else has already started.
> >> 
> >> I tried this patch, and it (appeared) to work for me. Given that the
> >> procedure for creating a new tag repository is arcane, could this
> >> patch (or a version of it) be pushed?
> >
> > Rewriting this patch is the first thing on my list after nmbug's
> > Python translation lands [1].
> 
> What is required to make that happen?

Give it a spin to kick the tires, and reply to the v4 patch saying
that none of the pieces fell off while you were kicking it ;).
Basically, it's just waiting for review and a consensus that it's a
solid change.

Cheers,
Trevor

-- 
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
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: 



[PATCH 4/4] nmbug: Add an 'init' command

2014-09-15 Thread W. Trevor King
On Mon, Sep 15, 2014 at 05:13:50PM +0100, David Edmondson wrote:
> On Sun, Jul 06 2014, W. Trevor King wrote:
> > For folks that want to start versioning a new tag-space, instead
> > of cloning one that someone else has already started.
> 
> I tried this patch, and it (appeared) to work for me. Given that the
> procedure for creating a new tag repository is arcane, could this
> patch (or a version of it) be pushed?

Rewriting this patch is the first thing on my list after nmbug's
Python translation lands [1].  Interestingly, there have been versions
of 'nmbug init' kicking around in the wings for some time [2].

Cheers,
Trevor

[1]: 
id:e630b6763e9d0771718afee41ea15b29bb4a1de8.1409935538.git.wking%40tremily.us
 http://thread.gmane.org/gmane.mail.notmuch.general/19007
[2]: id:87obf66k7x.fsf at zancas.localnet
 http://thread.gmane.org/gmane.mail.notmuch.general/14474/focus=14493

-- 
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
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: 



Re: [PATCH 4/4] nmbug: Add an 'init' command

2014-09-15 Thread David Edmondson
On Sun, Jul 06 2014, W. Trevor King wrote:
 For folks that want to start versioning a new tag-space, instead of
 cloning one that someone else has already started.

I tried this patch, and it (appeared) to work for me. Given that the
procedure for creating a new tag repository is arcane, could this patch
(or a version of it) be pushed?

 The empty-blob hash-object call avoids errors like:

   $ nmbug commit
   error: invalid object 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 for 
 'tags/...'
   fatal: git-write-tree: error building trees
   'git HASH(0x9ef3eb8) write-tree' exited with nonzero value
 ---
  devel/nmbug/nmbug | 19 +++
  1 file changed, 19 insertions(+)

 diff --git a/devel/nmbug/nmbug b/devel/nmbug/nmbug
 index c9ac046..b64dab9 100755
 --- a/devel/nmbug/nmbug
 +++ b/devel/nmbug/nmbug
 @@ -30,6 +30,7 @@ my %command = (
commit = \do_commit,
fetch  = \do_fetch,
help   = \do_help,
 +  init   = \do_init,
log= \do_log,
merge  = \do_merge,
pull   = \do_pull,
 @@ -152,6 +153,18 @@ sub do_clone {
git ('config', 'core.bare', 'true');
  }
  
 +sub do_init {
 +  my $tempwork = tempdir ('/tmp/nmbug-init.XX', CLEANUP = 1);
 +  system ('git', 'init', '--separate-git-dir', $NMBGIT, $tempwork) == 0
 +or die 'git init' exited with nonzero value\n;
 +  git ('config', '--unset', 'core.worktree');
 +  git ('config', 'core.bare', 'true');
 +  # create an empty blob (e69de29bb2d1d6434b8b29ae775ad8c2e48c5391)
 +  git ('hash-object', '-w', '--stdin');
 +  git ( { GIT_WORK_TREE = $tempwork }, 'commit', '--allow-empty',
 +'-m', 'Start a new nmbug repository' );
 +}
 +
  sub is_committed {
my $status = shift;
return scalar (@{$status-{added}} ) + scalar (@{$status-{deleted}} ) == 
 0;
 @@ -610,6 +623,12 @@ Create a local nmbug repository from a remote source.  
 This wraps
  Cgit clone, adding some options to avoid creating a working tree
  while preserving remote-tracking branches and upstreams.
  
 +=item Binit
 +
 +Create a local nmbug repository from scratch.  This wraps Cgit init
 +and performs other setup to support subsequent status and commit
 +commands.
 +
  =item Bcheckout
  
  Update the notmuch database from git. This is mainly useful to discard
 -- 
 1.9.1.353.gc66d89d
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 4/4] nmbug: Add an 'init' command

2014-09-15 Thread David Edmondson
On Mon, Sep 15 2014, W. Trevor King wrote:
 On Mon, Sep 15, 2014 at 05:13:50PM +0100, David Edmondson wrote:
 On Sun, Jul 06 2014, W. Trevor King wrote:
  For folks that want to start versioning a new tag-space, instead
  of cloning one that someone else has already started.
 
 I tried this patch, and it (appeared) to work for me. Given that the
 procedure for creating a new tag repository is arcane, could this
 patch (or a version of it) be pushed?

 Rewriting this patch is the first thing on my list after nmbug's
 Python translation lands [1].

What is required to make that happen?
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 4/4] nmbug: Add an 'init' command

2014-09-15 Thread W. Trevor King
On Mon, Sep 15, 2014 at 05:13:50PM +0100, David Edmondson wrote:
 On Sun, Jul 06 2014, W. Trevor King wrote:
  For folks that want to start versioning a new tag-space, instead
  of cloning one that someone else has already started.
 
 I tried this patch, and it (appeared) to work for me. Given that the
 procedure for creating a new tag repository is arcane, could this
 patch (or a version of it) be pushed?

Rewriting this patch is the first thing on my list after nmbug's
Python translation lands [1].  Interestingly, there have been versions
of 'nmbug init' kicking around in the wings for some time [2].

Cheers,
Trevor

[1]: 
id:e630b6763e9d0771718afee41ea15b29bb4a1de8.1409935538.git.wking%40tremily.us
 http://thread.gmane.org/gmane.mail.notmuch.general/19007
[2]: id:87obf66k7x.fsf@zancas.localnet
 http://thread.gmane.org/gmane.mail.notmuch.general/14474/focus=14493

-- 
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
Description: OpenPGP digital signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 4/4] nmbug: Add an 'init' command

2014-09-15 Thread W. Trevor King
On Mon, Sep 15, 2014 at 05:32:59PM +0100, David Edmondson wrote:
 On Mon, Sep 15 2014, W. Trevor King wrote:
  On Mon, Sep 15, 2014 at 05:13:50PM +0100, David Edmondson wrote:
  On Sun, Jul 06 2014, W. Trevor King wrote:
   For folks that want to start versioning a new tag-space, instead
   of cloning one that someone else has already started.
  
  I tried this patch, and it (appeared) to work for me. Given that the
  procedure for creating a new tag repository is arcane, could this
  patch (or a version of it) be pushed?
 
  Rewriting this patch is the first thing on my list after nmbug's
  Python translation lands [1].
 
 What is required to make that happen?

Give it a spin to kick the tires, and reply to the v4 patch saying
that none of the pieces fell off while you were kicking it ;).
Basically, it's just waiting for review and a consensus that it's a
solid change.

Cheers,
Trevor

-- 
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
Description: OpenPGP digital signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 4/4] nmbug: Add an 'init' command

2014-09-15 Thread W. Trevor King
On Mon, Sep 15, 2014 at 08:09:11PM +0200, David Bremner wrote:
 W. Trevor King writes:
  Give it a spin to kick the tires, and reply to the v4 patch saying
  that none of the pieces fell off while you were kicking it ;).
  Basically, it's just waiting for review and a consensus that it's
  a solid change.
 
 v3 crashed when merging quite often for me.

I didn't actually change anything there, because I was unable to
reproduce the crash (as I point out in my v4 message, “I've also left
off the merge/pull checkouts, since I haven't been able to reproduce
David's error locally…” [1]).  Any advice on reproducing the merge
errors would be helpful :).

Cheers,
Trevor

[1]: id:e630b6763e9d0771718afee41ea15b29bb4a1de8.1409935538.git.wk...@tremily.us
 http://article.gmane.org/gmane.mail.notmuch.general/19007

-- 
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
Description: OpenPGP digital signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 4/4] nmbug: Add an 'init' command

2014-07-15 Thread David Bremner
"W. Trevor King"  writes:

> +sub do_init {
> +  my $tempwork = tempdir ('/tmp/nmbug-init.XX', CLEANUP => 1);
> +  system ('git', 'init', '--separate-git-dir', $NMBGIT, $tempwork) == 0
> +or die "'git init' exited with nonzero value\n";
> +  git ('config', '--unset', 'core.worktree');
> +  git ('config', 'core.bare', 'true');
> +  # create an empty blob (e69de29bb2d1d6434b8b29ae775ad8c2e48c5391)
> +  git ('hash-object', '-w', '--stdin');
> +  git ( { GIT_WORK_TREE => $tempwork }, 'commit', '--allow-empty',
> +'-m', 'Start a new nmbug repository' );
> +}
> +


Shouldn't this empty blob already be created by the following line:

my $EMPTYBLOB = git (qw{hash-object -t blob /dev/null});

Or is the key point to write it into the database?  Anyway I like my
hack slightly better than yours ;).

d





[PATCH 4/4] nmbug: Add an 'init' command

2014-07-15 Thread W. Trevor King
On Tue, Jul 15, 2014 at 08:54:28PM -0300, David Bremner wrote:
> "W. Trevor King"  writes:
> 
> > +sub do_init {
> > +  my $tempwork = tempdir ('/tmp/nmbug-init.XX', CLEANUP => 1);
> > +  system ('git', 'init', '--separate-git-dir', $NMBGIT, $tempwork) == 0
> > +or die "'git init' exited with nonzero value\n";
> > +  git ('config', '--unset', 'core.worktree');
> > +  git ('config', 'core.bare', 'true');
> > +  # create an empty blob (e69de29bb2d1d6434b8b29ae775ad8c2e48c5391)
> > +  git ('hash-object', '-w', '--stdin');
> > +  git ( { GIT_WORK_TREE => $tempwork }, 'commit', '--allow-empty',
> > +'-m', 'Start a new nmbug repository' );
> > +}
> > +
> 
> 
> Shouldn't this empty blob already be created by the following line:
> 
> my $EMPTYBLOB = git (qw{hash-object -t blob /dev/null});
> 
> Or is the key point to write it into the database?  Anyway I like my
> hack slightly better than yours ;).

We need to write it to the database.  I'll use /dev/null in v2,
though.

Cheers,
Trevor

-- 
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
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: 



Re: [PATCH 4/4] nmbug: Add an 'init' command

2014-07-15 Thread David Bremner
W. Trevor King wk...@tremily.us writes:

 +sub do_init {
 +  my $tempwork = tempdir ('/tmp/nmbug-init.XX', CLEANUP = 1);
 +  system ('git', 'init', '--separate-git-dir', $NMBGIT, $tempwork) == 0
 +or die 'git init' exited with nonzero value\n;
 +  git ('config', '--unset', 'core.worktree');
 +  git ('config', 'core.bare', 'true');
 +  # create an empty blob (e69de29bb2d1d6434b8b29ae775ad8c2e48c5391)
 +  git ('hash-object', '-w', '--stdin');
 +  git ( { GIT_WORK_TREE = $tempwork }, 'commit', '--allow-empty',
 +'-m', 'Start a new nmbug repository' );
 +}
 +


Shouldn't this empty blob already be created by the following line:

my $EMPTYBLOB = git (qw{hash-object -t blob /dev/null});

Or is the key point to write it into the database?  Anyway I like my
hack slightly better than yours ;).

d


 
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 4/4] nmbug: Add an 'init' command

2014-07-15 Thread W. Trevor King
On Tue, Jul 15, 2014 at 08:54:28PM -0300, David Bremner wrote:
 W. Trevor King wk...@tremily.us writes:
 
  +sub do_init {
  +  my $tempwork = tempdir ('/tmp/nmbug-init.XX', CLEANUP = 1);
  +  system ('git', 'init', '--separate-git-dir', $NMBGIT, $tempwork) == 0
  +or die 'git init' exited with nonzero value\n;
  +  git ('config', '--unset', 'core.worktree');
  +  git ('config', 'core.bare', 'true');
  +  # create an empty blob (e69de29bb2d1d6434b8b29ae775ad8c2e48c5391)
  +  git ('hash-object', '-w', '--stdin');
  +  git ( { GIT_WORK_TREE = $tempwork }, 'commit', '--allow-empty',
  +'-m', 'Start a new nmbug repository' );
  +}
  +
 
 
 Shouldn't this empty blob already be created by the following line:
 
 my $EMPTYBLOB = git (qw{hash-object -t blob /dev/null});
 
 Or is the key point to write it into the database?  Anyway I like my
 hack slightly better than yours ;).

We need to write it to the database.  I'll use /dev/null in v2,
though.

Cheers,
Trevor

-- 
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
Description: OpenPGP digital signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 4/4] nmbug: Add an 'init' command

2014-07-06 Thread W. Trevor King
For folks that want to start versioning a new tag-space, instead of
cloning one that someone else has already started.

The empty-blob hash-object call avoids errors like:

  $ nmbug commit
  error: invalid object 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 for 
'tags/...'
  fatal: git-write-tree: error building trees
  'git HASH(0x9ef3eb8) write-tree' exited with nonzero value
---
 devel/nmbug/nmbug | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/devel/nmbug/nmbug b/devel/nmbug/nmbug
index c9ac046..b64dab9 100755
--- a/devel/nmbug/nmbug
+++ b/devel/nmbug/nmbug
@@ -30,6 +30,7 @@ my %command = (
 commit => \_commit,
 fetch  => \_fetch,
 help   => \_help,
+init   => \_init,
 log=> \_log,
 merge  => \_merge,
 pull   => \_pull,
@@ -152,6 +153,18 @@ sub do_clone {
   git ('config', 'core.bare', 'true');
 }

+sub do_init {
+  my $tempwork = tempdir ('/tmp/nmbug-init.XX', CLEANUP => 1);
+  system ('git', 'init', '--separate-git-dir', $NMBGIT, $tempwork) == 0
+or die "'git init' exited with nonzero value\n";
+  git ('config', '--unset', 'core.worktree');
+  git ('config', 'core.bare', 'true');
+  # create an empty blob (e69de29bb2d1d6434b8b29ae775ad8c2e48c5391)
+  git ('hash-object', '-w', '--stdin');
+  git ( { GIT_WORK_TREE => $tempwork }, 'commit', '--allow-empty',
+'-m', 'Start a new nmbug repository' );
+}
+
 sub is_committed {
   my $status = shift;
   return scalar (@{$status->{added}} ) + scalar (@{$status->{deleted}} ) == 0;
@@ -610,6 +623,12 @@ Create a local nmbug repository from a remote source.  
This wraps
 C, adding some options to avoid creating a working tree
 while preserving remote-tracking branches and upstreams.

+=item B
+
+Create a local nmbug repository from scratch.  This wraps C
+and performs other setup to support subsequent status and commit
+commands.
+
 =item B

 Update the notmuch database from git. This is mainly useful to discard
-- 
1.9.1.353.gc66d89d



[PATCH 4/4] nmbug: Add an 'init' command

2014-07-06 Thread W. Trevor King
For folks that want to start versioning a new tag-space, instead of
cloning one that someone else has already started.

The empty-blob hash-object call avoids errors like:

  $ nmbug commit
  error: invalid object 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 for 
'tags/...'
  fatal: git-write-tree: error building trees
  'git HASH(0x9ef3eb8) write-tree' exited with nonzero value
---
 devel/nmbug/nmbug | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/devel/nmbug/nmbug b/devel/nmbug/nmbug
index c9ac046..b64dab9 100755
--- a/devel/nmbug/nmbug
+++ b/devel/nmbug/nmbug
@@ -30,6 +30,7 @@ my %command = (
 commit = \do_commit,
 fetch  = \do_fetch,
 help   = \do_help,
+init   = \do_init,
 log= \do_log,
 merge  = \do_merge,
 pull   = \do_pull,
@@ -152,6 +153,18 @@ sub do_clone {
   git ('config', 'core.bare', 'true');
 }
 
+sub do_init {
+  my $tempwork = tempdir ('/tmp/nmbug-init.XX', CLEANUP = 1);
+  system ('git', 'init', '--separate-git-dir', $NMBGIT, $tempwork) == 0
+or die 'git init' exited with nonzero value\n;
+  git ('config', '--unset', 'core.worktree');
+  git ('config', 'core.bare', 'true');
+  # create an empty blob (e69de29bb2d1d6434b8b29ae775ad8c2e48c5391)
+  git ('hash-object', '-w', '--stdin');
+  git ( { GIT_WORK_TREE = $tempwork }, 'commit', '--allow-empty',
+'-m', 'Start a new nmbug repository' );
+}
+
 sub is_committed {
   my $status = shift;
   return scalar (@{$status-{added}} ) + scalar (@{$status-{deleted}} ) == 0;
@@ -610,6 +623,12 @@ Create a local nmbug repository from a remote source.  
This wraps
 Cgit clone, adding some options to avoid creating a working tree
 while preserving remote-tracking branches and upstreams.
 
+=item Binit
+
+Create a local nmbug repository from scratch.  This wraps Cgit init
+and performs other setup to support subsequent status and commit
+commands.
+
 =item Bcheckout
 
 Update the notmuch database from git. This is mainly useful to discard
-- 
1.9.1.353.gc66d89d

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch