Skip to content

Instantly share code, notes, and snippets.

@pcdavid
Created June 17, 2023 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pcdavid/8c6f0da4600df5fcbd1295d20e101c2e to your computer and use it in GitHub Desktop.
Save pcdavid/8c6f0da4600df5fcbd1295d20e101c2e to your computer and use it in GitHub Desktop.
#!/bin/bash
export USER=pdavid
export SERVER=git.eclipse.org
export PROJECT_SHORT=sirius
export PROJECT_FULL=sirius/org.eclipse.sirius
ssh -p 29418 "$USER@$SERVER" gerrit query --format JSON --current-patch-set --no-limit status:open "project:$PROJECT_FULL" | \
tee -a "~/${PROJECT_SHORT}-open-changes.json" | \
jq -r '. | select(has("number")) | ("git fetch ssh://pdavid@git.eclipse.org:29418/sirius/org.eclipse.sirius " + .currentPatchSet.ref + " && git branch change/" + (.number | tostring) + "/" + (.currentPatchSet.number | tostring) + " FETCH_HEAD")' | \
while read fetchCmd; do sh -c "$fetchCmd"; sleep 10; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment