[skara] RFR: Improve the Download message in PR description
ehelin at openjdk.java.net
Tue Mar 16 09:49:54 UTC 2021
On Fri, 12 Mar 2021 15:15:06 GMT, Magnus Ihse Bursie <ihse at openjdk.org> wrote:
>> If you follow the instructions in the Download section to get a local copy of the PR, this works just fine. However, if you want to update your local copy when the PR has changed with new code, this turned out to be a non-trivial exercise in gitology for both me and Volker (and many more, I presume). I think this is understood from the context of the "Download" part.
> See this thread https://mail.openjdk.java.net/pipermail/skara-dev/2021-March/004322.html
Ok, I see what you want to do. My below instructions are not appropriate to add to the pull request body (due to the complexity of the commands), but the most ergonomic way to set this up is to just add a remote and add an additional fetch command:
1. `$ git remote add upstream https://git.openjdk.java.net/skara`
2. `$ git config --add remote.upstream.fetch '+refs/pull/*/head:refs/remotes/upstream/pull/*`
Then whenever you want to checkout a pull request locally you can just run
$ git fetch upstream # in case you haven't fetched in a while
$ git checkout pull/1053
The above will ensure that the local branch `pull/1053` tracks `refs/remotes/upstream/pull/1053` which in turn is updated from `refs/pull/1053/head` whenever you run `git fetch upstream` Again, a little bit _too_ long to add this information to pull request body, so I think we just go with your changes in this PR. Could potentially be something for an FAQ or the developer's guide?
More information about the skara-dev