[PATCH] build: check .git directory existence in srcdir (for out-of-tree builds)
On Sat, Jul 05 2014, David Bremner wrote: > Tomi Ollila writes: > >> So that $(VERSION) and version.stamp uses the git-describe -based >> version data instead of the content of `version' file. >> >> For consistency also the git commands in Makefile[.local] target >> `verify-no-dirty-code' uses the git --git-dir=$srcdir/.git ... >> commands (inside ifeq($(IS_GIT),yes)). Attempting to make this >> target outside of the tree will fail in any case. > > This seems to work OK; I wondered if an alternate method of setting (and > exporting) GIT_DIR from the top level makefile would work as well, and > be less intrusive? This looked like a good idea, and I tested it. But -- lo and behold -- the environment variables set in Makefile do not probagate to the commands executed with $(shell ...) -- see (*) (I wrapped git(1) in a shell script (executes env then execs real git) to verify this is still the case). I thoght now a bit whether we'd use variable in place of ${srcdir}/.git but IMHO is better in this way: - make does not have option to warn/die in case variable undefined, it is then just empty string so no internal error checking there - any human observer notices from the ${srcdir}/.git that we're not using git from any nonstandard place -- if there were variable one would have needed to dereference that to figure out this is the case. (*) http://www.cmcrossroads.com/article/basics-getting-environment-variables-gnu-make?page=0%2C1 > > d Tomi
[PATCH] emacs: add missing paren to fix defun in notmuch-address.el.
Karl Fogel > In general, supplying a log message with the patch with avoid such > confusion. If there is some prose expressing what the change is > supposed to to, and giving any historical context (such as the mailing > list thread starting from last year), then it will be easy for any > reviewer to understand what the patch is intended to do, and check if it > actually does that. Okay, next time I will provide that information inline. Thought keeping References and In-Reply-To headers would be sufficient reference.
[PATCH] emacs: add missing paren to fix defun in notmuch-address.el.
Karl Fogel writes: > Sebastian Lipp writes: >>diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el >>index fa65cd5..ee7b169 100644 >>--- a/emacs/notmuch-address.el >>+++ b/emacs/notmuch-address.el >>@@ -113,6 +113,59 @@ to know how address selection is made by default." >> (when (notmuch-address-locate-command notmuch-address-command) >> (notmuch-address-message-insinuate)) >> >>+;; functions to add sender / recipients to BBDB >>+ >>+(defvar bbdb-get-addresses-headers) > > I think it's good to include an initial value (even an invalid > placeholder one, if the real initialization has not happened yet), and a > doc string. C-h f defvar RET will say more about how to do that. I hope I got that right now. (I've got no real clue of Lisp yet because I just recently switched to emacs partly because of notmuch. :) How about (defvar bbdb-get-addresses-headers nil "List of Addresses to import into bbdb") ? > (By the way, this isn't a user-customizeable variable, right? If it > were, then `defcustom' would be better than `defvar'.) As far as I understand it: It's not.
[PATCH 1/2] cli: S/MIME verification/decryption support
Jameson Graef Rollins writes: >> >> Are we missing the signature between bad and untrusted signatures, or >> does that distinction not exist for S/MIME? > > Hey, David. How did you generate the signatures? I would love to see a > script that generates a signature on a test message. I just grepped over my mail store for S/MIME signed messages. So it's possible they're all bad, but it seems a bit unlikely. I guess emacs+message-mode should be able to generate a signed message message, I just don't know about the cert management. d
[PATCH v2 06/10] cli: refactor insert
On Sat, 05 Jul 2014 10:18:05 -0300, David Bremner wrote: > Peter Wang writes: > > > -cleanup_path = tmppath; > > - > > -if (! copy_stdin (fdin, fdout)) > > - goto FAIL; > > +if (! copy_stdin (fdin, fdout)) { > > + close (fdout); > > + unlink (tmppath); > > + return FALSE; > > +} > > I'm not completely convinced by replacement of the "goto FAIL" with the > multiple returns. I'd lean to towards being consistent with the notmuch > codebase unless the FAIL block is really horrendous Eh, when I came back to the code I found it unnecessary convoluted. However, you can squash in the attached patch if you like. As an objective measure, the function with the FAIL block is longer. > > Is there a good reason to use TRUE and FALSE for return values rather > than EXIT_SUCCESS and EXIT_FAILURE? It seems like the latter would be > overall slightly simpler in notmuch_insert_command. Not sure what you have in mind. I think CLI exit codes should be confined to notmuch_insert_command. Peter -- next part -- A non-text attachment was scrubbed... Name: 0001-goto-fail.patch Type: text/x-diff Size: 1806 bytes Desc: not available URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20140706/5cdb4025/attachment.patch>
[PATCH 4/4] nmbug: 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 --- devel/nmbug/nmbug | 19 +++ 1 file changed, 19 insertions(+) diff --git a/devel/nmbug/nmbug b/devel/nmbug/nmbug index c9ac046..b64dab9 100755 --- a/devel/nmbug/nmbug +++ b/devel/nmbug/nmbug @@ -30,6 +30,7 @@ my %command = ( commit => \&do_commit, fetch => \&do_fetch, help => \&do_help, +init => \&do_init, log=> \&do_log, merge => \&do_merge, pull => \&do_pull, @@ -152,6 +153,18 @@ sub do_clone { git ('config', 'core.bare', 'true'); } +sub do_init { + my $tempwork = tempdir ('/tmp/nmbug-init.XX', 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' ); +} + sub is_committed { my $status = shift; return scalar (@{$status->{added}} ) + scalar (@{$status->{deleted}} ) == 0; @@ -610,6 +623,12 @@ Create a local nmbug repository from a remote source. This wraps C, adding some options to avoid creating a working tree while preserving remote-tracking branches and upstreams. +=item B + +Create a local nmbug repository from scratch. This wraps C +and performs other setup to support subsequent status and commit +commands. + =item B Update the notmuch database from git. This is mainly useful to discard -- 1.9.1.353.gc66d89d ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
Re: [PATCH] emacs: add missing paren to fix defun in notmuch-address.el.
Karl Fogel > In general, supplying a log message with the patch with avoid such > confusion. If there is some prose expressing what the change is > supposed to to, and giving any historical context (such as the mailing > list thread starting from last year), then it will be easy for any > reviewer to understand what the patch is intended to do, and check if it > actually does that. Okay, next time I will provide that information inline. Thought keeping References and In-Reply-To headers would be sufficient reference. ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[PATCH 0/4] nmbug without an upstream repository (and init)
Currently 'nmbug status' errors out if there is no @{upstream} branch. To support folks who are just using nmbug locally, add exit code checking and stderr catching to handle this case appropriately. The final commit isn't closely related, but it allows folks to easily initialize nmbug repositories (e.g. if they want to version-controll *all* their tags, or tags for a different project). After this series, you can run something like: export NMBGIT=/tmp/nmbug nmbug init export NMBPREFIX='' nmbug status nmbug commit to create a new repository with all your tags. Replace the NMBPREFIX with something else (e.g. NMBPREFIX='myproject::') to only track tags for a particular project. You could also define aliases to set the appropriate environment variables on the fly: $ alias mpbug='NMBGIT=/tmp/nmbug NMBPREFIX="myproject::" nmbug' $ mpbug status W. Trevor King (4): nmbug: Add a git_with_status helper function nmbug: Handle missing @upstream in is_unmerged nmbug: Catch stderr in is_unmerged nmbug: Add an 'init' command devel/nmbug/nmbug | 49 +++-- 1 file changed, 43 insertions(+), 6 deletions(-) -- 1.9.1.353.gc66d89d ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[PATCH 2/4] nmbug: Handle missing @upstream in is_unmerged
If we don't have an upstream, there is nothing to merge, so nothing is unmerged. This avoids errors like: $ nmbug status error: No upstream configured for branch 'master' error: No upstream configured for branch 'master' fatal: ambiguous argument '@{upstream}': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git [...] -- [...]' 'git rev-parse @{upstream}' exited with nonzero value You might not have an upstream if you're only using nmbug locally to version-control your tags. --- devel/nmbug/nmbug | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/devel/nmbug/nmbug b/devel/nmbug/nmbug index 4a79722..998ee6b 100755 --- a/devel/nmbug/nmbug +++ b/devel/nmbug/nmbug @@ -430,7 +430,10 @@ sub do_status { sub is_unmerged { my $commit = shift || '@{upstream}'; - my $fetch_head = git ('rev-parse', $commit); + my ($fetch_head, $status) = git_with_status ('rev-parse', $commit); + if ($status) { +return 0; + } my $base = git ( 'merge-base', 'HEAD', $commit); return ($base ne $fetch_head); -- 1.9.1.353.gc66d89d ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[PATCH 3/4] nmbug: Catch stderr in is_unmerged
Add a '-2|' dir for "execute the command and pipe both stdout and stderr to us". Use this to catch stderr from the rev-parse call in is_unmerged. We already check the status, so we don't want to confuse users with stuff like: error: No upstream configured for branch 'master' on nmbug's stderr. --- devel/nmbug/nmbug | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/devel/nmbug/nmbug b/devel/nmbug/nmbug index 998ee6b..c9ac046 100755 --- a/devel/nmbug/nmbug +++ b/devel/nmbug/nmbug @@ -56,7 +56,7 @@ my $EMPTYBLOB = git (qw{hash-object -t blob /dev/null}); sub git_pipe { my $envref = (ref $_[0] eq 'HASH') ? shift : {}; my $ioref = (ref $_[0] eq 'ARRAY') ? shift : undef; - my $dir = ($_[0] eq '-|' or $_[0] eq '|-') ? shift : undef; + my $dir = ($_[0] eq '-|' or $_[0] eq '-2|' or $_[0] eq '|-') ? shift : undef; unshift @_, 'git'; $envref->{GIT_DIR} ||= $NMBGIT; @@ -83,10 +83,15 @@ sub git { sub spawn { my $envref = (ref $_[0] eq 'HASH') ? shift : {}; my $ioref = (ref $_[0] eq 'ARRAY') ? shift : undef; - my $dir = ($_[0] eq '-|' or $_[0] eq '|-') ? shift : '-|'; + my $dir = ($_[0] eq '-|' or $_[0] eq '-2|' or $_[0] eq '|-') ? shift : '-|'; + my $stderr_to_stdout = $dir eq '-2|'; die unless @_; + if ($dir eq '-2|') { +$dir = '-|'; + } + if (open my $child, $dir) { return $child; } @@ -105,6 +110,9 @@ sub spawn { if ($dir ne '|-') { open STDIN, '<', '/dev/null' or die "reopening stdin: $!" } + if ($stderr_to_stdout) { + open(STDERR, ">&STDOUT"); + } exec @_; die "exec @_: $!"; } @@ -430,7 +438,7 @@ sub do_status { sub is_unmerged { my $commit = shift || '@{upstream}'; - my ($fetch_head, $status) = git_with_status ('rev-parse', $commit); + my ($fetch_head, $status) = git_with_status ('-2|', 'rev-parse', $commit); if ($status) { return 0; } -- 1.9.1.353.gc66d89d ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[PATCH 1/4] nmbug: Add a git_with_status helper function
Sometimes we want to catch Git errors and handle them, instead of dying with an error message. This lower-level version of git() allows us to get the error status when we want it. --- devel/nmbug/nmbug | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/devel/nmbug/nmbug b/devel/nmbug/nmbug index b18ded7..4a79722 100755 --- a/devel/nmbug/nmbug +++ b/devel/nmbug/nmbug @@ -63,13 +63,20 @@ sub git_pipe { spawn ($envref, defined $ioref ? $ioref : (), defined $dir ? $dir : (), @_); } -sub git { +sub git_with_status { my $fh = git_pipe (@_); my $str = join ('', <$fh>); - unless (close $fh) { + close $fh; + my $status = $?; + chomp($str); + return ($str, $status); +} + +sub git { + my ($str, $status) = git_with_status (@_); + if ($status) { die "'git @_' exited with nonzero value\n"; } - chomp($str); return $str; } -- 1.9.1.353.gc66d89d ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[PATCH 4/4] nmbug: 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 --- devel/nmbug/nmbug | 19 +++ 1 file changed, 19 insertions(+) diff --git a/devel/nmbug/nmbug b/devel/nmbug/nmbug index c9ac046..b64dab9 100755 --- a/devel/nmbug/nmbug +++ b/devel/nmbug/nmbug @@ -30,6 +30,7 @@ my %command = ( commit => \&do_commit, fetch => \&do_fetch, help => \&do_help, +init => \&do_init, log=> \&do_log, merge => \&do_merge, pull => \&do_pull, @@ -152,6 +153,18 @@ sub do_clone { git ('config', 'core.bare', 'true'); } +sub do_init { + my $tempwork = tempdir ('/tmp/nmbug-init.XX', 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' ); +} + sub is_committed { my $status = shift; return scalar (@{$status->{added}} ) + scalar (@{$status->{deleted}} ) == 0; @@ -610,6 +623,12 @@ Create a local nmbug repository from a remote source. This wraps C, adding some options to avoid creating a working tree while preserving remote-tracking branches and upstreams. +=item B + +Create a local nmbug repository from scratch. This wraps C +and performs other setup to support subsequent status and commit +commands. + =item B Update the notmuch database from git. This is mainly useful to discard -- 1.9.1.353.gc66d89d
[PATCH 3/4] nmbug: Catch stderr in is_unmerged
Add a '-2|' dir for "execute the command and pipe both stdout and stderr to us". Use this to catch stderr from the rev-parse call in is_unmerged. We already check the status, so we don't want to confuse users with stuff like: error: No upstream configured for branch 'master' on nmbug's stderr. --- devel/nmbug/nmbug | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/devel/nmbug/nmbug b/devel/nmbug/nmbug index 998ee6b..c9ac046 100755 --- a/devel/nmbug/nmbug +++ b/devel/nmbug/nmbug @@ -56,7 +56,7 @@ my $EMPTYBLOB = git (qw{hash-object -t blob /dev/null}); sub git_pipe { my $envref = (ref $_[0] eq 'HASH') ? shift : {}; my $ioref = (ref $_[0] eq 'ARRAY') ? shift : undef; - my $dir = ($_[0] eq '-|' or $_[0] eq '|-') ? shift : undef; + my $dir = ($_[0] eq '-|' or $_[0] eq '-2|' or $_[0] eq '|-') ? shift : undef; unshift @_, 'git'; $envref->{GIT_DIR} ||= $NMBGIT; @@ -83,10 +83,15 @@ sub git { sub spawn { my $envref = (ref $_[0] eq 'HASH') ? shift : {}; my $ioref = (ref $_[0] eq 'ARRAY') ? shift : undef; - my $dir = ($_[0] eq '-|' or $_[0] eq '|-') ? shift : '-|'; + my $dir = ($_[0] eq '-|' or $_[0] eq '-2|' or $_[0] eq '|-') ? shift : '-|'; + my $stderr_to_stdout = $dir eq '-2|'; die unless @_; + if ($dir eq '-2|') { +$dir = '-|'; + } + if (open my $child, $dir) { return $child; } @@ -105,6 +110,9 @@ sub spawn { if ($dir ne '|-') { open STDIN, '<', '/dev/null' or die "reopening stdin: $!" } + if ($stderr_to_stdout) { + open(STDERR, ">&STDOUT"); + } exec @_; die "exec @_: $!"; } @@ -430,7 +438,7 @@ sub do_status { sub is_unmerged { my $commit = shift || '@{upstream}'; - my ($fetch_head, $status) = git_with_status ('rev-parse', $commit); + my ($fetch_head, $status) = git_with_status ('-2|', 'rev-parse', $commit); if ($status) { return 0; } -- 1.9.1.353.gc66d89d
[PATCH 2/4] nmbug: Handle missing @upstream in is_unmerged
If we don't have an upstream, there is nothing to merge, so nothing is unmerged. This avoids errors like: $ nmbug status error: No upstream configured for branch 'master' error: No upstream configured for branch 'master' fatal: ambiguous argument '@{upstream}': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git [...] -- [...]' 'git rev-parse @{upstream}' exited with nonzero value You might not have an upstream if you're only using nmbug locally to version-control your tags. --- devel/nmbug/nmbug | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/devel/nmbug/nmbug b/devel/nmbug/nmbug index 4a79722..998ee6b 100755 --- a/devel/nmbug/nmbug +++ b/devel/nmbug/nmbug @@ -430,7 +430,10 @@ sub do_status { sub is_unmerged { my $commit = shift || '@{upstream}'; - my $fetch_head = git ('rev-parse', $commit); + my ($fetch_head, $status) = git_with_status ('rev-parse', $commit); + if ($status) { +return 0; + } my $base = git ( 'merge-base', 'HEAD', $commit); return ($base ne $fetch_head); -- 1.9.1.353.gc66d89d
[PATCH 1/4] nmbug: Add a git_with_status helper function
Sometimes we want to catch Git errors and handle them, instead of dying with an error message. This lower-level version of git() allows us to get the error status when we want it. --- devel/nmbug/nmbug | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/devel/nmbug/nmbug b/devel/nmbug/nmbug index b18ded7..4a79722 100755 --- a/devel/nmbug/nmbug +++ b/devel/nmbug/nmbug @@ -63,13 +63,20 @@ sub git_pipe { spawn ($envref, defined $ioref ? $ioref : (), defined $dir ? $dir : (), @_); } -sub git { +sub git_with_status { my $fh = git_pipe (@_); my $str = join ('', <$fh>); - unless (close $fh) { + close $fh; + my $status = $?; + chomp($str); + return ($str, $status); +} + +sub git { + my ($str, $status) = git_with_status (@_); + if ($status) { die "'git @_' exited with nonzero value\n"; } - chomp($str); return $str; } -- 1.9.1.353.gc66d89d
[PATCH 0/4] nmbug without an upstream repository (and init)
Currently 'nmbug status' errors out if there is no @{upstream} branch. To support folks who are just using nmbug locally, add exit code checking and stderr catching to handle this case appropriately. The final commit isn't closely related, but it allows folks to easily initialize nmbug repositories (e.g. if they want to version-controll *all* their tags, or tags for a different project). After this series, you can run something like: export NMBGIT=/tmp/nmbug nmbug init export NMBPREFIX='' nmbug status nmbug commit to create a new repository with all your tags. Replace the NMBPREFIX with something else (e.g. NMBPREFIX='myproject::') to only track tags for a particular project. You could also define aliases to set the appropriate environment variables on the fly: $ alias mpbug='NMBGIT=/tmp/nmbug NMBPREFIX="myproject::" nmbug' $ mpbug status W. Trevor King (4): nmbug: Add a git_with_status helper function nmbug: Handle missing @upstream in is_unmerged nmbug: Catch stderr in is_unmerged nmbug: Add an 'init' command devel/nmbug/nmbug | 49 +++-- 1 file changed, 43 insertions(+), 6 deletions(-) -- 1.9.1.353.gc66d89d
Re: [PATCH] emacs: add missing paren to fix defun in notmuch-address.el.
Karl Fogel writes: > Sebastian Lipp writes: >>diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el >>index fa65cd5..ee7b169 100644 >>--- a/emacs/notmuch-address.el >>+++ b/emacs/notmuch-address.el >>@@ -113,6 +113,59 @@ to know how address selection is made by default." >> (when (notmuch-address-locate-command notmuch-address-command) >> (notmuch-address-message-insinuate)) >> >>+;; functions to add sender / recipients to BBDB >>+ >>+(defvar bbdb-get-addresses-headers) > > I think it's good to include an initial value (even an invalid > placeholder one, if the real initialization has not happened yet), and a > doc string. C-h f defvar RET will say more about how to do that. I hope I got that right now. (I've got no real clue of Lisp yet because I just recently switched to emacs partly because of notmuch. :) How about (defvar bbdb-get-addresses-headers nil "List of Addresses to import into bbdb") ? > (By the way, this isn't a user-customizeable variable, right? If it > were, then `defcustom' would be better than `defvar'.) As far as I understand it: It's not. ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
Re: [PATCH] build: check .git directory existence in srcdir (for out-of-tree builds)
On Sat, Jul 05 2014, David Bremner wrote: > Tomi Ollila writes: > >> So that $(VERSION) and version.stamp uses the git-describe -based >> version data instead of the content of `version' file. >> >> For consistency also the git commands in Makefile[.local] target >> `verify-no-dirty-code' uses the git --git-dir=$srcdir/.git ... >> commands (inside ifeq($(IS_GIT),yes)). Attempting to make this >> target outside of the tree will fail in any case. > > This seems to work OK; I wondered if an alternate method of setting (and > exporting) GIT_DIR from the top level makefile would work as well, and > be less intrusive? This looked like a good idea, and I tested it. But -- lo and behold -- the environment variables set in Makefile do not probagate to the commands executed with $(shell ...) -- see (*) (I wrapped git(1) in a shell script (executes env then execs real git) to verify this is still the case). I thoght now a bit whether we'd use variable in place of ${srcdir}/.git but IMHO is better in this way: - make does not have option to warn/die in case variable undefined, it is then just empty string so no internal error checking there - any human observer notices from the ${srcdir}/.git that we're not using git from any nonstandard place -- if there were variable one would have needed to dereference that to figure out this is the case. (*) http://www.cmcrossroads.com/article/basics-getting-environment-variables-gnu-make?page=0%2C1 > > d Tomi ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[Patch v3 3/3] doc: postprocess notmuch.3
Remove excess italics from doxygen output. It seems to make no sense (and is certainly ugly) to italicize the first argument to the .RI macro. --- doc/Makefile.local | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/Makefile.local b/doc/Makefile.local index 618b840..dea20a2 100644 --- a/doc/Makefile.local +++ b/doc/Makefile.local @@ -70,6 +70,7 @@ install-apidocs: apidocs $(APIMAN): $(dir)/version.dox $(srcdir)/$(dir)/doxygen.cfg $(srcdir)/lib/notmuch.h mkdir -p $(DOCBUILDDIR)/man/man3 doxygen $(DOXYFILE) + perl -pi -e 's/^[.]RI "\\fI/.RI "\\fP/' $(APIMAN) else apidocs: install-apidocs: -- 2.0.0.rc2
[Patch v3 2/3] doc: quiet doxygen warnings
remove some obsolete tags for XML output (which we don't currently generate in any case) --- doc/doxygen.cfg | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/doxygen.cfg b/doc/doxygen.cfg index 68e8969..0f48ddb 100644 --- a/doc/doxygen.cfg +++ b/doc/doxygen.cfg @@ -228,8 +228,6 @@ MAN_LINKS = NO #--- GENERATE_XML = NO XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD= XML_PROGRAMLISTING = YES #--- # configuration options related to the DOCBOOK output -- 2.0.0.rc2
[Patch v3 1/3] doc: build and install doxygen api docs
In order to support out of tree builds, generate `doc/config.dox` from configure. In order to avoid hardcoding version in doxygen.cfg, generate doc/version.dox at build time. --- configure | 18 ++ doc/Makefile.local | 26 -- doc/doxygen.cfg| 6 +++--- 3 files changed, 45 insertions(+), 5 deletions(-) diff --git a/configure b/configure index 9514d4d..ec3a895 100755 --- a/configure +++ b/configure @@ -417,6 +417,15 @@ else have_emacs=0 fi +printf "Checking if doxygen is available... " +if doxygen -v > /dev/null 2>&1; then +printf "Yes.\n" +have_doxygen=1 +else +printf "No (so will not install api docs)\n" +have_doxygen=0 +fi + printf "Checking if sphinx is available and supports nroff output... " if hash sphinx-build > /dev/null 2>&1 && python -m sphinx.writers.manpage > /dev/null 2>&1 ; then printf "Yes.\n" @@ -725,6 +734,12 @@ commands to compile and install notmuch: EOF +# construct the Doxygen file list +cat > doc/config.dox < Makefile.config < $@ @@ -56,6 +58,23 @@ else endif touch ${MAN_ROFF_FILES} $@ +install-man: install-apidocs + +ifeq ($(HAVE_DOXYGEN),1) +MAN_GZIP_FILES += ${APIMAN}.gz +apidocs: $(APIMAN) +install-apidocs: apidocs + mkdir -p "$(DESTDIR)$(mandir)/man3" + install -m0644 $(DOCBUILDDIR)/man/man3/*.3.gz $(DESTDIR)/$(mandir)/man3 + +$(APIMAN): $(dir)/version.dox $(srcdir)/$(dir)/doxygen.cfg $(srcdir)/lib/notmuch.h + mkdir -p $(DOCBUILDDIR)/man/man3 + doxygen $(DOXYFILE) +else +apidocs: +install-apidocs: +endif + # Do not try to build or install man pages if a man page converter is # not available. ifeq ($(HAVE_SPHINX)$(HAVE_RST2MAN),00) @@ -74,8 +93,11 @@ install-man: ${MAN_GZIP_FILES} cd $(DESTDIR)/$(mandir)/man1 && ln -sf notmuch.1.gz notmuch-setup.1.gz endif +$(dir)/version.dox: version.stamp + echo "PROJECT_NAME = \"Notmuch $(VERSION)\"" > $@ + $(dir)/docdeps.mk: $(dir)/conf.py $(dir)/mkdocdeps.py $(mkdocdeps) $(srcdir)/doc $(DOCBUILDDIR) $@ CLEAN := $(CLEAN) $(DOCBUILDDIR) $(dir)/docdeps.mk $(DOCBUILDDIR)/.roff.stamp -CLEAN := $(CLEAN) $(MAN_GZIP_FILES) $(MAN_ROFF_FILES) $(dir)/conf.pyc +CLEAN := $(CLEAN) $(MAN_GZIP_FILES) $(MAN_ROFF_FILES) $(dir)/conf.pyc $(dir)/version.dox $(dir)/config.dox diff --git a/doc/doxygen.cfg b/doc/doxygen.cfg index bfbfcab..68e8969 100644 --- a/doc/doxygen.cfg +++ b/doc/doxygen.cfg @@ -4,11 +4,11 @@ # Project related configuration options #--- DOXYFILE_ENCODING = UTF-8 -PROJECT_NAME = "Notmuch 0.18" + at INCLUDE = "doc/version.dox" PROJECT_NUMBER = PROJECT_BRIEF = PROJECT_LOGO = -OUTPUT_DIRECTORY = +OUTPUT_DIRECTORY = doc/_build CREATE_SUBDIRS = NO OUTPUT_LANGUAGE= English BRIEF_MEMBER_DESC = YES @@ -96,7 +96,7 @@ WARN_LOGFILE = #--- # configuration options related to the input files #--- -INPUT = lib/notmuch.h + at INCLUDE = doc/config.dox INPUT_ENCODING = UTF-8 FILE_PATTERNS = RECURSIVE = NO -- 2.0.0.rc2
build and install api docs with doxygen
In my testing this version works ok with and without doxygen, and in and out of tree. But I only tested in Debian jessie (testing), so other tests would be welcome. It's a bit lame that we have to generate doxygen config file snippet on the fly just to support out of tree builds, but doxygen seems to have very limited support for options on the command line. The second two patches are essentially cosmetic, although without patch 3/3 the docs are bit eye-burningly-ugly
Re: [PATCH 1/2] cli: S/MIME verification/decryption support
Jameson Graef Rollins writes: >> >> Are we missing the signature between bad and untrusted signatures, or >> does that distinction not exist for S/MIME? > > Hey, David. How did you generate the signatures? I would love to see a > script that generates a signature on a test message. I just grepped over my mail store for S/MIME signed messages. So it's possible they're all bad, but it seems a bit unlikely. I guess emacs+message-mode should be able to generate a signed message message, I just don't know about the cert management. d ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
build and install api docs with doxygen
In my testing this version works ok with and without doxygen, and in and out of tree. But I only tested in Debian jessie (testing), so other tests would be welcome. It's a bit lame that we have to generate doxygen config file snippet on the fly just to support out of tree builds, but doxygen seems to have very limited support for options on the command line. The second two patches are essentially cosmetic, although without patch 3/3 the docs are bit eye-burningly-ugly ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[Patch v3 1/3] doc: build and install doxygen api docs
In order to support out of tree builds, generate `doc/config.dox` from configure. In order to avoid hardcoding version in doxygen.cfg, generate doc/version.dox at build time. --- configure | 18 ++ doc/Makefile.local | 26 -- doc/doxygen.cfg| 6 +++--- 3 files changed, 45 insertions(+), 5 deletions(-) diff --git a/configure b/configure index 9514d4d..ec3a895 100755 --- a/configure +++ b/configure @@ -417,6 +417,15 @@ else have_emacs=0 fi +printf "Checking if doxygen is available... " +if doxygen -v > /dev/null 2>&1; then +printf "Yes.\n" +have_doxygen=1 +else +printf "No (so will not install api docs)\n" +have_doxygen=0 +fi + printf "Checking if sphinx is available and supports nroff output... " if hash sphinx-build > /dev/null 2>&1 && python -m sphinx.writers.manpage > /dev/null 2>&1 ; then printf "Yes.\n" @@ -725,6 +734,12 @@ commands to compile and install notmuch: EOF +# construct the Doxygen file list +cat > doc/config.dox < Makefile.config < $@ @@ -56,6 +58,23 @@ else endif touch ${MAN_ROFF_FILES} $@ +install-man: install-apidocs + +ifeq ($(HAVE_DOXYGEN),1) +MAN_GZIP_FILES += ${APIMAN}.gz +apidocs: $(APIMAN) +install-apidocs: apidocs + mkdir -p "$(DESTDIR)$(mandir)/man3" + install -m0644 $(DOCBUILDDIR)/man/man3/*.3.gz $(DESTDIR)/$(mandir)/man3 + +$(APIMAN): $(dir)/version.dox $(srcdir)/$(dir)/doxygen.cfg $(srcdir)/lib/notmuch.h + mkdir -p $(DOCBUILDDIR)/man/man3 + doxygen $(DOXYFILE) +else +apidocs: +install-apidocs: +endif + # Do not try to build or install man pages if a man page converter is # not available. ifeq ($(HAVE_SPHINX)$(HAVE_RST2MAN),00) @@ -74,8 +93,11 @@ install-man: ${MAN_GZIP_FILES} cd $(DESTDIR)/$(mandir)/man1 && ln -sf notmuch.1.gz notmuch-setup.1.gz endif +$(dir)/version.dox: version.stamp + echo "PROJECT_NAME = \"Notmuch $(VERSION)\"" > $@ + $(dir)/docdeps.mk: $(dir)/conf.py $(dir)/mkdocdeps.py $(mkdocdeps) $(srcdir)/doc $(DOCBUILDDIR) $@ CLEAN := $(CLEAN) $(DOCBUILDDIR) $(dir)/docdeps.mk $(DOCBUILDDIR)/.roff.stamp -CLEAN := $(CLEAN) $(MAN_GZIP_FILES) $(MAN_ROFF_FILES) $(dir)/conf.pyc +CLEAN := $(CLEAN) $(MAN_GZIP_FILES) $(MAN_ROFF_FILES) $(dir)/conf.pyc $(dir)/version.dox $(dir)/config.dox diff --git a/doc/doxygen.cfg b/doc/doxygen.cfg index bfbfcab..68e8969 100644 --- a/doc/doxygen.cfg +++ b/doc/doxygen.cfg @@ -4,11 +4,11 @@ # Project related configuration options #--- DOXYFILE_ENCODING = UTF-8 -PROJECT_NAME = "Notmuch 0.18" +@INCLUDE = "doc/version.dox" PROJECT_NUMBER = PROJECT_BRIEF = PROJECT_LOGO = -OUTPUT_DIRECTORY = +OUTPUT_DIRECTORY = doc/_build CREATE_SUBDIRS = NO OUTPUT_LANGUAGE= English BRIEF_MEMBER_DESC = YES @@ -96,7 +96,7 @@ WARN_LOGFILE = #--- # configuration options related to the input files #--- -INPUT = lib/notmuch.h +@INCLUDE = doc/config.dox INPUT_ENCODING = UTF-8 FILE_PATTERNS = RECURSIVE = NO -- 2.0.0.rc2 ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[Patch v3 2/3] doc: quiet doxygen warnings
remove some obsolete tags for XML output (which we don't currently generate in any case) --- doc/doxygen.cfg | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/doxygen.cfg b/doc/doxygen.cfg index 68e8969..0f48ddb 100644 --- a/doc/doxygen.cfg +++ b/doc/doxygen.cfg @@ -228,8 +228,6 @@ MAN_LINKS = NO #--- GENERATE_XML = NO XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD= XML_PROGRAMLISTING = YES #--- # configuration options related to the DOCBOOK output -- 2.0.0.rc2 ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[Patch v3 3/3] doc: postprocess notmuch.3
Remove excess italics from doxygen output. It seems to make no sense (and is certainly ugly) to italicize the first argument to the .RI macro. --- doc/Makefile.local | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/Makefile.local b/doc/Makefile.local index 618b840..dea20a2 100644 --- a/doc/Makefile.local +++ b/doc/Makefile.local @@ -70,6 +70,7 @@ install-apidocs: apidocs $(APIMAN): $(dir)/version.dox $(srcdir)/$(dir)/doxygen.cfg $(srcdir)/lib/notmuch.h mkdir -p $(DOCBUILDDIR)/man/man3 doxygen $(DOXYFILE) + perl -pi -e 's/^[.]RI "\\fI/.RI "\\fP/' $(APIMAN) else apidocs: install-apidocs: -- 2.0.0.rc2 ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
Re: [PATCH 1/2] cli: S/MIME verification/decryption support
On Tue, Jul 01 2014, David Bremner wrote: > Jameson Graef Rollins writes: > >> The notmuch-show flags --decrypt and --verify will now also process >> S/MIME multiparts if encountered. Requires gmime-2.6 and gpgsm. > > I was trying to figure out how to test this. I tried a few couple signed > messages, but I got "bad" signature status in both cases. > > An example message is attached. > >http://mid.gmane.org/4f1423a1.90...@cms.hu-berlin.de > > Are we missing the signature between bad and untrusted signatures, or > does that distinction not exist for S/MIME? Hey, David. How did you generate the signatures? I would love to see a script that generates a signature on a test message. jamie. pgpirxW36U8lj.pgp Description: PGP signature ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[PATCH 1/2] cli: S/MIME verification/decryption support
On Tue, Jul 01 2014, David Bremner wrote: > Jameson Graef Rollins writes: > >> The notmuch-show flags --decrypt and --verify will now also process >> S/MIME multiparts if encountered. Requires gmime-2.6 and gpgsm. > > I was trying to figure out how to test this. I tried a few couple signed > messages, but I got "bad" signature status in both cases. > > An example message is attached. > >http://mid.gmane.org/4F1423A1.90909 at cms.hu-berlin.de > > Are we missing the signature between bad and untrusted signatures, or > does that distinction not exist for S/MIME? Hey, David. How did you generate the signatures? I would love to see a script that generates a signature on a test message. jamie. -- next part -- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 818 bytes Desc: not available URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20140706/ea5d8223/attachment.pgp>