From 55c99ad60c4870f14d66ee14d5eebe9b02ba9e8e Mon Sep 17 00:00:00 2001 From: David Bremner Date: Wed, 16 Jul 2014 20:54:28 +2100 Subject: [PATCH] Re: [PATCH 4/4] nmbug: Add an 'init' command --- b4/641141a64da83f566eb2922ec149425a687564 | 80 +++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 b4/641141a64da83f566eb2922ec149425a687564 diff --git a/b4/641141a64da83f566eb2922ec149425a687564 b/b4/641141a64da83f566eb2922ec149425a687564 new file mode 100644 index 000000000..99069fbf4 --- /dev/null +++ b/b4/641141a64da83f566eb2922ec149425a687564 @@ -0,0 +1,80 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 1AA99431FC7 + for ; Tue, 15 Jul 2014 16:54:36 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id UPTGlITrT3ow for ; + Tue, 15 Jul 2014 16:54:32 -0700 (PDT) +Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155]) + (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id E8CB1431FC0 + for ; Tue, 15 Jul 2014 16:54:32 -0700 (PDT) +Received: from remotemail by yantan.tethera.net with local (Exim 4.80) + (envelope-from ) + id 1X7CYK-0003Mq-5Z; Tue, 15 Jul 2014 20:54:32 -0300 +Received: (nullmailer pid 5877 invoked by uid 1000); Tue, 15 Jul 2014 + 23:54:28 -0000 +From: David Bremner +To: "W. Trevor King" , notmuch@notmuchmail.org +Subject: Re: [PATCH 4/4] nmbug: Add an 'init' command +In-Reply-To: + <05ccd672f55444f74da62250e2305fb84fdc6c42.1404678709.git.wking@tremily.us> +References: + <05ccd672f55444f74da62250e2305fb84fdc6c42.1404678709.git.wking@tremily.us> +User-Agent: Notmuch/0.18.1+45~gf47eeac (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-pc-linux-gnu) +Date: Tue, 15 Jul 2014 20:54:28 -0300 +Message-ID: <87y4vu6uvf.fsf@maritornes.cs.unb.ca> +MIME-Version: 1.0 +Content-Type: text/plain +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Tue, 15 Jul 2014 23:54:36 -0000 + +"W. Trevor King" 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 ;). + +d + + + -- 2.26.2