You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mike Taylor edited this page May 13, 2020
·
5 revisions
This is a collection of notes that should make it easier for people to backport a patch from mozilla-central to this GitHub repository in the case it's needed. Note that this guide assumes you're using the Git-workflow for mozilla-central, and will not work if you're on Mercurial.
Discover if things changed
There are a couple of ways you can figure out if stuff changed.
Just export the sources into m-c and see if there are any unexpected changes. But that's not really great.
Run git log browser/extensions/webcompat/ inside mozilla-central, which will only show you the commits that changed something in the addon.
Generate a patch from a commit in mozilla-central
Find out the git hash for the commit you want to backport.
If you know the Mercurial hash, you can use git cinnabar hg2git [the mercurial commit hash], which will show you the Git commit hash in your local repository.
If you don't know the Mercurial hash, just check git log.
Change into the directory of the extension, cd browser/extensions/webcompat.
Run git format-patch -1 [git commit hash] --relative .. This will create a .patch file in the current directory.
Apply a generated patch
Make sure your local clone is on the master branch and updated.
Run git am -3 --directory src/ [path to the .patch file generated]
Make sure to push the changes. Pushing commits directly to master is usually fine, because the changes are in central anyway. If you're unsure, push the changes into a separate branch or a fork and open a PR for review.
This should apply the changes, and carry over commit information like timestamps and author information. Conflicts can occur if the patch is old and the GitHub version changed too much. Resolving conflicts is the same as resolving merge conflicts.