blob: 7c4aed6a2a1b3de82660576b32f3b0bd5ac733ea [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```
Timothy Cyrus416c81c2016-01-28 22:53:20 -050015sudo apt-get install ant
16cd ${HOME}
17git clone https://github.com/facebook/buck.git
18cd buck
19ant
20sudo ln -s ${PWD}/bin/buck /usr/bin/buck
21cd /path/to/gitiles
22git submodule update --init
23buck build all
24buck test
Shawn Pearcea9b9e992015-02-20 16:57:23 -080025```
Eric Seidel48816fb2013-06-11 17:17:50 -070026
27
Shawn Pearcea9b9e992015-02-20 16:57:23 -080028Testing
29-------
Eric Seidel48816fb2013-06-11 17:17:50 -070030
Shawn Pearcea9b9e992015-02-20 16:57:23 -080031```
Timothy Cyrus416c81c2016-01-28 22:53:20 -050032cd /path/to/repositories # Don't run from the gitiles repo.
33/path/to/gitiles/tools/run_dev.sh
Shawn Pearcea9b9e992015-02-20 16:57:23 -080034```
Dave Borowitz4cecfb02014-03-21 09:49:57 -070035
Shawn Pearcea9b9e992015-02-20 16:57:23 -080036This will recompile and start a development server. Open
37http://localhost:8080/ to view your local copy of gitiles, which
38will serve any repositories under `/path/to/repositories`.
Eric Seidel48816fb2013-06-11 17:17:50 -070039
Jonathan Niederb3dabb12015-10-22 14:12:18 -070040To run unit tests, run `buck test`.
41
Eric Seidel48816fb2013-06-11 17:17:50 -070042
Shawn Pearcea9b9e992015-02-20 16:57:23 -080043Eclipse IDE
44-----------
Eric Seidel48816fb2013-06-11 17:17:50 -070045
Dave Borowitz4cecfb02014-03-21 09:49:57 -070046If you'd like to use Eclipse to edit Gitiles, first generate a project file:
Shawn Pearcea9b9e992015-02-20 16:57:23 -080047
48```
Timothy Cyrus416c81c2016-01-28 22:53:20 -050049./bucklets/tools/eclipse.py --src
Shawn Pearcea9b9e992015-02-20 16:57:23 -080050```
Eric Seidel48816fb2013-06-11 17:17:50 -070051
Dave Borowitz4cecfb02014-03-21 09:49:57 -070052Import the project in Eclipse:
Shawn Pearcea9b9e992015-02-20 16:57:23 -080053
54```
Timothy Cyrus416c81c2016-01-28 22:53:20 -050055File -> Import -> Existing Projects into Workpace
Shawn Pearcea9b9e992015-02-20 16:57:23 -080056```
Eric Seidel48816fb2013-06-11 17:17:50 -070057
Dave Borowitz4cecfb02014-03-21 09:49:57 -070058The project only needs to be rebuilt if the source roots or third-party
59libraries have changed. For best results, ensure the project is closed in
60Eclipse before rebuilding.
Eric Seidel48816fb2013-06-11 17:17:50 -070061
62
Dave Borowitzaa12bb22015-09-17 13:21:39 -040063Code Style
64----------
65
66Java code in Gitiles follows the [Google Java Style Guide]
67(https://google.github.io/styleguide/javaguide.html) with a 100-column limit.
68
69CSS in Gitiles follows the [SUIT CSS naming conventions]
70(https://github.com/suitcss/suit/blob/master/doc/naming-conventions.md).
71
Shawn Pearcea9b9e992015-02-20 16:57:23 -080072Code Review
73-----------
Eric Seidel48816fb2013-06-11 17:17:50 -070074
75Gitiles uses Gerrit for code review:
76https://gerrit-review.googlesource.com/
77
Shawn Pearcea9b9e992015-02-20 16:57:23 -080078Gitiles uses the ["git push" workflow][1] with server
79https://gerrit.googlesource.com/gitiles. You will need a
80[generated cookie][2].
81
82[1]: https://gerrit-review.googlesource.com/Documentation/user-upload.html#_git_push
83[2]: https://gerrit.googlesource.com/new-password
Eric Seidel48816fb2013-06-11 17:17:50 -070084
85Gerrit depends on "Change-Id" annotations in your commit message.
86If you try to push a commit without one, it will explain how to
87install the proper git-hook:
88
Shawn Pearcea9b9e992015-02-20 16:57:23 -080089```
Eric Seidel48816fb2013-06-11 17:17:50 -070090curl -Lo `git rev-parse --git-dir`/hooks/commit-msg \
91 https://gerrit-review.googlesource.com/tools/hooks/commit-msg
92chmod +x `git rev-parse --git-dir`/hooks/commit-msg
Shawn Pearcea9b9e992015-02-20 16:57:23 -080093```
Eric Seidel48816fb2013-06-11 17:17:50 -070094
95Before you create your local commit (which you'll push to Gerrit)
96you will need to set your email to match your Gerrit account:
Eric Seidel48816fb2013-06-11 17:17:50 -070097
Shawn Pearcea9b9e992015-02-20 16:57:23 -080098```
99git config --local --add user.email [email protected]
100```
101
102Normally you will create code reviews by pushing for master:
103
104```
Eric Seidel48816fb2013-06-11 17:17:50 -0700105git push origin HEAD:refs/for/master
Shawn Pearcea9b9e992015-02-20 16:57:23 -0800106```