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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 ## If you know how to use Git
Robert Sesek 2015/08/24 18:07:43 Delete
2
3 If you git clone `git.webkit.org` into `third_party/WebKit`, you can use Git wit hin your Chrome tree to work on WebKit. You just need to change one thing, desc ribed below:
4
5 (Not completely clear on what the difference is between checking out WebKit dire ctly vs. checking it out within a Chromium checkout. The difference might be tha t 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 pr ocedure results in WebKit HEAD being in the `master` branch, while the latest We bKit roll in Chromium is in the `gclient` branch.)
6
7 ### Setup
8 http://trac.webkit.org/wiki/UsingGitWithWebKit describes git checkout steps for WebKit.
9
10 <ol>
11 <li><code>rm -rf third_party/WebKit</code></li>
12 <li><code>git clone https://chromium.googlesource.com/chromium/blink third_party /WebKit</code></li>
13 <li>edit your <code>.gclient</code> "<code>custom_deps</code>" section to exclud e components underneath <code>third_party/WebKit</code>.<br>
14 <pre><code> "src/third_party/WebKit": None,<br>
15 </code></pre>
16 </li>
17 <li>see update steps below.</li>
18 </ol>
19
20 ### Updating
21 * `tools/sync-webkit-git.py`
22 * `gclient sync`
23 These commands only update the `gclient` branch of your git clone in `third_part y/WebKit`.
24 To ensure that your build is consistent between chromium and WebKit source and t o ensure that you don't commit to the `gclient` branch, you can either update yo ur _current branch_:
25 * `cd third_party/WebKit`
26 * `git rebase gclient`
27 * `cd -`
28 **OR** create a _new copy_ of the `gclient` branch:
29 * `cd third_party/WebKit`
30 * `git checkout gclient`
31 * `git checkout -b base` (or any branch name you like)
32 * `cd -`
33 Now when you build you will use the same code as the `gclient` branch and you ca n commit patches to your current branch. These commits will need to be merged/re based and tested on `master` before committing to WebKit.
34
35
36 ---
37
38 ## Tips
39 ### Sharing a top-level WebKit checkout in a Chromium checkout
40 Grab git-new-workdir at http://repo.or.cz/w/git.git/blob/HEAD:/contrib/workdir/g it-new-workdir.
41
42 ```
43 cd path/to/chromium/src/third_party
44 git-new-workdir path/to/WebKit/git/checkout WebKit
45 ```
46
47 The advantage of this is that you can avoid needing to maintain two separate Web Kit checkouts.
48
49 ### Avoid accidentally committing to the `gclient` branch
50 To avoid accidentally committing to the `gclient` branch, you can add the follow ing script as a pre-commit hook in the `.git/hooks/pre-commit` file in the `src/ third_party/WebKit` directory:
51 ```
52 #!/bin/bash
53
54 # Prevent commits against the "gclient" branch,
55 # which is external (managed by gclient script in Chromium)
56 if [[ `git rev-parse --abbrev-ref HEAD` == gclient ]]
57 then
58 echo "You cannot commit to the gclient branch!"
59 echo "Stash your changes and apply them to another branch, using:"
60 echo "git stash"
61 echo "git checkout <branch>"
62 echo "git stash apply"
63 exit 1
64 fi
65 ```
66
67
68 ---
69
70
71 ## FAQ
72 Q. Why doesn't `gclient sync` work without any fiddling?
73
74 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 gcl ient to leave the whole tree alone. (UsingGit)
75
76 Q. How are branches the WebKit tree related to the Chromium build?
77
78 A. The `tools/sync-webkit-git.py` script updates `third_party/WebKit` on the bra nch `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 `m ake` files build from whatever is on your filesystem, i.e., the build will refle ct the current branch at build time.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698