gerrit cli #18

Open
opened 2024-03-26 22:26:02 +00:00 by jade · 3 comments
Owner

@rbt requested

there aren't good gerrit clis at the moment. this is very silly and we really ought to have something nicer.

@rbt requested there aren't good gerrit clis at the moment. this is very silly and we really ought to have something nicer.
Owner

Features I'd like:

  • gerrit push instead of typing out the magic git push origin HEAD:refs/for/main invocation
  • gerrit checkout 452 to checkout a CL
  • gerrit down to check out the previous CL in a stack (and gerrit up for the next one)
  • Something that exports review comments to a Vim-compatible :cfile
Features I'd like: - `gerrit push` instead of typing out the magic `git push origin HEAD:refs/for/main` invocation - `gerrit checkout 452` to checkout a CL - `gerrit down` to check out the previous CL in a stack (and `gerrit up` for the next one) - Something that exports review comments to [a Vim-compatible `:cfile`](https://vimdoc.sourceforge.net/htmldoc/quickfix.html#:cfile)
Owner

for reference a few aliases we use:

[alias]
    fcl = !git fetch origin refs/changes/"${1:$((${#1}-2)):2}"/"$1"/"${2:-1}" && true
	gpush = push origin HEAD:refs/for/main
	# cocl = !git fcl "$@" && git checkout FETCH_HEAD && true
	cocl = !\
	 ps=$(\
	   ssh $(git config remote.origin.gerriturl) \
	     gerrit query --format=json --current-patch-set $1 \
        | jq -sr .[0].currentPatchSet.ref \
	 ) && git fetch origin $ps && git checkout FETCH_HEAD && true

that does "push" (gpush) and "checkout" (cocl). "down"/"up" should be easy enough to add by asking the current commit for its change-id, asking gerrit for the prev/next change, and checking that out?

for reference a few aliases we use: ``` [alias] fcl = !git fetch origin refs/changes/"${1:$((${#1}-2)):2}"/"$1"/"${2:-1}" && true gpush = push origin HEAD:refs/for/main # cocl = !git fcl "$@" && git checkout FETCH_HEAD && true cocl = !\ ps=$(\ ssh $(git config remote.origin.gerriturl) \ gerrit query --format=json --current-patch-set $1 \ | jq -sr .[0].currentPatchSet.ref \ ) && git fetch origin $ps && git checkout FETCH_HEAD && true ``` that does "push" (`gpush`) and "checkout" (`cocl`). "down"/"up" should be easy enough to add by asking the current commit for its change-id, asking gerrit for the prev/next change, and checking that out?
Owner

as a reminder also, I documented a way to avoid the need for the push magic at https://wiki.lix.systems/books/lix-contributors/page/gerrit#bkmrk-pushing

it's particularly nice in that it's just a one-time thing you do at the time you check the repo out, much like installing the commit-msg hook

as a reminder also, I documented a way to avoid the need for the push magic at https://wiki.lix.systems/books/lix-contributors/page/gerrit#bkmrk-pushing it's particularly nice in that it's just a one-time thing you do at the time you check the repo out, much like installing the commit-msg hook
rbt was assigned by jade 2024-04-01 21:39:01 +00:00
Sign in to join this conversation.
No labels
A-infra
A-matrix
No milestone
No project
No assignees
4 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/meta#18
No description provided.