This document contains information used by the editors maintaining the specification.
Note: The following references the main spec, but similar steps apply for registry files.
index.html
is the published version of the specification.
Unlike some other ReSpec-based specifications, this one does not rely on runtime generation when viewing the specification.
Thus, a new index.html
must be generated, committed, and pushed in order for changes to the -respec.html
file to be reflected.
We generally do this for every commit, but sometimes we only generate the file once for a series of commits.
Use the following steps to publish the new index.html after modifying the -respec.html
file:
- Open an Incognito or private browsing window. (This generally ensures that extensions are not loaded and will not interfere with the output.)
- Open the
-respec.html
file in that window. - Verify that there are no errors next to the ReSpec bubble in the upper right corner.
- Verify that ReSpec completed and there are no exceptions by checking the browser's console (e.g.,
Ctrl+Shift+i
). You should see no messages. - ReSpec button => Save Snapshot => Save as HTML
mv ~/Downloads/index.html ./
- Review the diff in a tool like
gitk
.
-respec.html
should contain just your edits.index.html
should generally contain diffes related to your edits. However, sometimes, such as when a Note is added or ReSpec has been updated, there will be lots of unrelated changes.
git commit -a
git push
This spec does not use the green "Merge pull request" button. This ensures that each change is a single commit on the main gh-pages
branch.
The following subsections contain instructions for merging. They assume the Bash functions that follow them are present.
-
git checkout gh-pages
-
pr <pull request ID>
-
If the pull request contains multiple commits, squash them as appropriate.
- In general, all commits and merges should be squashed into a single commit.
- If commits or sets of commits represent multiple distinct actions (e.g., do something then rename a variable), then the branch might be squashed into two or more commits, each representing a distinct action.
- Squash commits by running
git rebase -i origin/gh-pages
then usingsquash
on the commit(s) to be squashed.
-
If index.html is not part of the pull request and needs to be updated:
-
Generate index.html.
-
Run the following:
```
git add index.html
git commit --amend
```
-
If the commit message needs to be updated (e.g., to add "Fix #<bug ID>: "), do one of the following and update the message:
- Run
git rebase -i origin/gh-pages
then usereword
to select the commit(s) to reword. - Run
git commit --amend
and edit the last commit message.
- Run
-
git push
-
Close the pull request by following these steps in the web interface:
-
Let
hash
be the the commit hash. -
Navigate to the pull request.
-
Add a comment that say "Merged as
hash
." and click the "Close pull request" button to post that comment.
For pull requests coming from branches within this repository, use the same steps above except use mypr
and there is no reason to use the web interface.
git push
will automatically close the pull request and mark it as merged, since the commits contained there were updated.
The following is based on https://github.com/whatwg/html/blob/master/TEAM.md.
pr () {
git fetch origin refs/pull/$1/head:refs/remotes/origin/pr/$1 --force
git checkout -b pr/$1 origin/pr/$1
git rebase gh-pages
git checkout gh-pages
git merge pr/$1 --ff-only
}
Pulls down the PR into a local branch, using the special refs GitHub provides; rebases the PR's commits on top of gh-pages
; and does a fast-forward only merge into gh-pages
.
mypr () {
git checkout $1
git rebase gh-pages
git push origin $1 --force
git checkout gh-pages
git merge $1 --ff-only
}
Rebases the PR on top of gh-pages
; force-pushes it to the appropriate branch, thus updating the PR; and does the fast-forward only merge into gh-pages
.