[PATCH 4/4] nmbug: Add an 'init' command
W. Trevor King
wking at tremily.us
Tue Jul 15 17:12:39 PDT 2014
On Tue, Jul 15, 2014 at 08:54:28PM -0300, David Bremner wrote:
> "W. Trevor King" <wking at tremily.us> writes:
>
> > +sub do_init {
> > + my $tempwork = tempdir ('/tmp/nmbug-init.XXXXXX', 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: <http://notmuchmail.org/pipermail/notmuch/attachments/20140715/c652b5c9/attachment.pgp>
More information about the notmuch
mailing list