aboutsummaryrefslogtreecommitdiffstats
path: root/contrib
Commit message (Collapse)AuthorAgeFilesLines
* changelog: get unreleased entries from commit trailersRobin Jarry2023-10-231-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Asking contributors to update the CHANGELOG.md file is causing lots of merge conflicts. Introduce a new workflow where contributors can attach changelog entries in patches via git trailers. Changelog-added: For new features. Changelog-fixed: For bug fixes. Changelog-changed: For behaviour or config format changes. Changelog-deprecated: For deprecation or removal of functionality. If a complete trailer is longer than 72 characters, it can be continued by indenting extra lines with a single space. The trailer text must be valid markdown. Update CONTRIBUTING.md with new guidelines. Update contrib/release.sh to extract these trailers before tagging and create a new section in CHANGELOG.md. Extract unreleased entries in this commit to follow the new workflow. Changelog-added: New `flagged` criteria for `:sort`. Changelog-added: New `:send-keys` command to control embedded terminals. Changelog-added: Account aliases now support fnmatch-style wildcards. Changelog-fixed: `colorize` support for wildcards `?` and `*`. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* contrib: add a script to generate release statisticsBence Ferdinandy2023-10-221-0/+120
| | | | | | | | | | | | | | | | | | | | Add a new python script, that will generate two types of statistics for each minor release (and HEAD) from the local repository and create a graph. First statistics is number of commits since the previous release, the second statistics is number of lines inserted and deleted since the previous release. The placement of the text annotations (tag names) is mildly smart, so the distribution changes significantly the hard coded numbers might have to be tweaked. Requires matplotlib to be installed (developed with 3.7.3). It generates a png by default, but this can be changed by passing the output file option with a different file extension as long as matplotlib knows what to do with it. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
* release.sh: fix typoRobin Jarry2023-10-211-2/+2
| | | | | | | It is GNUmakefile, not GNUMakefile. Fixes: d179485eefe5 ("release.sh: update version in GNUMakefile") Signed-off-by: Robin Jarry <robin@jarry.cc>
* carddav-query: interpret percent escapes in source urlRobin Jarry2023-10-131-4/+4
| | | | | | | | | | | | | | | | The username and password must be percent encoded if they are set in carddav-source. Python's parser does not automatically unquote the different URL elements. Some carddav servers do not care about this but some do and report authentication failures when the username is percent encoded. Make sure to unquote the username and password after reading them from carddav-source. Reported-by: Callum Andrew <contact@candrew.net> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Callum Andrew <contact@candrew.net>
* release.sh: fix email encodingRobin Jarry2023-10-131-0/+4
| | | | | | | | | | | | | | | | | | The release emails are sent without any Content-Transfer-Encoding nor Content-Type headers. This causes non-ASCII characters to be rendered as garbage by email clients. Here are two examples from the latest release: Mat��j Cepl Nojus Gudinavi��ius Everything is UTF-8 locally, state it explicitly in the email. Use 8bit as transfer encoding since we are not quoting anything. Add a From: header since some sendmail implementations do not add a default value when it is missing. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* release.sh: update version in GNUMakefileRobin Jarry2023-10-111-2/+2
| | | | | | | | | | | | The version is no longer present in Makefile which has been preserved for explicit error reporting with non-GNU make versions. Update the version in GNUMakefile instead. Fixes: d725defa07b5 ("mk: deprecate BSD make in favor of GNU make") Reported-by: Anton Mosich <anton@mosich.at> Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* check-patches: complain if title is longer than 72 charactersBence Ferdinandy2023-09-271-0/+5
| | | | | | | | | | | | Although git commit titles can be a lot longer that 72 characters it is sensible to limit it somewhere. Many people recommend a maximum of 50 characters, other places allow for slightly longer, github for examples truncates titles at 72, our benevolent maintainer tries to aim for 60. Considering the above 72 seems like a comfortable hard limit. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Reviewed-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* contrib: add script to check man pages consistencyRobin Jarry2023-09-191-0/+59
| | | | | | | | | | | | | | | Add a new shell script to check that all commands are documented in man pages and that the man pages do not contain non-existent commands. Also check that all explicitly parsed options with ini reflection are documented as well. It is not possible to check if the man pages do reference non-existent options since some of the options are parsed lazily in workers and some of them are also declared with placeholders (e.g. *column-<name>*). Run the script in the lint target. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
* colorize: handle spaces in stylesetRobin Jarry2023-09-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid failure when the styleset [viewer] section contains spaces: ~$ cat foo [viewer] url.fg = #ffffaf url.underline = true header.fg = #af87ff signature.fg = #af87ff diff_meta.fg = #ffffff diff_meta.bold = true diff_chunk.fg = #00cdcd diff_add.fg = #00cd00 diff_del.fg = #cd0000 quote_1.fg = #5fafff quote_2.fg = #ff8700 quote_3.fg = #af87ff quote_4.fg = #ff5fd7 quote_x.fg = #808080 ~$ ./colorize -s foo < bar.eml error: invalid style attribute 'fg ' Be more restrictive with what characters are part of a style attribute. Add test styleset with as much weirdness as possible. Update vectors accordingly. Update sendemail-validate hook to export pedantic CFLAGS. Reported-by: Tristan Partin <tristan@partin.io> Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Tristan Partin <tristan@partin.io> Tested-by: Tristan Partin <tristan@partin.io>
* notmuch: add notmuch bindingsTim Culverhouse2023-08-301-0/+4
| | | | | | | | | aerc is using an unmaintained fork of a not-well-functioning notmuch binding library. Add custom bindings directly into the aerc repo to make them more maintainable and more customizable to our needs. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* contrib: update sendemail-validate hookRobin Jarry2023-08-042-31/+58
| | | | | | | | | With git 2.41, git send-email exports a patch counter to the validate hook. Copy the example hook from git and adapt it for aerc. Link: https://github.com/git/git/commit/3c8d3adeae83 Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* contrib: actually fix irc patchset hook when author is not registeredRobin Jarry2023-07-282-4/+6
| | | | | | | | When the author is not registered in sr.ht, the schema object is different. Fixes: 3a73ffb40ed1 ("contrib: fix irc patchset hook when author is not registered") Signed-off-by: Robin Jarry <robin@jarry.cc>
* contrib: fix irc patchset hook when author is not registeredRobin Jarry2023-07-142-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid running into KeyError because the webhook payload does not have a submitter canonicalName field. { "data": { "webhook": { "uuid": "69635b8e-8af5-4292-866b-1e45f75c132a", "event": "PATCHSET_RECEIVED", "date": "2023-07-11T13:55:17.248351983Z", "patchset": { "id": 42569, "subject": "Commands: add :echo command", "version": 1, "prefix": "aerc", "list": { "name": "aerc-devel", "owner": { "canonicalName": "~rjarry" } }, "submitter": {} } } } } Add username and email as fallback values. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Bence Ferdinandy <bence@ferdinandy.com>
* contrib: add irc bot stuffRobin Jarry2023-07-0110-0/+251
| | | | | | | | | | | Add a small script to install a sourcehut webhook that triggers on patchset reception. Add a limnoria (supybot fork) plugin to receive the webhook requests and send IRC NOTICE messages on the proper channels. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Bence Ferdinandy <bence@ferdinandy.com>
* contrib: add carddav-query scriptRobin Jarry2023-06-011-0/+268
| | | | | | | | | | | Add a standalone python script to allow querying contacts from a CardDAV compatible server. The script works with python 3.6+ and has no external dependencies. Link: https://sabre.io/dav/building-a-carddav-client/ Link: https://www.rfc-editor.org/rfc/rfc6352 Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
* goflags.sh: silence errorsRobin Jarry2023-03-091-1/+1
| | | | | | | No need to print errors when notmuch.h is not found. The only point of this script to check if it is available or not. Signed-off-by: Robin Jarry <robin@jarry.cc>
* contrib: fix sendemail validate scriptRobin Jarry2023-03-081-8/+26
| | | | | | | | | | | | | | | | | | The current sendemail-validate script cannot be used for patch series. It works on each patch independently from the others and make it impossible to use when there are inter dependencies. I have submitted an alternate validate script that works on whole series which is still waiting for reviews. In the meantime, propose to use my script which can work. To install it in your environment: curl -Lo ~/.local/bin/git-send-email \ https://paste.sr.ht/blob/cedcf24383022949c8dc5bc1300cf5cbc879b36f echo 'export GIT_EXEC_PATH=$PATH:$(git --exec-path)' >> ~/.profile Link: https://lore.kernel.org/git/20230103231133.64050-1-robin@jarry.cc/ Link: https://paste.sr.ht/~rjarry/7e9a98866ba2c6f34e4169debf4f2c14b574613e Signed-off-by: Robin Jarry <robin@jarry.cc>
* mk: speed up notmuch detectionRobin Jarry2023-03-062-20/+19
| | | | | | | | | | | | | | | Use gcc instead of go to build a basic program and determine if notmuch is available. Building a minimal go program takes more than 300ms on a fast machine. A minimal C counterpart takes less than 100ms. To avoid lag when doing bash completion, avoid running any shell commands directly during make evaluation. Rename check-notmuch.sh to goflags.sh and make that script print the goflags directly. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Inwit <inwit@sindominio.net>
* mk: detect if notmuch headers & libs are availableRobin Jarry2023-03-031-0/+20
| | | | | | | | | | Detect if notmuch is available by trying to compile a minimal go program that uses the notmuch.h header and links to libnotmuch.so. If that succeeds, set the default GOFLAGS value to -tags=notmuch. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Inwit <inwit@sindominio.net>
* check-patches: report all errorsRobin Jarry2023-02-281-14/+18
| | | | | | | Instead of skipping to the next patch after the first error, report all issues. Change the output to make it more user friendly. Signed-off-by: Robin Jarry <robin@jarry.cc>
* contrib: add linter to check for panic handler in goroutinesRobin Jarry2023-01-061-0/+128
| | | | | | | | | | | | | | | | | If log.PanicHandler() is not installed in a goroutine and a panic occurs, the terminal state is not restored. This causes the panic trace to be unreadable since the terminal is broken. Add a custom analyzer that parses our code and ensures that: defer log.PanicHandler() is the first statement of all functions that are executed in goroutines. Include that linter in golangci config. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
* sendemail-validate: fix compat with older git versionsRobin Jarry2023-01-041-6/+6
| | | | | | | | | | Seen with git 2.34: error: unknown option `empty=drop' Check the patch file manually instead and abort early. Signed-off-by: Robin Jarry <robin@jarry.cc>
* sendemail-validate: ignore empty patches from cover letterRobin Jarry2022-12-211-1/+5
| | | | | | Avoid errors by checking cover letters as regular patches. Signed-off-by: Robin Jarry <robin@jarry.cc>
* ci: move check-patches at the end of pipelinesRobin Jarry2022-12-201-1/+1
| | | | | | | This is less important than reporting actual coding errors. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* check-patches: ignore .mailmap for author and s-o-b trailer checkRobin Jarry2022-12-201-1/+1
| | | | | | | We don't care that they are known in .mailmap as long as both match. Reported-by: Moritz Poldrack <moritz@poldrack.dev> Signed-off-by: Robin Jarry <robin@jarry.cc>
* sendemail-validate: add human readable recommendationsRobin Jarry2022-12-151-3/+11
| | | | | | | | | | | | When the patch fails to apply, users may get an obscure error from git: error: sha1 information is lacking or useless (commands/msg/reply.go). error: could not build fake ancestor Add explicit error messages indicating what happened and what should be done. Signed-off-by: Robin Jarry <robin@jarry.cc>
* contributing: add tooling for git send-emailRobin Jarry2022-12-142-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | Add a gitconfig target in the Makefile to configure a new clone with sane defaults: - set subject prefix - set correct mailing list address - enable sendemail.validate - install sendemail-validate hook The sendemail-validate hook will make a shallow clone of the current upstream repo, apply every patch on it and run some checks (a stripped down version of what is run by the upstream CI). Add a new check-patches script that verifies that the commit message actually contains something and that the Signed-off-by trailer from the patch author is present. Call check-patches in both the CI and the sendemail-validate hook. Update CONTRIBUTING.md accordingly. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* git-stats: add reviewer statsRobin Jarry2022-12-071-0/+14
| | | | | | Process shortlog stats for Acked-by, Reviewed-by and Tested-by trailers. Signed-off-by: Robin Jarry <robin@jarry.cc>
* git-stats.sh: strip trailing white spaceRobin Jarry2022-10-201-1/+2
| | | | Signed-off-by: Robin Jarry <robin@jarry.cc>
* contrib: add git-stats.shRobin Jarry2022-10-202-2/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git shortlog -sn is nice but it does not display the number of changed files and the amount of changed lines. $ git shortlog -sn 0.12.0.. 46 Tim Culverhouse 28 Robin Jarry 14 Koni Marti 9 Moritz Poldrack 2 Ben Cohen 2 Bence Ferdinandy 2 Julian Pidancet 2 inwit 1 Jason Cox 1 Jason Stewart 1 John Gebbie 1 Tobias Wölfel 1 kt programs Add a simple bash script that adds extra information: $ ./contrib/git-stats.sh 0.12.0.. Author Commits Changed Files Insertions Deletions Tim Culverhouse 46 134 +973 -1090 Robin Jarry 28 70 +671 -358 Koni Marti 14 47 +437 -205 Moritz Poldrack 9 18 +178 -44 Ben Cohen 2 2 +16 -2 Bence Ferdinandy 2 6 +104 +0 Julian Pidancet 2 9 +149 -2 inwit 2 3 +11 -1 Jason Cox 1 7 +106 -6 Jason Stewart 1 1 +4 -2 John Gebbie 1 3 +118 -1 Tobias Wölfel 1 3 +3 -3 kt programs 1 3 +37 -6 Use the script to generate the release tag and email. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-on-irc-by: Tim Culverhouse <tim@timculverhouse.com>
* lint: check for bad white space habitsRobin Jarry2022-10-191-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A little coding hygiene cannot hurt. Add a simple awk script to check all source files for bad white space habits: - trailing white space - trailing new lines at the end of files - missing new line at the end of files - spaces followed by tabs The script outputs color when the terminal supports it. It exits with a non-zero code when there was at least one white space issue found. Call the script in the lint step. Example output of the awk script: config/default_styleset:1:# <-- trailing whitespace config/default_styleset:3:# <-- trailing whitespace doc/aerc.1.scd:78: Executes an arbitrary command in the background. Aerc will set the <-- trailing whitespace doc/aerc.1.scd:234: <-- trailing whitespace doc/aerc.1.scd:237: <-- trailing whitespace worker/types/thread_test.go:74: // return ErrSkipThread<-- space(s) followed by tab(s) worker/lib/testdata/message/invalid/hexa: trailing new line(s) Fix issues reported by the script. NB: The ENDFILE match is a GNU extension. It will be ignored on BSD-awk and trailing new lines will not be detected. The lint make target is only invoked on alpine linux which has GNU awk anyway. NB: Empty cells in scdoc tables require trailing white space... Avoid this by setting content in these cells. I don't really see a use for empty cells. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Moritz Poldrack <moritz@poldrack.dev>
* Add changelogRobin Jarry2022-07-261-5/+9
| | | | | | | | | | | | Git history is not for everyone. Let's introduce a user-oriented change log. Ideally, this file should be updated incrementally when adding a new feature. I have added contributors guidelines in README.md. Update release.sh to automatically generate the release tag message with the unreleased changes from the changelog. Link: https://keepachangelog.com/en/1.0.0/ Signed-off-by: Robin Jarry <robin@jarry.cc>
* release.sh: fine tuningRobin Jarry2022-07-231-3/+5
| | | | | | | | | | | | | | | | | | Shuffle the To/Cc/Bcc headers to avoid people from doing reply all to ~sircmpwn/aerc@lists.sr.ht. Also add Cc: aerc-devel so that the lists archives all have the base message. Unfortunately, there is no way to prevent people from doing reply all and trying to send emails to aerc-announce. Putting aerc-announce in Bcc sounds very ugly. Include the person doing the release as Bcc. sendmail -t does not have a copy-to=Sent option. Use base32 and a shorter suffix for Message-ID. base64 is ugly. Use 'vi' if $EDITOR is unset. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* contrib: update script to release new versionRobin Jarry2022-06-272-4/+54
| | | | Signed-off-by: Robin Jarry <robin@jarry.cc>
* contrib: fix desktop fileMoritz Poldrack2022-03-071-11/+1
| | | | | | | | | | A Gentoo user found that the .desktop file was failing validation. Bug: https://bugs.gentoo.org/834145 Link: https://834145.bugs.gentoo.org/attachment.cgi?id=765905 Fixes: 5abc3cab96b7 ("contrib: add xdg desktop entry") Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* contrib: add xdg desktop entryMoritz Poldrack2022-02-191-0/+26
| | | | | | | | Add an XDG desktop file to handle mailto: links, to make it easier to reply to mailing list threads and compose emails with aerc in general. Signed-off-by: Moritz Poldrack <git@moritz.sh> Signed-off-by: Robin Jarry <robin@jarry.cc>
* Add contrib/_incr_versionDrew DeVault2020-05-191-0/+4
|
* Move contrib -> filtersDrew DeVault2019-06-273-62/+0
|
* Make awk filters more portableDrew DeVault2019-06-132-2/+0
|
* Fix hldiff regex for short statsDrew DeVault2019-06-072-1/+3
|
* Use #!/usr/bin/env -S awk -f for awk scriptsDrew DeVault2019-06-072-2/+2
|
* plaintext filter: Match against start of lineDrew DeVault2019-06-071-1/+1
|
* Rewrite Python filters in awkDrew DeVault2019-06-074-57/+52
|
* Move ANSI stripping from filters to GoDrew DeVault2019-06-072-4/+0
|
* Ignore encoding errors in filtersDrew DeVault2019-06-072-0/+2
| | | | Fixes #161
* hldiff.py: don't highlight -/+ in filenamesDrew DeVault2019-06-021-2/+2
|
* Add script for sandboxing w3mDrew DeVault2019-03-311-0/+10
|
* Improve plaintext.pyDrew DeVault2019-03-311-2/+2
|
* Add plaintext highlighter, escape ANSI in sourceDrew DeVault2019-03-312-1/+25
|
* Actually, git uses cyan for line markersDrew DeVault2019-03-301-1/+1
|