unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: david@tethera.net
To: notmuch@notmuchmail.org
Cc: David Bremner <bremner@debian.org>
Subject: [Patch v2 3/4] nmbug: replace hard-coded magic hash with git-hash-object
Date: Wed, 20 Feb 2013 18:24:36 -0400	[thread overview]
Message-ID: <1361399077-7737-4-git-send-email-david@tethera.net> (raw)
In-Reply-To: <1361399077-7737-1-git-send-email-david@tethera.net>

From: David Bremner <bremner@debian.org>

This is at least easier to understand than the magic hash. It may also
be a bit more robust, although it is hard to imagine these numbers
changing without many other changes in git.
---
 devel/nmbug/nmbug |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/devel/nmbug/nmbug b/devel/nmbug/nmbug
index 73d64fe..b9c70e4 100755
--- a/devel/nmbug/nmbug
+++ b/devel/nmbug/nmbug
@@ -15,9 +15,6 @@ $NMBGIT .= '/.git' if (-d $NMBGIT.'/.git');
 
 my $TAGPREFIX = $ENV{NMBPREFIX} || 'notmuch::';
 
-# magic hash for git
-my $EMPTYBLOB = 'e69de29bb2d1d6434b8b29ae775ad8c2e48c5391';
-
 # for encoding
 
 my $ESCAPE_CHAR =	'%';
@@ -50,6 +47,9 @@ if (!exists $command{$subcommand}) {
   usage ();
 }
 
+# magic hash for git
+my $EMPTYBLOB = git (qw{hash-object -t blob /dev/null});
+
 &{$command{$subcommand}}(@ARGV);
 
 sub git_pipe {
-- 
1.7.10.4

  parent reply	other threads:[~2013-02-20 22:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-20 22:24 Update for nmbug, round 2 david
2013-02-20 22:24 ` [Patch v2 1/4] nmbug: use dump --format=batch-tag david
2013-02-21  8:30   ` Tomi Ollila
2013-02-21 11:52     ` David Bremner
2013-02-21 12:22       ` Tomi Ollila
2013-02-20 22:24 ` [Patch v2 2/4] nmbug: use 'notmuch tag --batch' david
2013-02-20 22:24 ` david [this message]
2013-02-20 22:24 ` [Patch v2 4/4] nmbug: allow empty prefix david
2013-02-27  8:53 ` Update for nmbug, round 2 Tomi Ollila
2013-02-27 11:59   ` David Bremner
2013-03-02 14:51     ` David Bremner

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=1361399077-7737-4-git-send-email-david@tethera.net \
    --to=david@tethera.net \
    --cc=bremner@debian.org \
    --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).