blob: b604e0de5d85c986fb552ffacc524d202195ea7a [file] [log] [blame] [view]
Dave Borowitzeb794ea2012-11-12 14:48:15 -08001Gitiles - A simple JGit repository browser
2==========================================
3
4Gitiles is a simple repository browser for Git repositories, built on JGit. Its
5guiding principle is simplicity: it has no formal access controls, no write
6access, no fancy Javascript, etc.
Eric Seidel48816fb2013-06-11 17:17:50 -07007
8
Shawn Pearcea9b9e992015-02-20 16:57:23 -08009Building
10--------
Eric Seidel48816fb2013-06-11 17:17:50 -070011
Shawn Pearcea9b9e992015-02-20 16:57:23 -080012Gitiles requires [Buck](http://facebook.github.io/buck/) to build.
Eric Seidel48816fb2013-06-11 17:17:50 -070013
Shawn Pearcea9b9e992015-02-20 16:57:23 -080014```
Dave Borowitz4cecfb02014-03-21 09:49:57 -070015 sudo apt-get install ant
16 cd ${HOME}
17 git clone https://github.com/facebook/buck.git
18 cd buck
19 ant
20 sudo ln -s ${PWD}/bin/buck /usr/bin/buck
21 cd /path/to/gitiles
Dave Borowitz60079102014-07-29 12:51:05 -070022 git submodule update --init
Dave Borowitz4cecfb02014-03-21 09:49:57 -070023 buck build all
Shawn Pearcea9b9e992015-02-20 16:57:23 -080024```
Eric Seidel48816fb2013-06-11 17:17:50 -070025
26
Shawn Pearcea9b9e992015-02-20 16:57:23 -080027Testing
28-------
Eric Seidel48816fb2013-06-11 17:17:50 -070029
Shawn Pearcea9b9e992015-02-20 16:57:23 -080030```
Dave Borowitzf5309232014-07-29 12:50:40 -070031 cd /path/to/repositories # Don't run from the gitiles repo.
Dave Borowitz4cecfb02014-03-21 09:49:57 -070032 /path/to/gitiles/tools/run_dev.sh
Shawn Pearcea9b9e992015-02-20 16:57:23 -080033```
Dave Borowitz4cecfb02014-03-21 09:49:57 -070034
Shawn Pearcea9b9e992015-02-20 16:57:23 -080035This will recompile and start a development server. Open
36http://localhost:8080/ to view your local copy of gitiles, which
37will serve any repositories under `/path/to/repositories`.
Eric Seidel48816fb2013-06-11 17:17:50 -070038
39
Shawn Pearcea9b9e992015-02-20 16:57:23 -080040Eclipse IDE
41-----------
Eric Seidel48816fb2013-06-11 17:17:50 -070042
Dave Borowitz4cecfb02014-03-21 09:49:57 -070043If you'd like to use Eclipse to edit Gitiles, first generate a project file:
Shawn Pearcea9b9e992015-02-20 16:57:23 -080044
45```
46 ./bucklets/tools/eclipse.py --src
47```
Eric Seidel48816fb2013-06-11 17:17:50 -070048
Dave Borowitz4cecfb02014-03-21 09:49:57 -070049Import the project in Eclipse:
Shawn Pearcea9b9e992015-02-20 16:57:23 -080050
51```
Dave Borowitz4cecfb02014-03-21 09:49:57 -070052 File -> Import -> Existing Projects into Workpace
Shawn Pearcea9b9e992015-02-20 16:57:23 -080053```
Eric Seidel48816fb2013-06-11 17:17:50 -070054
Dave Borowitz4cecfb02014-03-21 09:49:57 -070055The project only needs to be rebuilt if the source roots or third-party
56libraries have changed. For best results, ensure the project is closed in
57Eclipse before rebuilding.
Eric Seidel48816fb2013-06-11 17:17:50 -070058
59
Shawn Pearcea9b9e992015-02-20 16:57:23 -080060Code Review
61-----------
Eric Seidel48816fb2013-06-11 17:17:50 -070062
63Gitiles uses Gerrit for code review:
64https://gerrit-review.googlesource.com/
65
Shawn Pearcea9b9e992015-02-20 16:57:23 -080066Gitiles uses the ["git push" workflow][1] with server
67https://gerrit.googlesource.com/gitiles. You will need a
68[generated cookie][2].
69
70[1]: https://gerrit-review.googlesource.com/Documentation/user-upload.html#_git_push
71[2]: https://gerrit.googlesource.com/new-password
Eric Seidel48816fb2013-06-11 17:17:50 -070072
73Gerrit depends on "Change-Id" annotations in your commit message.
74If you try to push a commit without one, it will explain how to
75install the proper git-hook:
76
Shawn Pearcea9b9e992015-02-20 16:57:23 -080077```
Eric Seidel48816fb2013-06-11 17:17:50 -070078curl -Lo `git rev-parse --git-dir`/hooks/commit-msg \
79 https://gerrit-review.googlesource.com/tools/hooks/commit-msg
80chmod +x `git rev-parse --git-dir`/hooks/commit-msg
Shawn Pearcea9b9e992015-02-20 16:57:23 -080081```
Eric Seidel48816fb2013-06-11 17:17:50 -070082
83Before you create your local commit (which you'll push to Gerrit)
84you will need to set your email to match your Gerrit account:
Eric Seidel48816fb2013-06-11 17:17:50 -070085
Shawn Pearcea9b9e992015-02-20 16:57:23 -080086```
87git config --local --add user.email [email protected]
88```
89
90Normally you will create code reviews by pushing for master:
91
92```
Eric Seidel48816fb2013-06-11 17:17:50 -070093git push origin HEAD:refs/for/master
Shawn Pearcea9b9e992015-02-20 16:57:23 -080094```