Auto setup gerrit commit-msg hook with nix develop #273

Closed
opened 2024-05-06 06:54:03 +00:00 by jade · 7 comments
Owner

Setting up the gerrit commit-msg hook seems kind of annoying and a barrier for new contributors. Maybe we could automate it with in-repo tooling offering to set it up for you in shellHook?

Setting up the gerrit `commit-msg` hook seems kind of annoying and a barrier for new contributors. Maybe we could automate it with in-repo tooling offering to set it up for you in shellHook?
jade added the
devx
E/help wanted
labels 2024-05-06 06:54:03 +00:00

I put together a tiny patch that will download it if it isn't present.

I'm new to using Gerrit but I think that's all that's needed? I built this patchset with the change and seemed to go fine.

I put together a tiny patch that will download it if it isn't present. I'm new to using Gerrit but I think that's all that's needed? I built this patchset with the change and seemed to go fine.
Owner

Huh, the "closes" tag in 268a411ed1 didn't close this issue. Might be a weird permissions thing? Anyway thank you @arcuru!

Huh, the "closes" tag in 268a411ed1e9dfd13dba4b752fcd6e3d095fb7d8 didn't close this issue. Might be a weird permissions thing? Anyway thank you @arcuru!
Author
Owner

fyi this is broken if first run from a worktree. i know how to fix it though, will send a patch. thanks so much for writing this!

fyi this is broken if first run from a worktree. i know how to fix it though, will send a patch. thanks so much for writing this!
Author
Owner

~~ah, no, it looks like you did the gerrit thing wrong and no change was created. you want to push like git push origin HEAD:refs/for/main rather than git push origin refs/sb/you/somebranch. ~~ wait no https://gerrit.lix.systems/c/lix/+/1054 exists, what. I'll pick up the change, fixup the bug I found, and push it with the workaround %base=refs/heads/main.

~~ah, no, it looks like you did the gerrit thing wrong and no change was created. you want to push like `git push origin HEAD:refs/for/main` rather than `git push origin refs/sb/you/somebranch`. ~~ wait no https://gerrit.lix.systems/c/lix/+/1054 exists, what. I'll pick up the change, fixup the bug I found, and push it with the workaround `%base=refs/heads/main`.

I pushed it to refs/sb/arcuru/commit-msg first as I was having some issues with Gerrit authentication. That may have messed up some references.

I pushed it to `refs/sb/arcuru/commit-msg` first as I was having some issues with Gerrit authentication. That may have messed up some references.
Author
Owner

oh, i see. Yeah that caused it to get replicated to forgejo which lightly confused qyriad since it would not close the issue unless it was on main. This workflow is fine, it just has some annoyance if you later want to push the changes for review as gerrit gets confused that it's already on a branch and you have to pass %base= to make it happy (https://gerrit-review.googlesource.com/Documentation/user-upload.html#base).

oh, i see. Yeah that caused it to get replicated to forgejo which lightly confused qyriad since it would not close the issue unless it was on `main`. This workflow is fine, it just has some annoyance if you later want to push the changes for review as gerrit gets confused that it's already on a branch and you have to pass `%base=` to make it happy (https://gerrit-review.googlesource.com/Documentation/user-upload.html#base).
Owner

Oops, so this should probably stay open in https://gerrit.lix.systems/c/lix/+/1054/ is actually merged, sorry 😅

Oops, so this should probably stay open in https://gerrit.lix.systems/c/lix/+/1054/ is actually merged, sorry 😅
qyriad reopened this issue 2024-05-07 21:40:28 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#273
No description provided.