[PATCH] nmbug: ignore # comments

David Bremner david at tethera.net
Sun Mar 27 13:25:11 PDT 2016


Lines starting with # have always (for a long time, anyway) been ignored
by notmuch-restore, but have not been generated by notmuch-dump
previously.  In order to make nmbug robust against such output, ignore
comment lines.
---

 Even if we decide to change the default output of notmuch dump to not
 contain any comments, this fix will be reasonable in terms of
 increasing robustness against future breakage.

 devel/nmbug/nmbug | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/devel/nmbug/nmbug b/devel/nmbug/nmbug
index 81f582c..0787b2b 100755
--- a/devel/nmbug/nmbug
+++ b/devel/nmbug/nmbug
@@ -608,6 +608,8 @@ def _index_tags():
                 stdin=_subprocess.PIPE,
                 additional_env={'GIT_INDEX_FILE': path}) as git:
             for line in notmuch.stdout:
+                if line.strip().startswith('#'):
+                    continue
                 (tags_string, id) = [_.strip() for _ in line.split(' -- id:')]
                 tags = [
                     _unquote(tag[len(prefix):])
-- 
2.6.4



More information about the notmuch mailing list