summaryrefslogtreecommitdiff
path: root/devel
AgeCommit message (Collapse)Author
2017-12-29nmbug: Bump to version 0.3W. Trevor King
Changes since 0.2: * Accept failures to unset core.worktree in clone (0a155847, 2017-10-10, unreleased). * Use --no-renames in log (f9189a06, 2016-09-26, v0.24). * Auto-checkout in clone if it wouldn't clobber (7ef3b653, 2017-10-10, unreleased). * Add a 'help' command for folks who don't like --help (9d25c97d, 2014-10-03, v0.20). * Setup a 'config' branch on clone to track origin/config (244f8739, 2015-03-22, v0.20). This branch may be consumed by notmuch-report(1). * Only error for invalid diff lines in tags/ (57225988, 2017-10-16, unreleased). * Ignore # comments in 'notmuch dump ...' output (9bbc54bd, 2016-03-27, v0.22). * Respect 'expect' in _spawn(..., wait=True) (e263c5b1, 2017-10-10, unreleased). * Update URLs in documentation (554b90b5 and 6a833a6e8, 2016-06-02, v0.23).
2017-12-16nmbug: Only error for invalid diff lines in tags/W. Trevor King
Avoid: Traceback (most recent call last): File "/home/nmbug/bin/nmbug", line 834, in <module> args.func(**kwargs) File "/home/nmbug/bin/nmbug", line 385, in checkout status = get_status() File "/home/nmbug/bin/nmbug", line 580, in get_status maybe_deleted = _diff_index(index=index, filter='D') File "/home/nmbug/bin/nmbug", line 658, in _diff_index for id, tag in _unpack_diff_lines(stream=p.stdout): File "/home/nmbug/bin/nmbug", line 678, in _unpack_diff_lines 'Invalid line in diff: {!r}'.format(line.strip())) ValueError: Invalid line in diff: u'.mailmap' With this commit, folks can commit READMEs, .mailmap, etc. to their nmbug repositories, and 'nmbug diff' and 'status' won't choke on them. If you want to check for this sort of thing, you can set --log-level to info or greater. nmbug will still error if the unrecognized path is under tags/, since that's more likely to be a user error.
2017-12-11nmbug: Auto-checkout in clone if it wouldn't clobberW. Trevor King
We currently auto-checkout after pull and merge to make those more convenient. They're guarded against data-loss with a leading _insist_committed(). This commit adds the same convenience to clone, since in most cases users will have no NMBPREFIX-prefixed tags in their database when they clone. Users that *do* have NMBPREFIX-prefixed tags will get a warning (and I've bumped the default log level to warning so folks who don't set --log-level will see it) like: $ nmbug clone http://nmbug.notmuchmail.org/git/nmbug-tags.git Cloning into '/tmp/nmbug-clone.g9dvd0tv'... Checking connectivity: 16674, done. Branch config set up to track remote branch config from origin. Not checking out to avoid clobbering existing tags: notmuch::0.25, ...
2017-12-11nmbug: Accept failures to unset core.worktree in cloneW. Trevor King
Since 6311cfaf (init: do not set unnecessary core.worktree, 2016-09-25, 2.11.0 [1]), Git has no longer set core.worktree when --separate-git-dir is used. This broke clone with: $ nmbug clone http://nmbug.notmuchmail.org/git/nmbug-tags.git Cloning into '/tmp/nmbug-clone.33gg442e'... Checking connectivity: 16674, done. ['git', '--git-dir', '/home/wking/.nmbug', 'config', '--unset', 'core.worktree'] exited with 5 $ echo $? 1 The initial discussion that lead to the Git change is in [2], and there is some more discussion around this specific change in [3]. There is some useful background on working trees in this 2009 message [4]. There is also a git-worktree(1) since df0b6cfb (worktree: new place for "git prune --worktrees", 2015-06-29, 2.5.0 [5]) which grew the ability to add new worktrees in 799767cc (Merge branch 'es/worktree-add', 2015-07-13, 2.5.0 [6]). Folks relying on core.worktree in the --separate-git-dir case fall into the "former case" in [4], and as Junio pointed out in that message, Git operations like 'add' don't really work there. In nmbug we don't want core.worktree, because our effective working tree is the notmuch database. By accepting failed core.worktree unsets, clone will work with Gits older and younger than 2.11.0. [1]: https://github.com/git/git/commit/6311cfaf93716bcc43dd1151cb1763e3f80d8099 [2]: https://public-inbox.org/git/CALqjkKZO_y0DNcRJjooyZ7Eso7yBMGhvZ6fE92oO4Su7JeCeng@mail.gmail.com/ [3]: https://public-inbox.org/git/87h94d8cwi.fsf@kyleam.com/ [4]: https://public-inbox.org/git/7viqbsw2vn.fsf@alter.siamese.dyndns.org/ [5]: https://github.com/git/git/commit/df0b6cfbda88144714541664fb501146d6465a82 [6]: https://github.com/git/git/commit/799767cc98b2f8e6f82d0de4bef9b5e8fcc16e97 Reported-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2017-12-11nmbug: Respect 'expect' in _spawn(..., wait=True)W. Trevor King
Fixing a bug from 7f2cb3be (nmbug: Translate to Python, 2014-10-03). The bug had no direct impact though, because none of the wait=True callers were setting expect. Also add expected codes to the debug messages, to help log readers understand why nonzero exits are occasionally accepted.
2017-10-05devel/check-out-of-tree-build.sh: consistent naming, consistent quotingTomi Ollila
Renamed from out-of-tree-build-check.sh to be consistent with other files in this directory. Fixed quoting in "$srcdir" usage for additional robustness, other quoting changes for consistency.
2017-10-02devel: add script to test out-of-tree buildsJani Nikula
Something I used for 'git bisect run', but we should really add this as part of our process.
2017-08-18Use rooted paths in .gitignore filesVladimir Panteleev
A leading / in paths in a .gitignore file matches the beginning of the path, meaning that for patterns without slashes, git will match files only in the current directory as opposed to in any subdirectory. Prefix relevant paths with / in .gitignore files, to prevent accidentally ignoring files in subdirectories and possibly slightly improve the performance of "git status".
2017-07-04devel/schemata: describe version 4David Bremner
Replace numeric errors with human readable flags. Not all sig_error keys will necessarily be generated with a given version of gmime. Drop status "none" as it's currrently unused and I don't know what it's for.
2017-02-28cli/show: add content-disposition to structured output message partsJani Nikula
Help the clients decide how to display parts. Test updates by Mark Walters <markwalters1009@gmail.com>. One more test fix by db
2017-02-26cli/show: list all filenames of a message in the formatted outputJani Nikula
Instead of just having the first filename for the message, list all duplicate filenames of the message as a list in the formatted outputs. This bumps the format version to 3.
2016-10-25devel: Document emacs keybindingsMark Walters
This adds a file under devel listing all the keybindings sorted by key in the main three modes (search, show and tree). To reduce clutter it only lists the single key "unmodified" keybindings: I think all our uses of prefixes and modifiers are natural variants of the unmodified binding (eg M-n compared to n in show mode) This should make easier to see what keybindings are available when adding new features.
2016-10-04nmbug: Add --no-renames to default log optionsW. Trevor King
Git has supported this since b68ea12e (diff.c: respect diff.renames config option, 2006-07-07, v1.4.2). All of our information is in the paths (the files are empty), so we don't want rename detection. By using --no-renames, we get entries like: $ nmbug log -- e473b453a2 commit e473b453a25c072b5df67d834d822121373321f5 Author: David Bremner <david@tethera.net> Date: Sun Sep 25 07:54:11 2016 -0300 D tags/1474196252-31700-1-git-send-email-markwalters1009@gmail.com/0.23 A tags/1474196252-31700-1-git-send-email-markwalters1009@gmail.com/pushed ... Instead of the old: $ nmbug log -- e473b453a2 commit e473b453a25c072b5df67d834d822121373321f5 Author: David Bremner <david@tethera.net> Date: Sun Sep 25 07:54:11 2016 -0300 R100 tags/1474196252-31700-1-git-send-email-markwalters1009@gmail.com/0.23 tags/1474196252-31700-1-git-send-email-markwalters1009@gmail.com/pushed
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