blob: b5cdfe196931469a1430469862e2d48bc3c8f8c6 [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
Dave Borowitzaa12bb22015-09-17 13:21:39 -040060Code Style
61----------
62
63Java code in Gitiles follows the [Google Java Style Guide]
64(https://google.github.io/styleguide/javaguide.html) with a 100-column limit.
65
66CSS in Gitiles follows the [SUIT CSS naming conventions]
67(https://github.com/suitcss/suit/blob/master/doc/naming-conventions.md).
68
Shawn Pearcea9b9e992015-02-20 16:57:23 -080069Code Review
70-----------
Eric Seidel48816fb2013-06-11 17:17:50 -070071
72Gitiles uses Gerrit for code review:
73https://gerrit-review.googlesource.com/
74
Shawn Pearcea9b9e992015-02-20 16:57:23 -080075Gitiles uses the ["git push" workflow][1] with server
76https://gerrit.googlesource.com/gitiles. You will need a
77[generated cookie][2].
78
79[1]: https://gerrit-review.googlesource.com/Documentation/user-upload.html#_git_push
80[2]: https://gerrit.googlesource.com/new-password
Eric Seidel48816fb2013-06-11 17:17:50 -070081
82Gerrit depends on "Change-Id" annotations in your commit message.
83If you try to push a commit without one, it will explain how to
84install the proper git-hook:
85
Shawn Pearcea9b9e992015-02-20 16:57:23 -080086```
Eric Seidel48816fb2013-06-11 17:17:50 -070087curl -Lo `git rev-parse --git-dir`/hooks/commit-msg \
88 https://gerrit-review.googlesource.com/tools/hooks/commit-msg
89chmod +x `git rev-parse --git-dir`/hooks/commit-msg
Shawn Pearcea9b9e992015-02-20 16:57:23 -080090```
Eric Seidel48816fb2013-06-11 17:17:50 -070091
92Before you create your local commit (which you'll push to Gerrit)
93you will need to set your email to match your Gerrit account:
Eric Seidel48816fb2013-06-11 17:17:50 -070094
Shawn Pearcea9b9e992015-02-20 16:57:23 -080095```
96git config --local --add user.email [email protected]
97```
98
99Normally you will create code reviews by pushing for master:
100
101```
Eric Seidel48816fb2013-06-11 17:17:50 -0700102git push origin HEAD:refs/for/master
Shawn Pearcea9b9e992015-02-20 16:57:23 -0800103```