re #111
" are automatically attached to task â„–111. Accordingly, " fix #111
" will close this task. Well, buns in the form of specifying references to revisions, viewing diffs between commits and so on. The main “master” repository is in our githaba, but I'm going to give it up. git config --global alias.incoming '!git remote update -p; git log ..@{u}'
git incoming
command, we see exactly what is poured to us. More here (link given in q & a ) git reflog
git log HEAD@{1}..HEAD@{0}
post-merge
hook is used. This hook looks at exactly which commits were uploaded, runs over each of them, if there is a task number, marks this task in the Production=true
mine, and at the end draws up a final list of changes, creates a task for the Robot (with the status "solved") and there records the changes. #!/usr/bin/php <?php require_once ('ActiveResource.php'); // . User . class Issue extends ActiveResource { var $site = 'http://redmine.site.com/'; var $request_format = 'xml'; var $extra_params = '?key=API_KEY'; } $issue = new Issue(); // , . exec('git log --pretty="%h=!=%an=!=%s" HEAD@{1}..HEAD@{0}',$logs); // , $s = ""; // foreach($logs as $log){ // , , list($hash, $name, $comment) = explode("=!=", $log); // echo $hash . " " . $name . " " . $comment . "\n"; // # - . $s .= "# "; // if(preg_match("/#\d+/", $comment, $ids)){ $id = substr($ids[0],1); $issue->find($id); // Production true. ID. 2. $issue->set("custom_fields", array("@type"=>"array", array("custom_field"=>array("@id"=>"2", "value"=>1)))); $issue->save(); // " " . alt . - . $s .= "+ " . $ids[0] . "+ "; } // .. - . . $s .= "commit:" . $hash; // $s .= " *".$name."*"; // , , 2 $comment = trim(preg_replace("/^.*#\d+/", "", $comment)); if(!empty($comment)){ $s .= ", _" . $comment . "_"; } $s .= "\n"; } // . $newIssue = new Issue(array ('subject' => ' Production', 'project_id' => '2')); // $newIssue->set("description", $s); // $newIssue->set("status_id",3); // $newIssue->set("assigned_to_id",12); $newIssue->save();
alias gl='git log --pretty="%Cgreen%h %Cblue%an%Creset %s %Cred%ar"'
gl
instead of git log
.Source: https://habr.com/ru/post/147877/
All Articles