W3C home > Mailing lists > Public > public-test-infra@w3.org > July to September 2014

Checking out PRs as local branches

From: Michael[tm] Smith <mike@w3.org>
Date: Mon, 14 Jul 2014 18:03:41 +0900
To: public-test-infra@w3.org
Message-ID: <20140714090340.GY13741@jay.w3.org>
This is just an FYI for anybody who's reviewing PRs.

Instead of needing to rely on the "w3c-test:mirror" thing to get a remote
copy of fork for a particular PR with tests that you can run, you can get a
local copy by actually checking out the PR to your w-p-t working directory.

To enable that, run the following command from within your w-p-t directory -

  git config --add remote.origin.fetch "+refs/pull/*/head:refs/remotes/origin/pr/*"

From then on, any time you fetch or pull from the remote w-p-t repo, you'll
automatically also fetch branches for all the PRs in the repo.

So the next time you do a "git fetch" or "git pull", after that you can
check out any particular PR like this:

  git checkout pr/519

Then, if the submittor of PR #519 subsequently pushes some further changes
to that PR, you can also pull those additional changes by doing this:

  git fetch
  git checkout pr/519
  git merge origin/pr/519

After that, you can run the tests from that PR just by going to
http://web-platform.test:8000 on your own machine and navigating to
whatever directory the tests for that PR are in.

I personally find this better and easier -- because I don't need to rely on
the "w3c-test:mirror" thing any longer, and I don't need to have an
Internet connection to check the test results for the PR, because I can
just run the tests locally (which is a nice feature to have when you want
to take a look at some PRs while you're, say, working while commuting to
the office by train, or on a long plane flight with no wifi).


Michael[tm] Smith http://people.w3.org/mike

Received on Monday, 14 July 2014 09:03:41 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:34:11 UTC