| Dave Borowitz | eb794ea | 2012-11-12 14:48:15 -0800 | [diff] [blame] | 1 | Gitiles - A simple JGit repository browser |
| 2 | ========================================== |
| 3 | |
| 4 | Gitiles is a simple repository browser for Git repositories, built on JGit. Its |
| 5 | guiding principle is simplicity: it has no formal access controls, no write |
| 6 | access, no fancy Javascript, etc. |
| Eric Seidel | 48816fb | 2013-06-11 17:17:50 -0700 | [diff] [blame] | 7 | |
| 8 | |
| Shawn Pearce | a9b9e99 | 2015-02-20 16:57:23 -0800 | [diff] [blame] | 9 | Building |
| 10 | -------- |
| Eric Seidel | 48816fb | 2013-06-11 17:17:50 -0700 | [diff] [blame] | 11 | |
| Shawn Pearce | a9b9e99 | 2015-02-20 16:57:23 -0800 | [diff] [blame] | 12 | Gitiles requires [Buck](http://facebook.github.io/buck/) to build. |
| Eric Seidel | 48816fb | 2013-06-11 17:17:50 -0700 | [diff] [blame] | 13 | |
| Shawn Pearce | a9b9e99 | 2015-02-20 16:57:23 -0800 | [diff] [blame] | 14 | ``` |
| Dave Borowitz | 4cecfb0 | 2014-03-21 09:49:57 -0700 | [diff] [blame] | 15 | 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 Borowitz | 6007910 | 2014-07-29 12:51:05 -0700 | [diff] [blame] | 22 | git submodule update --init |
| Dave Borowitz | 4cecfb0 | 2014-03-21 09:49:57 -0700 | [diff] [blame] | 23 | buck build all |
| Jonathan Nieder | b3dabb1 | 2015-10-22 14:12:18 -0700 | [diff] [blame^] | 24 | buck test |
| Shawn Pearce | a9b9e99 | 2015-02-20 16:57:23 -0800 | [diff] [blame] | 25 | ``` |
| Eric Seidel | 48816fb | 2013-06-11 17:17:50 -0700 | [diff] [blame] | 26 | |
| 27 | |
| Shawn Pearce | a9b9e99 | 2015-02-20 16:57:23 -0800 | [diff] [blame] | 28 | Testing |
| 29 | ------- |
| Eric Seidel | 48816fb | 2013-06-11 17:17:50 -0700 | [diff] [blame] | 30 | |
| Shawn Pearce | a9b9e99 | 2015-02-20 16:57:23 -0800 | [diff] [blame] | 31 | ``` |
| Dave Borowitz | f530923 | 2014-07-29 12:50:40 -0700 | [diff] [blame] | 32 | cd /path/to/repositories # Don't run from the gitiles repo. |
| Dave Borowitz | 4cecfb0 | 2014-03-21 09:49:57 -0700 | [diff] [blame] | 33 | /path/to/gitiles/tools/run_dev.sh |
| Shawn Pearce | a9b9e99 | 2015-02-20 16:57:23 -0800 | [diff] [blame] | 34 | ``` |
| Dave Borowitz | 4cecfb0 | 2014-03-21 09:49:57 -0700 | [diff] [blame] | 35 | |
| Shawn Pearce | a9b9e99 | 2015-02-20 16:57:23 -0800 | [diff] [blame] | 36 | This will recompile and start a development server. Open |
| 37 | http://localhost:8080/ to view your local copy of gitiles, which |
| 38 | will serve any repositories under `/path/to/repositories`. |
| Eric Seidel | 48816fb | 2013-06-11 17:17:50 -0700 | [diff] [blame] | 39 | |
| Jonathan Nieder | b3dabb1 | 2015-10-22 14:12:18 -0700 | [diff] [blame^] | 40 | To run unit tests, run `buck test`. |
| 41 | |
| Eric Seidel | 48816fb | 2013-06-11 17:17:50 -0700 | [diff] [blame] | 42 | |
| Shawn Pearce | a9b9e99 | 2015-02-20 16:57:23 -0800 | [diff] [blame] | 43 | Eclipse IDE |
| 44 | ----------- |
| Eric Seidel | 48816fb | 2013-06-11 17:17:50 -0700 | [diff] [blame] | 45 | |
| Dave Borowitz | 4cecfb0 | 2014-03-21 09:49:57 -0700 | [diff] [blame] | 46 | If you'd like to use Eclipse to edit Gitiles, first generate a project file: |
| Shawn Pearce | a9b9e99 | 2015-02-20 16:57:23 -0800 | [diff] [blame] | 47 | |
| 48 | ``` |
| 49 | ./bucklets/tools/eclipse.py --src |
| 50 | ``` |
| Eric Seidel | 48816fb | 2013-06-11 17:17:50 -0700 | [diff] [blame] | 51 | |
| Dave Borowitz | 4cecfb0 | 2014-03-21 09:49:57 -0700 | [diff] [blame] | 52 | Import the project in Eclipse: |
| Shawn Pearce | a9b9e99 | 2015-02-20 16:57:23 -0800 | [diff] [blame] | 53 | |
| 54 | ``` |
| Dave Borowitz | 4cecfb0 | 2014-03-21 09:49:57 -0700 | [diff] [blame] | 55 | File -> Import -> Existing Projects into Workpace |
| Shawn Pearce | a9b9e99 | 2015-02-20 16:57:23 -0800 | [diff] [blame] | 56 | ``` |
| Eric Seidel | 48816fb | 2013-06-11 17:17:50 -0700 | [diff] [blame] | 57 | |
| Dave Borowitz | 4cecfb0 | 2014-03-21 09:49:57 -0700 | [diff] [blame] | 58 | The project only needs to be rebuilt if the source roots or third-party |
| 59 | libraries have changed. For best results, ensure the project is closed in |
| 60 | Eclipse before rebuilding. |
| Eric Seidel | 48816fb | 2013-06-11 17:17:50 -0700 | [diff] [blame] | 61 | |
| 62 | |
| Dave Borowitz | aa12bb2 | 2015-09-17 13:21:39 -0400 | [diff] [blame] | 63 | Code Style |
| 64 | ---------- |
| 65 | |
| 66 | Java code in Gitiles follows the [Google Java Style Guide] |
| 67 | (https://google.github.io/styleguide/javaguide.html) with a 100-column limit. |
| 68 | |
| 69 | CSS in Gitiles follows the [SUIT CSS naming conventions] |
| 70 | (https://github.com/suitcss/suit/blob/master/doc/naming-conventions.md). |
| 71 | |
| Shawn Pearce | a9b9e99 | 2015-02-20 16:57:23 -0800 | [diff] [blame] | 72 | Code Review |
| 73 | ----------- |
| Eric Seidel | 48816fb | 2013-06-11 17:17:50 -0700 | [diff] [blame] | 74 | |
| 75 | Gitiles uses Gerrit for code review: |
| 76 | https://gerrit-review.googlesource.com/ |
| 77 | |
| Shawn Pearce | a9b9e99 | 2015-02-20 16:57:23 -0800 | [diff] [blame] | 78 | Gitiles uses the ["git push" workflow][1] with server |
| 79 | https://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 Seidel | 48816fb | 2013-06-11 17:17:50 -0700 | [diff] [blame] | 84 | |
| 85 | Gerrit depends on "Change-Id" annotations in your commit message. |
| 86 | If you try to push a commit without one, it will explain how to |
| 87 | install the proper git-hook: |
| 88 | |
| Shawn Pearce | a9b9e99 | 2015-02-20 16:57:23 -0800 | [diff] [blame] | 89 | ``` |
| Eric Seidel | 48816fb | 2013-06-11 17:17:50 -0700 | [diff] [blame] | 90 | curl -Lo `git rev-parse --git-dir`/hooks/commit-msg \ |
| 91 | https://gerrit-review.googlesource.com/tools/hooks/commit-msg |
| 92 | chmod +x `git rev-parse --git-dir`/hooks/commit-msg |
| Shawn Pearce | a9b9e99 | 2015-02-20 16:57:23 -0800 | [diff] [blame] | 93 | ``` |
| Eric Seidel | 48816fb | 2013-06-11 17:17:50 -0700 | [diff] [blame] | 94 | |
| 95 | Before you create your local commit (which you'll push to Gerrit) |
| 96 | you will need to set your email to match your Gerrit account: |
| Eric Seidel | 48816fb | 2013-06-11 17:17:50 -0700 | [diff] [blame] | 97 | |
| Shawn Pearce | a9b9e99 | 2015-02-20 16:57:23 -0800 | [diff] [blame] | 98 | ``` |
| 99 | git config --local --add user.email [email protected] |
| 100 | ``` |
| 101 | |
| 102 | Normally you will create code reviews by pushing for master: |
| 103 | |
| 104 | ``` |
| Eric Seidel | 48816fb | 2013-06-11 17:17:50 -0700 | [diff] [blame] | 105 | git push origin HEAD:refs/for/master |
| Shawn Pearce | a9b9e99 | 2015-02-20 16:57:23 -0800 | [diff] [blame] | 106 | ``` |