Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Unified Diff: docs/using_web_kit_git.md

Issue 1309473002: WIP: Migrate Wiki content over to src/docs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: documentation_best_practices.md Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: docs/using_web_kit_git.md
diff --git a/docs/using_web_kit_git.md b/docs/using_web_kit_git.md
new file mode 100644
index 0000000000000000000000000000000000000000..93ac02584d17ab15043a2dcf0f00f87b698bc86b
--- /dev/null
+++ b/docs/using_web_kit_git.md
@@ -0,0 +1,78 @@
+## If you know how to use Git
Robert Sesek 2015/08/24 18:07:43 Delete
+
+If you git clone `git.webkit.org` into `third_party/WebKit`, you can use Git within your Chrome tree to work on WebKit. You just need to change one thing, described below:
+
+(Not completely clear on what the difference is between checking out WebKit directly vs. checking it out within a Chromium checkout. The difference might be that direct WebKit checkout gets every WebKit revision, but within Chromium it only changes WebKit on WebKit rolls. If this is correct, then following the below procedure results in WebKit HEAD being in the `master` branch, while the latest WebKit roll in Chromium is in the `gclient` branch.)
+
+### Setup
+http://trac.webkit.org/wiki/UsingGitWithWebKit describes git checkout steps for WebKit.
+
+<ol>
+<li><code>rm -rf third_party/WebKit</code></li>
+<li><code>git clone https://chromium.googlesource.com/chromium/blink third_party/WebKit</code></li>
+<li>edit your <code>.gclient</code> "<code>custom_deps</code>" section to exclude components underneath <code>third_party/WebKit</code>.<br>
+<pre><code> "src/third_party/WebKit": None,<br>
+</code></pre>
+</li>
+<li>see update steps below.</li>
+</ol>
+
+### Updating
+ * `tools/sync-webkit-git.py`
+ * `gclient sync`
+These commands only update the `gclient` branch of your git clone in `third_party/WebKit`.
+To ensure that your build is consistent between chromium and WebKit source and to ensure that you don't commit to the `gclient` branch, you can either update your _current branch_:
+ * `cd third_party/WebKit`
+ * `git rebase gclient`
+ * `cd -`
+**OR** create a _new copy_ of the `gclient` branch:
+ * `cd third_party/WebKit`
+ * `git checkout gclient`
+ * `git checkout -b base` (or any branch name you like)
+ * `cd -`
+Now when you build you will use the same code as the `gclient` branch and you can commit patches to your current branch. These commits will need to be merged/rebased and tested on `master` before committing to WebKit.
+
+
+---
+
+## Tips
+### Sharing a top-level WebKit checkout in a Chromium checkout
+Grab git-new-workdir at http://repo.or.cz/w/git.git/blob/HEAD:/contrib/workdir/git-new-workdir.
+
+```
+cd path/to/chromium/src/third_party
+git-new-workdir path/to/WebKit/git/checkout WebKit
+```
+
+The advantage of this is that you can avoid needing to maintain two separate WebKit checkouts.
+
+### Avoid accidentally committing to the `gclient` branch
+To avoid accidentally committing to the `gclient` branch, you can add the following script as a pre-commit hook in the `.git/hooks/pre-commit` file in the `src/third_party/WebKit` directory:
+```
+#!/bin/bash
+
+# Prevent commits against the "gclient" branch,
+# which is external (managed by gclient script in Chromium)
+if [[ `git rev-parse --abbrev-ref HEAD` == gclient ]]
+then
+ echo "You cannot commit to the gclient branch!"
+ echo "Stash your changes and apply them to another branch, using:"
+ echo "git stash"
+ echo "git checkout <branch>"
+ echo "git stash apply"
+ exit 1
+fi
+```
+
+
+---
+
+
+## FAQ
+Q. Why doesn't `gclient sync` work without any fiddling?
+
+A. Our `DEPS` specifies to only pull some subdirectories of `third_party/WebKit`. Git works with full trees, so we just pull the whole WebKit tree and tell gclient to leave the whole tree alone. (UsingGit)
+
+Q. How are branches the WebKit tree related to the Chromium build?
+
+A. The `tools/sync-webkit-git.py` script updates `third_party/WebKit` on the branch `gclient`. Don't commit to the `gclient` branch, it might confuse the update script (you can use the above pre-commit hook to prevent this). The chromium `make` files build from whatever is on your filesystem, i.e., the build will reflect the current branch at build time.

Powered by Google App Engine
This is Rietveld 408576698