1

I'm trying to figure out a process by which multiple users are pulling a patchset review, making updates, and pushing but needing to rebase to the latest patchset.

  • So user 1 submits a change and now has a WIP gerrit review. -> patchset 1
  • So user 2 pulls his review say "git review -d 320" -> patchset 1
  • So now user 1 makes a new change, amends, and pushes, now the latest is patchset 2 (git commit -a --amend, git review -Rf)
  • Now user 2 makes a change, amends... but now he's behind on patchset 1, before pushing would like to check for any new patchsets and merge them down before pushing his changes up and creating patchset 3.

    Is this possible?

    I've tried "git review -N 320" and that seems to work fairly well but I would like to detect a newer patchset without actually downloading and merging it.

    Ideally i would like to put in a hook so it prompts the user to grab the latest patchset and merge changes before committing up.

    Maybe just a way to determine the local patchset version that was pulled so I can compare with the ls-remote patchset versions remotely?

    So this command will basically get me the latest patchset number up in git/gerrit... but i still don't know how to figure out which patchset i'm currently working on if i forgot which one i downloaded. --> think i have an acceptable solution for this.

    git ls-remote | grep /321/[0-9] | awk '{print $2}' | sort -V | tail -n 1 | sed 's/.*///g

  • Chris
    • 21
    • 5
    • Reviewer shall not modify code themselves AFAIWS. – 0andriy Sep 04 '19 at 19:53
    • Well let's say the flow allows it. What if the original user is out on vacation or something and there needs to be an update so it can be submitted. – Chris Sep 04 '19 at 20:17
    • Then process is doomed. Before vacation one may submit or after, rebase and submit. – 0andriy Sep 04 '19 at 20:22
    • 1
      And if you want to communicate with SO users in comments, don't forget to add `@user` to your replies. – 0andriy Sep 04 '19 at 20:22

    0 Answers0