Repository navigation
attempt-backport: simplify git steps - #107
Conversation
|
@phillipj Think you could still take a quick look at this today? |
|
Sorry, wasn't able to get a look tonight. Will do tomorrow morning
…On Thu, 15 Dec 2016 at 18:45, Jeremiah Senkpiel ***@***.***> wrote:
@phillipj <https://github.com/phillipj> Think you could still take a
quick look at this today?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#107 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABLLE2a8nq41QdrQBrB-9v4pJD3lyNenks5rIXyjgaJpZM4LOX1H>
.
|
|
Wrote down the commands executed to get a better mental map of what's happening, please correct me if I missed something: Before: $ git am --abort
$ git reset origin/v7.x-staging --hard
$ git remote update -p
$ git checkout origin/v7.x-staging
$ git clean -fd
$ git reset origin/v7.x-staging --hard
$ curl pr.patch | git amAfter: $ git am --abort
$ git remote update -p
$ git checkout origin/v7.x-staging
$ git clean -fd
$ curl pr.patch | git amAt first glance no doubt two reset shouldn't be necessary. I agree we could try without I do wonder if As a side note for later, it would be great to be able to write the expected shell commands executed like the examples above in a set of unit tests. That would allow us to agree on the commands listed in those tests, rather than having to understand the sequence of callbacks. |
|
I was testing with this: git am --abort
git remote update -p
git checkout upstream/v$1.x-staging
git clean -fdx // @rvagg hinted that I should add -x
curl -L https://github.com/nodejs/node/pull/$2.patch | git amAnd wasn't able to find when it would fail... @rvagg suggested I should just try it and I kinda agree we probably won't know otherwise because git is pretty darn complex.
Hmmm, I can't think of a case where that would happen? The purpose of that is ensure a clean slate when checking out older branches that may not ignore certain files. Perhaps that will never happen in the bot environment.
I recently heard of a thing to test bash scripts, maybe we could also use that? I still think we need to test the scripts but... it's a bit difficult. Trying to wrap my head around |
Okey, that makes sense. To rephrase my previous comment: might be good to ensure the repo is pristine before perform the checkout. Realised clean isn't sufficient tho, more like I'm okey with trying the changes in the PR as is and dig more if it still doesn't work as expected.
Maybe we should separate the git commands and GitHub interaction more than we currently do. Being able to verify the which git commands executes in a certain order, and which labels that should result in is what's important to verify IMO. The HTTP requests made to the GitHub API is trivial in comparison. |
- Resetting *before* checkout is probably actually faulty logic as described in nodejs#100 (comment) - Resetting after checkout is unnecessary because we check out the origin/ branch so the HEAD becomes detached. PR-URL: nodejs#107
1510a93 to
973cc52
Compare
Resetting before checkout is probably actually faulty logic as
described in
attempt-backport still does not work Edit: now working?! #100 (comment)
Resetting after checkout is unnecessary because we check out the
origin/ branch so the HEAD becomes detached.