aboutsummaryrefslogtreecommitdiff
path: root/devel
AgeCommit message (Collapse)Author
2016-06-11devel/man-to-mdwn.pl: portable locale environment variable settingTomi Ollila
Setting locale environment variables (LC_* and LANG) to e.g. en_US.utf8 works fine on Linux, and that is what locale -a returns (in Linux). However this does not work e.g. in some *BSD systems. In these systems, en_US.UTF-8 works. This also works in Linux systems (which may look like a surprising thing on the first sight(*)). But that *UTF-8 format seems to be widely used in the Linux system: Grep it through the files in /etc/, for example. Easy way to test: Run the following command lines. First should complain about setting locale failed, and second should not. $ LC_ALL=en_US.UTF-1 perl -e '' $ LC_ALL=en_US.UTF-8 perl -e '' (*) and who knows what the "standard" is...
2016-06-05Use https instead of http where possibleDaniel Kahn Gillmor
Many of the external links found in the notmuch source can be resolved using https instead of http. This changeset addresses as many as i could find, without touching the e-mail corpus or expected outputs found in tests.
2016-06-05nmbug: updated to modern URL for PEP 343Daniel Kahn Gillmor
2016-03-28nmbug: ignore # commentsDavid Bremner
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.
2016-03-24notmuch-report: Add notmuch-report(1) and notmuch-report.json(5) man pagesW. Trevor King
To describe the script and config file format, so folks don't have to dig through NEWS or the script's source to get that information. The Makefile and conf.py are excerpted from the main doc/ directory with minor simplifications and adjustments. The devel/nmbug/ scripts are largely independent of notmuch, and separating the docs here allows packagers to easily build the docs and install the scripts in a separate package, without complicating notmuch's core build/install process.
2016-03-24notmuch-report.json: Rename from status-config.jsonW. Trevor King
status-config.json wasn't obviously associated with the old nmubg-status, now notmuch-report. The new name is ${CONFIGURED_SCRIPT}.json, so the association should be clear.
2016-03-24notmuch-report: Rename from nmbug-statusW. Trevor King
This script generates reports based on notmuch queries, and doesn't really have anything to do with nmbug, except for sharing the NMBGIT environment variable.
2016-03-24status-config.json: Remove parens from query entryW. Trevor King
These are now added by nmbug-status.
2016-03-24nmbug-status: Wrap query phrases in parentheses when and-ing togetherW. Trevor King
For example: "query": ["tag:a", "tag:b or tag:c"] is now converted to: ( tag:a ) and ( tag:b or tag:c ) instead of the old: tag:a and tag:b or tag:c This helps us avoid confusion due to Xapian's higher-precedence AND [1], where the old query would be interpreted as: ( tag:a and tag:b ) or tag:c [1]: http://xapian.org/docs/queryparser.html
2016-03-24nmbug-status: Add meta.message-url config settingW. Trevor King
So you can link to archives other than Gmane. For example, I'm doing this in [1]. [1]: https://github.com/wking/nmbug-oci
2016-03-04STYLE: suggest long namesDavid Bremner
Hopefully the exceptions are common sense.
2016-03-04STYLE: document some rules about variable declarationsDavid Bremner
No-one seemed opposed to C99 style loop variable declarations. The requirement to declare variables at the top of blocks is maybe a little more contested, but I believe it reflects the status quo.
2016-01-13devel/emacs: add devel/try-emacs-muaTomi Ollila
devel/try-emacs-mua provides an easy way to try and experiment with the notmuch emacs client distributed in emacs subdirectory of the notmuch source tree. try-emacs-mua starts a new emacs process and if initial checks pass *scratch* buffer is filled with information of how to begin. Normal emacs command line arguments can be used, like -q or -Q. These arguments are appended verbatim to the starting emacs process. If the emacs version in use is smaller than 24.4, special care is taken to ensure that notmuch*.elc files older than corresponding .el files are not loaded. Since emacs 24.4, setting `load-prefer-newer' variable takes care of this.
2016-01-13nmbug-status: Fix unbalanced <p> tags in default header/footerW. Trevor King
These were broken by b70386a4 (Move the generated date from the top of the page to the footer, 2014-05-31), which moved 'Generated ...' to the footer with the opening tag, but didn't replace the blurb opening tag or add a closing tag after 'Generated ...'.
2016-01-13nmbug-status: Style headers with smaller fontsW. Trevor King
We only use h1 through h3, and David prefers smaller headers [1], so shift over to the font sizes usually used for h2 through h4 [2,3,4]. I haven't bothered with the W3C's default margins, since a bit of extra whitespace doesn't seem like a big deal. [1]: id:87k2nl8r0k.fsf@zancas.localnet http://article.gmane.org/gmane.mail.notmuch.general/21595 [2]: http://www.w3.org/TR/html-markup/h2.html [3]: http://www.w3.org/TR/html-markup/h3.html [4]: http://www.w3.org/TR/html-markup/h4.html
2016-01-13nmbug-status: Adjust headers to start with h1W. Trevor King
We've been leading off with h2s since 3e5fb88f (contrib/nmbug: add nmbug-status script, 2012-07-07), but the semantically-correct headers are: <h1>{title}</h1> ... <h2>Views</h2> ... <h3>View 1</h3> ... <h3>View 2</h3> ... We can always add additional CSS if the default h1 formatting is too intense.
2016-01-07nmbug-status: Avoid hard-coded filename in error messageW. Trevor King
We already have a 'filename' variable with the name, so stay DRY and use that variable here. Also fix a missing-whitespace error from bed8b674 (nmbug-status: Clarify errors for illegible configs, 2014-05-10), wrapping on the sentence to match similar error-generation earlier in this function.
2015-11-19devel/release-checks: added checking of copyright year in documentationTomi Ollila
Check that copyright year will be current year in generated documentation. Checking is done my matching that copyright line contains current year as a substring which is good enough "approximation" in this context.
2015-10-04nmbug-status: print config errors to stderrJani Nikula
Particularly scripted usage with stdout redirection can be confusing if errors are printed to stdout instead of stderr.
2015-09-29nmbug-status: add support for specifying sort order for each viewJani Nikula
Let each view have a "sort" key, typically used with values "oldest-first" or "newest-first" (although all values in Query.SORT are accepted), and sort the results accordingly. Oldest first remains the default. The dynamic approach of mapping sort values is as suggested by W. Trevor King <wking@tremily.us>.
2015-08-10build: extract library versions from notmuch.hDavid Bremner
- Make lib/notmuch.h the canonical location for the library versioning information. - Since the release-check should never fail now, remove it to reduce complexity. - Make the version numbers in notmuch.h consistent with the (now deleted) ones in lib/Makefile.local
2015-08-07test: make script exit (1) if it "fails" to source (.) a fileTomi Ollila
The files (test) scripts source (with builtin command `.`) provides information which the scripts depend, and without the `source` to succeed allowing script to continue may lead to dangerous situations (e.g. rm -rf "${undefined_variable}"/*). At the end of all source (.) lines construct ' || exit 1' was added; In our case the script script will exit if it cannot find (or read) the file to be sourced. Additionally script would also exits if the last command of the sourced file exited nonzero.
2015-08-04devel/release-checks.sh: made python version check work with python 3Tomi Ollila
This trivial change consists of just putting print() argument in parentheses.
2015-08-04lib: define NOTMUCH_DEPRECATED macro, document its use.David Bremner
This has been tested with gcc and clang.
2015-06-09release-checks: check that git working directory is cleanTomi Ollila
Before release check that there are no uncommitted changes and that there are no files in working directory that possibly should have been added to the repository. Amended by db: remove --ignored, since that seems like too much trouble.
2015-04-01nmbug-status: Use 'show-ref --heads' for loading configsW. Trevor King
When loading configs from Git, the bare branch name (without a refs/heads/ prefix or similar) matches all branches of that name (including remote-tracking branches): .nmbug $ git show-ref config 48f3bbf1d1492e5f3d2f01de6ea79a30d3840f20 refs/heads/config 48f3bbf1d1492e5f3d2f01de6ea79a30d3840f20 refs/remotes/origin/config 4b6dbd9ffd152e7476f5101eff26747f34497cee refs/remotes/wking/config Instead of relying on the ordering of the matching references, use --heads to ensure we only match local branches.
2015-03-15nmbug-status: Clarify errors for illegible configsW. Trevor King
Carl Worth pointed out that errors like: $ ./nmbug-status fatal: Not a git repository: '/home/cworth/.nmbug' fatal: Not a git repository: '/home/cworth/.nmbug' Traceback (most recent call last): File "./nmbug-status", line 254, in <module> config = read_config(path=args.config) File "./nmbug-status", line 73, in read_config return json.load(fp) File "/usr/lib/python2.7/json/__init__.py", line 290, in load **kw) File "/usr/lib/python2.7/json/__init__.py", line 338, in loads return _default_decoder.decode(s) File "/usr/lib/python2.7/json/decoder.py", line 366, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode raise ValueError("No JSON object could be decoded") ValueError: No JSON object could be decoded are not particularly clear. With this commit, we'll get output like: $ ./nmbug-status fatal: Not a git repository: '/home/wking/.nmbug' No local branch 'config' in /home/wking/.nmbug. Checkout a local config branch or explicitly set --config. which is much more accessible. I've also added user-friendly messages for a number of other config-parsing errors.
2015-03-13lib: make notmuch_query_count_messages explicitely exactJani Nikula
The default is actually exact if no checkatleast parameter is specified. This change makes that explicit, mainly for documentation, but also to be safe in the unlikely event of a change of default. [ commit message rewritten by db based on id:87lho0nlkk.fsf@nikula.org ]
2015-01-18nmbug: Add a 'help' command for folks who don't like --helpW. Trevor King
The 'if args.func == help' block at the end avoids: AttributeError: 'functools.partial' object has no attribute '__code__'
2015-01-03build: eliminate use of python execfile commandDavid Bremner
As discussed in id:8cc9dd580ad672527e12f43706f9803b2c8e99d8.1405220724.git.wking@tremily.us, execfile is unavailable in python3. The approach of this commit avoids modifying the python module path, which is arguably preferable since it avoids potentially accidentally importing a module from the wrong place.
2014-11-02devel: man-to-mdwn.pl: add GPLv3+ notice to manpages.mdwnTomi Ollila
Make the generated head manual page (in the notmuchmail wiki) display the licence information the whole notmuch software is licenced under.
2014-11-02devel: make man-to-mdwn.pl to work with generated manual pagesTomi Ollila
The new manual pages converted from rst using sphinx or rst2man has somewhat different syntax. man-to-mdwn.pl is now adjusted to produce even better output from this syntax. The changes also include using utf-8 locale (e.g. for tables and generated hypens) and and quite a few bugs fixes. This tool still produces better results than just using the html pages generated using sphinx / rst2html. For example those tools don't create inter-page hyperlinks -- and the preformatted pages written by man-to-mdwn.pl just works well with manual page content.
2014-10-05nmbug: Translate to PythonW. Trevor King
This allows us to capture stdout and stderr separately, and do other explicit subprocess manipulation without resorting to external packages. It should be compatible with Python 2.7 and later (including the 3.x series). Most of the user-facing interface is the same, but there are a few changes, where reproducing the original interface was too difficult or I saw a change to make the underlying Git UI accessible: * 'nmbug help' has been split between the general 'nmbug --help' and the command-specific 'nmbug COMMAND --help'. * Commands are no longer split into "most common", "other useful", and "less common" sets. If we need something like this, I'd prefer workflow examples highlighting common commands in the module docstring (available with 'nmbug --help'). * 'nmbug commit' now only uses a single argument for the optional commit-message text. I wanted to expose more of the underlying 'git commit' UI, since I personally like to write my commit messages in an editor with the notes added by 'git commit -v' to jog my memory. Unfortunately, we're using 'git commit-tree' instead of 'git commit', and commit-tree is too low-level for editor-launching. I'd be interested in rewriting commit() to use 'git commit', but that seemed like it was outside the scope of this rewrite. So I'm not supporting all of Git's commit syntax in this patch, but I can at least match 'git commit -m MESSAGE' in requiring command-line commit messages to be a single argument. * The default repository for 'nmbug push' and 'nmbug fetch' is now the current branch's upstream (branch.<name>.remote) instead of 'origin'. When we have to, we extract this remote by hand, but where possible we just call the Git command without a repository argument, and leave it to Git to figure out the default. * 'nmbug push' accepts multiple refspecs if you want to explicitly specify what to push. Otherwise, the refspec(s) pushed depend on push.default. The Perl version hardcoded 'master' as the pushed refspec. * 'nmbug pull' defaults to the current branch's upstream (branch.<name>.remote and branch.<name>.merge) instead of hardcoding 'origin' and 'master'. It also supports multiple refspecs if for some crazy reason you need an octopus merge (but mostly to avoid breaking consistency with 'git pull'). * 'nmbug log' now execs 'git log', as there's no need to keep the Python process around once we've launched Git there. * 'nmbug status' now catches stderr, and doesn't print errors like: No upstream configured for branch 'master' The Perl implementation had just learned to avoid crashing on that case, but wasn't yet catching the dying subprocess's stderr. * 'nmbug archive' now accepts positional arguments for the tree-ish and additional 'git archive' options. For example, you can run: $ nmbug archive HEAD -- --format tar.gz I wish I could have preserved the argument order from 'git archive' (with the tree-ish at the end), but I'm not sure how to make argparse accept arbitrary possitional arguments (some of which take arguments). Flipping the order to put the tree-ish first seemed easiest. * 'nmbug merge' and 'pull' no longer checkout HEAD before running their command, because blindly clobbering the index seems overly risky. * In order to avoid creating a dirty index, 'nmbug commit' now uses the default index (instead of nmbug.index) for composing the commit. That way the index matches the committed tree. To avoid leaving a broken index after a failed commit, I've wrapped the whole thing in a try/except block that resets the index to match the pre-commit treeish on errors. That means that 'nmbug commit' will ignore anything you've cached in the index via direct Git calls, and you'll either end up with an index matching your notmuch tags and the new HEAD (after a successful commit) or an index matching the original HEAD (after a failed commit).
2014-07-16nmbug: Handle missing @upstream in is_unmergedW. Trevor King
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 <command> [<revision>...] -- [<file>...]' '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.
2014-07-16nmbug: Add a git_with_status helper functionW. Trevor King
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.
2014-07-15nmbug-status: Optionally load the header and footer templates from the configW. Trevor King
For folks that don't like the default templates for whatever reason.
2014-07-15nmbug-status: Add the time to the footer's build-dateW. Trevor King
Our repository [1] has a post-update hook that rebuilds the status page after each push. Since that may happen several times a day, we might as well show the build time (as well as the date) in the footer. The trailing 'Z' is the ISO 8601 designator for UTC. Now that we're showing times, it's nice to be explicit about the timezone we're using. The rename from date -> datetime gives us backward-compatibility for folks that *do* only want the date. We keep the old date formatting to support those folks. [1]: http://nmbug.tethera.net/git/nmbug-tags.git
2014-07-15nmbug-status: Factor out header/footer context into a shared dictW. Trevor King
Rather than splitting this context into header-only and footer-only groups, just dump it all in a shared dict. This will make it easier to eventually split the header/footer templates out of this script (e.g. if we want to load them from the config file).
2014-07-15Move the generated date from the top of the page to the footer.Carl Worth
It's useful reference information, but anyone who wants it will look for and find it. We don't need this front-and-center. Follow the pattern set by our header template with a triple-quoted string. The gray <hr> styling is less agressive. IE uses 'color' for drawing the rule, while Gecko and Opera use the border or 'background-color' [1]. [1]: https://bugzilla.mozilla.org/show_bug.cgi?id=239386
2014-07-15Add a docstring describing the programCarl Worth
Prefer a docstring to a header comment so we can use it as the ArgumentParser description (formatted with 'nmbug-status --help'). Script readers still have it near the top of the file. Since it's a docstring, use PEP 257's summary-line-and-body format [1]. [1]: http://legacy.python.org/dev/peps/pep-0257/#multi-line-docstrings
2014-07-15Add explicit license informationCarl Worth
It's nice to have for situations where this script is found outside of the notmuch source repository (e.g. after being installed).
2014-07-13devel: news2wiki to recognize yyyy-mm-dd or UNRELEASED as release dateTomi Ollila
The yyyy-mm-dd (actually \d\d\d\d-\d\d-\d\d) for a bit more restrictive (and self-documentative) than the \w\w\w\w-... that used to be there and UNRELEASED so that developers can test the latest NEWS converted to mdwn format before submitting NEWS patches.
2014-04-15nmbug: mark repository as bare on cloneDavid Bremner
If a git repository is non-bare, and core.worktree is not set, git tries to deduce the worktree. This deduction is not always helpful, e.g. % git --git-dir=$HOME/.nmbug clean -f would likely delete most of the files in the current directory
2014-04-08nmbug: Add 'clone' and replace FETCH_HEAD with @{upstream}W. Trevor King
With two branches getting fetched (master and config), the branch referenced by FETCH_HEAD is ambiguous. For example, I have: $ cat FETCH_HEAD 41d7bfa7184cc93c9dac139d1674e9530799e3b0 \ not-for-merge branch 'config' of http://nmbug.tethera.net/git/nmbug-tags acd379ccb973c45713eee9db177efc530f921954 \ not-for-merge branch 'master' of http://nmbug.tethera.net/git/nmbug-tags (where I wrapped the line by hand). This means that FETCH_HEAD references the config branch: $ git rev-parse FETCH_HEAD 41d7bfa7184cc93c9dac139d1674e9530799e3b0 which breaks all of the FETCH_HEAD logic in nmbug (where FETCH_HEAD is assumed to point to the master branch). Instead of relying on FETCH_HEAD, use @{upstream} as the remote-tracking branch that should be merged/diffed/integrated into HEAD. @{upstream} was added in Git v1.7.0 (2010-02-12) [1], so relying on it should be fairly safe. One tricky bit is that bare repositories don't set upstream tracking branches by default: $ git clone --bare http://nmbug.tethera.net/git/nmbug-tags.git nmbug-bare $ cd nmbug-bare $ git remote show origin * remote origin Fetch URL: http://nmbug.tethera.net/git/nmbug-tags.git Push URL: http://nmbug.tethera.net/git/nmbug-tags.git HEAD branch: master Local refs configured for 'git push': config pushes to config (up to date) master pushes to master (up to date) While in a non-bare clone: $ git clone http://nmbug.tethera.net/git/nmbug-tags.git $ cd nmbug-tags $ git remote show origin * remote origin Fetch URL: http://nmbug.tethera.net/git/nmbug-tags.git Push URL: http://nmbug.tethera.net/git/nmbug-tags.git HEAD branch: master Remote branches: config tracked master tracked Local branch configured for 'git pull': master merges with remote master Local ref configured for 'git push': master pushes to master (up to date) From the clone docs [2]: --bare:: Make a 'bare' Git repository… Also the branch heads at the remote are copied directly to corresponding local branch heads, without mapping them to `refs/remotes/origin/`. When this option is used, neither remote-tracking branches nor the related configuration variables are created. To use @{upstream}, we need to the local vs. remote-tracking distinction, so this commit adds 'nmbug clone', replacing the previously suggested --bare clone with a non-bare --no-checkout --separate-git-dir clone into a temporary work directory. After which: $ git rev-parse @{upstream} acd379ccb973c45713eee9db177efc530f921954 gives us the master-branch commit. Existing nmbug users will have to run the configuration tweaks and re-fetch by hand. If you don't have any local commits, you could also blow away your NMBGIT repository and re-clone from scratch: $ nmbug clone http://nmbug.tethera.net/git/nmbug-tags.git Besides removing the ambiguity of FETCH_HEAD, this commit allows users to configure which upstream branch they want nmbug to track via 'git config', in case they want to change their upstream repository. [1]: http://git.kernel.org/cgit/git/git.git/tree/Documentation/RelNotes/1.7.0.txt [2]: http://git.kernel.org/cgit/git/git.git/tree/Documentation/git-clone.txt
2014-04-08release-checks: removed manual page version checkTomi Ollila
Manual pages are now generated and during the generation the version string is read from `version` file, so this (currently failing) test checking manual page versions can be removed. While at it, changed the case pattern *[^0-9.]* to its portable alternative *[!0-9.]*
2014-04-08doc: move doxgen config from devel/ to doc/David Bremner
a first step towards actually instally the API docs
2014-03-23nmbug-status: make output title and blurb configurableJani Nikula
Make nmbug-status more generally usable outside of nmbug by not hardcoding notmuch related things. This lets anyone publish html search views to mailing list messages with a custom config file, independent of nmbug.
2014-03-23nmbug-status: parameterize title and blurb in the page headerJani Nikula
Prepare for more general use.
2014-03-11devel: add script to generate test databasesJani Nikula
Add script to generate notmuch test databases using specified versions of notmuch. This is useful for generating material for database upgrade tests. This reuses the test infrastructure to have a sandbox environment for notmuch new etc.
2014-02-21nmbug-status: replace __values__() with values() in OrderedDict stubTomi Ollila
Python dict() object does not have __values__() function which OrderedDict().values() (the stub provided in nmbug-status) could call to provide ordered list of values. By renaming this thinko to values() will make our stub work as expected -- dict items listed out in order those were added to the dictionary.