From: W. Trevor King Date: Mon, 19 Jan 2015 00:40:10 +0000 (-0800) Subject: CLI/git: Add an 'init' command X-Git-Tag: 0.37_rc0~95 X-Git-Url: https://git.notmuchmail.org/git?a=commitdiff_plain;h=14ac68ae112437fd25d7e76f8c78523a01d83804;hp=14ac68ae112437fd25d7e76f8c78523a01d83804;p=notmuch CLI/git: Add an 'init' command 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 David Bremner suggested [1]: $ git hash-object -w /dev/null instead of my Python version of: $ git hash-object -w --stdin <&- but I expect that closing stdin is more portable than the /dev/null path (which doesn't exist on Windows, for example). The --bare init and use of NMBGIT as the work tree (what could go wrong with an empty commit?) are suggestions from Michal Sojka [2]. [1]: id:87y4vu6uvf.fsf@maritornes.cs.unb.ca http://thread.gmane.org/gmane.mail.notmuch.general/18626/focus=18720 [2]: id:87a93a5or2.fsf@resox.2x.cz http://thread.gmane.org/gmane.mail.notmuch.general/19495/focus=19767 ---