aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/sendemail-validate
Commit message (Collapse)AuthorAgeFilesLines
* sendemail-validate: optionally use patatt to attest patchesMatěj Cepl2024-05-281-1/+8
| | | | | | | | | | | | | | | One weakness of the email based workflow as used on Sourcehut is that git send-email strips all signatures from commits. patatt is not strict equivalent of signed commits, but at least there is a cryptographic attestation that the patch was send by the person it pretends it was sent. Optional, default off, switched on by setting $ git config --bool sendemail.runPatatt true Signed-off-by: Matěj Cepl <mcepl@cepl.eu> Acked-by: Robin Jarry <robin@jarry.cc>
* sendemail-validate: add fallback for older gitRobin Jarry2024-04-131-1/+3
| | | | | | | | | | | | Before version 2.41, the sendemail-validate script can only be used to validate patches one by one, even when sending patch series. Set both GIT_SENDEMAIL_FILE_{COUNTER,TOTAL} to 1 in case they are not defined to avoid obscure errors. At least with older git versions, single patch validation should be possible. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com>
* mk: add validate targetRobin Jarry2024-03-041-3/+1
| | | | | | | | | | Instead of hiding the actual checks deep into the CI framework and into the sendemail-validate hook, add a validate make target that uses proper variables and runs the required checks. Use it in the sendemail-validate hook and the CI builds. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com>
* sendemail-validate: try regular make if gmake not availableJason Cox2024-01-071-1/+2
| | | | | | | | Some OSes (e.g., Arch Linux) ship GNU Make but only provide the `make` executable. Signed-off-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
* lint,validate: fix for openbsdRobin Jarry2023-12-141-4/+4
| | | | | | | | | | | | | | - Remove GNU specific stuff (ln -v, mktemp --tempdir, grep --color) - Remove GCC specific flags in sendemail-validate (-Warith-conversion) - Add -std=c99 and -Wpedantic and fix the reported warnings. - Explicitly call gmake everywhere. - Run our custom analyzer standalone. Golangci lint plugins are not supported on OpenBSD. Indirect dependency to golang.org/x/mod is required somehow... Reported-by: Johannes Thyssen Tishman <johannes@thyssentishman.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Johannes Thyssen Tishman <johannes@thyssentishman.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>
* contrib: update sendemail-validate hookRobin Jarry2023-08-041-30/+57
| | | | | | | | | 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: 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>
* 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>
* 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-141-0/+11
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>