1
0
www.mikescher.com/www/statics/programs/ExtendedGitGraph_description.md

70 lines
2.4 KiB
Markdown
Raw Normal View History

2019-12-28 15:18:51 +01:00
extendedGitGraph 2
==================
2017-11-08 17:39:50 +01:00
2018-01-21 15:29:01 +01:00
Displays a Commit Table for every of your github-years.
2019-12-28 15:18:51 +01:00
This is practically a copy of githubs commitGraph functionality.
But with the extra feature of showing commits older than a year and from different sources.
2018-01-21 15:29:01 +01:00
2019-12-28 15:18:51 +01:00
*See it live in action [here](http://www.mikescher.de/about)*
2018-01-21 15:29:01 +01:00
2019-12-28 15:18:51 +01:00
![](https://raw.githubusercontent.com/Mikescher/extendedGitGraph/master/README-DATA/preview.png)
2018-01-21 15:29:01 +01:00
2019-12-28 15:18:51 +01:00
### How to use:
2018-01-21 15:29:01 +01:00
2019-12-28 15:18:51 +01:00
#### Overview
2018-01-21 15:29:01 +01:00
2019-12-28 15:18:51 +01:00
There are 3 primary methods to call on the `ExtendedGitGraph2` object:
- `update()`: Query commit data from the respective git server APIs
- `updateCache()`: Create the HTML code and cache it
- `loadFromCache()`: Load the html code from cache and return it
A typical use case is to call `update()` and `updateCache()` eg once a day and call `loadFromCache()` every time you want to display the graph.
2018-01-21 15:29:01 +01:00
2019-12-28 15:18:51 +01:00
#### Cache
2018-01-21 15:29:01 +01:00
2019-12-28 15:18:51 +01:00
The commit data is cached in an sqlite database and the html code is cached in single html files.
2018-01-21 15:29:01 +01:00
2019-12-28 15:18:51 +01:00
#### Configuration
2018-01-21 15:29:01 +01:00
2019-12-28 15:18:51 +01:00
The `ExtendedGitGraph2` constructor wants a configuration array object.
For an example look at the file `example/config.php`.
2018-01-21 15:29:01 +01:00
2019-12-28 15:18:51 +01:00
A few important configurations are:
- The output methods (where the log is written to (stdout, session, file, ...))
- The directory for the cache files
- The identities (only commits from these email adresses are counted)
- The remote sources
#### Remote sources
2018-01-21 15:29:01 +01:00
2019-12-28 15:18:51 +01:00
In the config array you have to supply one or more sources for commit data.
Currently two types are supported: `github` and (self-hosted) `gitea`
2018-01-21 15:29:01 +01:00
2019-12-28 15:18:51 +01:00
Additionally you can supply an array of excluded repositories.
Also (for most remotes) you have to set some way of authentication (oauth, basic auth, etc)
2018-01-21 15:29:01 +01:00
2019-12-28 15:18:51 +01:00
#### Live status output
2018-01-21 15:29:01 +01:00
2019-12-28 15:18:51 +01:00
For a more interactive `update()` experience (it can take a few minutes depending how many repositories you have) you can set output_session to true and the output will be written to a session variable.
Then you can repeatedly query the session to get the current stdout.
For a (quick and dirty) written example see `example/index.php`.
2018-01-21 15:29:01 +01:00
2019-12-28 15:18:51 +01:00
#### CSS, javascript and themes
2018-01-21 15:29:01 +01:00
2019-12-28 15:18:51 +01:00
You need to include the supplied script.js and style.css (script.js only if you want to have the tooltip).
Also you can change the theme by editing the style.css and uncommenting the theme definitions.
2018-01-21 15:29:01 +01:00
2019-12-28 15:18:51 +01:00
There are a few predefined themes included:
2018-01-21 15:29:01 +01:00
- custom
- standard
- modern
- gray
- red
- blue
- purple
- orange
- halloween
2019-12-28 15:18:51 +01:00
#### Contribute
2018-01-21 15:29:01 +01:00
2019-12-28 15:18:51 +01:00
yes, please.