[Patch v2 3/4] nmbug: replace hard-coded magic hash with git-hash-object

david at tethera.net david at tethera.net
Wed Feb 20 14:24:36 PST 2013


From: David Bremner <bremner at 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



More information about the notmuch mailing list