From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Stefan Lendl <s.lendl@proxmox.com>,
Proxmox Backup Server development discussion
<pbs-devel@lists.proxmox.com>
Subject: Re: [pbs-devel] [RFC v2 proxmox-backup] git-hooks: pre-commit runs cargo fmt --check
Date: Mon, 15 Jan 2024 10:42:12 +0100 [thread overview]
Message-ID: <2479b88f-fcc4-4668-974d-fe9547ab77fc@proxmox.com> (raw)
In-Reply-To: <87zfx7hrnp.fsf@gmail.com>
Am 15/01/2024 um 10:28 schrieb Stefan Lendl:
> Thomas Lamprecht <t.lamprecht@proxmox.com> writes:
>> Am 12/01/2024 um 15:43 schrieb Stefan Lendl:
>>> * add a pre-commit hook that declines commiting if cargo fmt would make
>>
>> as said off-list I do not want anything that blocks committing,
>> that is a PITA in development especially as this doesn't gains us
>> much... so NAK!
>
> It's easy to overwrite the checks when committing with `git commit --no-verify`
Yeah I know, we even wrote about that in the same chat..
But what about rebasing et al.? And even if, one then just aliases
git commit to include that anyway, so making this both a nuisance
and not helpful at all at the same time. And like I said, I explicitly
wrote about only warning in our chat, not sure why you just go for a
hard fail without any acknowledge of that at all...
>> Let's rather add a fmt --check test to the buildbot, then we get
>> pinged on issues and a maintainer can just commit and push a cargo
>> fmt run without that much fuzz..
>>
>
> I agree adding a fmt check to a CI make absolute sense. As of now the
> buildbot is not triggered when sending a patch series. So the user will
> not get feedback.
This is not triggered either when sending a patch series though?!
And it wouldn't be triggered in any way if one never uses the
`make build` target too..
> Guarding locally against not-formatted commits, prevents user from
> sending these patches in the first place.
No it does not, besides that it doesn't hook into git send-email or
format-patch, it will be overridden due to interfering with
> The intent was to ensure style compliance BEFORE sending a patch series
> and not relying on a manual feedback process to identify this.
buildbot is not a manual feedback process, and having that sometimes
slightly bad formatted code go into the repo just does not matter AT
ALL compared to pissing of people developing, rebasing, ...
So this is not solving any real problem our development process has,
at least none that would actually advance our projects, so it won't
go in, and even if it would just warn, the current form is way to
invasive to be applied for that either – would be great if one thinks
about existing hook users when doing such changes.
> Once a CI is ready, this could and should be done in the CI.
>
buildbot is already running on every commit and sends out mails on
failures of actual feature commits, for those odd cases where one
forgot to run cargo fmt (or setup their editor to do so), doing it
there would be more than enough...
next prev parent reply other threads:[~2024-01-15 9:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-12 14:43 Stefan Lendl
2024-01-15 7:27 ` Thomas Lamprecht
2024-01-15 9:28 ` Stefan Lendl
2024-01-15 9:42 ` Thomas Lamprecht [this message]
2024-01-15 12:46 ` Lukas Wagner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2479b88f-fcc4-4668-974d-fe9547ab77fc@proxmox.com \
--to=t.lamprecht@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
--cc=s.lendl@proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox