View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001382 | Composr | core | public | 2013-08-31 10:39 | 2013-12-31 20:36 |
Reporter | Chris Graham | Assigned To | Chris Graham | ||
Severity | Feature-request | ||||
Status | resolved | Resolution | fixed | ||
Product Version | |||||
Fixed in Version | |||||
Summary | 0001382: Add git repository detection code | ||||
Description | It can be useful to auto-detect what git repository Composr is from, e.g. to customise a config file when switching between branches. We can add a new function to do it, but it must be in anything that loads the config file. | ||||
Additional Information | /** * Find the git branch name. * * @return ?ID_TEXT Branch name (NULL: not in git) */ function git_repos() { $path=dirname(__FILE__).'/.git/HEAD'; if (!is_file($path)) return ''; $lines=file($path); $parts=explode('/',$lines[0]); return trim(end($parts)); } | ||||
Tags | No tags attached. | ||||
Time estimation (hours) | 1 | ||||
Sponsorship open | |||||