From 5935a357efd7be14481b21560347f70116891e16 Mon Sep 17 00:00:00 2001 From: "Justin J. Novack" Date: Sun, 16 Sep 2012 13:52:17 -0400 Subject: ADD: Commit as logged in user --- src/phorkie/Repository/Post.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/phorkie/Repository') diff --git a/src/phorkie/Repository/Post.php b/src/phorkie/Repository/Post.php index de987e0..ed44cf1 100644 --- a/src/phorkie/Repository/Post.php +++ b/src/phorkie/Repository/Post.php @@ -15,7 +15,7 @@ class Repository_Post * * @return boolean True if the post was successful */ - public function process($postData) + public function process($postData, $sessionData) { if (!isset($postData['files'])) { return false; @@ -117,11 +117,17 @@ class Repository_Post } } + $commitmsg = "phorkie commit"; + if (isset($sessionData['identity'])) { + $commitmsg .= " from ".$sessionData['identity']; + } else { + $commitmsg .= " by ".$sessionData['ipaddr']; + } + if ($bCommit) { $vc->getCommand('commit') - ->setOption('message', '') - ->setOption('allow-empty-message') - ->setOption('author', 'Anonymous ') + ->setOption('message', $commitmsg) + ->setOption('author', $sessionData['name'].' <'.$sessionData['email'].'>') ->execute(); $bChanged = true; } -- cgit v1.2.3 From 802794fcc585bbb6533c52b6a4c646829bd07b4d Mon Sep 17 00:00:00 2001 From: "Justin J. Novack" Date: Mon, 17 Sep 2012 21:47:23 -0400 Subject: FIX: Files without eol --- data/templates/display-sidebar-history.htm | 2 +- data/templates/new.htm | 2 +- data/templates/pager.htm | 2 +- src/phorkie/File.php | 2 +- src/phorkie/GitCommandBinary.php | 2 +- src/phorkie/HtmlHelper.php | 2 +- src/phorkie/Repository/Commit.php | 2 +- src/phorkie/Tool/Manager.php | 2 +- src/phorkie/Tool/Result.php | 2 +- src/phorkie/Tool/Result/Line.php | 2 +- src/phorkie/Tools.php | 2 +- www/js/phorkie.js | 2 +- www/tool.php | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src/phorkie/Repository') diff --git a/data/templates/display-sidebar-history.htm b/data/templates/display-sidebar-history.htm index b3ef9df..bf38884 100644 --- a/data/templates/display-sidebar-history.htm +++ b/data/templates/display-sidebar-history.htm @@ -15,4 +15,4 @@ {% else %}

No commits yet

{% endfor %} - \ No newline at end of file + diff --git a/data/templates/new.htm b/data/templates/new.htm index 5b75bba..89c2fe0 100644 --- a/data/templates/new.htm +++ b/data/templates/new.htm @@ -37,4 +37,4 @@ $(document).ready(function() { {% endfor %} {% endif %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/data/templates/pager.htm b/data/templates/pager.htm index 085a281..9be2b9f 100644 --- a/data/templates/pager.htm +++ b/data/templates/pager.htm @@ -45,4 +45,4 @@ {% endif %} -{% endif %} \ No newline at end of file +{% endif %} diff --git a/src/phorkie/File.php b/src/phorkie/File.php index 331f2e5..f378f60 100644 --- a/src/phorkie/File.php +++ b/src/phorkie/File.php @@ -165,4 +165,4 @@ class File } } -?> \ No newline at end of file +?> diff --git a/src/phorkie/GitCommandBinary.php b/src/phorkie/GitCommandBinary.php index 13a31db..a005349 100644 --- a/src/phorkie/GitCommandBinary.php +++ b/src/phorkie/GitCommandBinary.php @@ -12,4 +12,4 @@ class GitCommandBinary extends \VersionControl_Git_Util_Command } } -?> \ No newline at end of file +?> diff --git a/src/phorkie/HtmlHelper.php b/src/phorkie/HtmlHelper.php index af046cf..ea21ab5 100644 --- a/src/phorkie/HtmlHelper.php +++ b/src/phorkie/HtmlHelper.php @@ -25,4 +25,4 @@ class HtmlHelper } } -?> \ No newline at end of file +?> diff --git a/src/phorkie/Repository/Commit.php b/src/phorkie/Repository/Commit.php index 05c988b..62f1d40 100644 --- a/src/phorkie/Repository/Commit.php +++ b/src/phorkie/Repository/Commit.php @@ -70,4 +70,4 @@ class Repository_Commit } } -?> \ No newline at end of file +?> diff --git a/src/phorkie/Tool/Manager.php b/src/phorkie/Tool/Manager.php index 8e18199..ca93b4a 100644 --- a/src/phorkie/Tool/Manager.php +++ b/src/phorkie/Tool/Manager.php @@ -43,4 +43,4 @@ class Tool_Manager } } -?> \ No newline at end of file +?> diff --git a/src/phorkie/Tool/Result.php b/src/phorkie/Tool/Result.php index 22ea273..94dfe5e 100644 --- a/src/phorkie/Tool/Result.php +++ b/src/phorkie/Tool/Result.php @@ -6,4 +6,4 @@ class Tool_Result public $annotations; } -?> \ No newline at end of file +?> diff --git a/src/phorkie/Tool/Result/Line.php b/src/phorkie/Tool/Result/Line.php index a788db6..1fa8bcb 100644 --- a/src/phorkie/Tool/Result/Line.php +++ b/src/phorkie/Tool/Result/Line.php @@ -31,4 +31,4 @@ class Tool_Result_Line } } -?> \ No newline at end of file +?> diff --git a/src/phorkie/Tools.php b/src/phorkie/Tools.php index 843b2df..e4aab63 100644 --- a/src/phorkie/Tools.php +++ b/src/phorkie/Tools.php @@ -62,4 +62,4 @@ class Tools } -?> \ No newline at end of file +?> diff --git a/www/js/phorkie.js b/www/js/phorkie.js index 1171b1a..7078e8f 100644 --- a/www/js/phorkie.js +++ b/www/js/phorkie.js @@ -50,4 +50,4 @@ function toggleAdditional(elem, time) jt.children('i').toggleClass('icon-chevron-down') .toggleClass('icon-chevron-up'); jt.parents('.row-fluid').children('.additional').toggle(time); -} \ No newline at end of file +} diff --git a/www/tool.php b/www/tool.php index d42954c..647d6a7 100644 --- a/www/tool.php +++ b/www/tool.php @@ -30,4 +30,4 @@ render( ) ); -?> \ No newline at end of file +?> -- cgit v1.2.3 From 4293cbe275bec99763c9fd4bd5df347bd359599f Mon Sep 17 00:00:00 2001 From: "Justin J. Novack" Date: Tue, 18 Sep 2012 08:09:00 -0400 Subject: FIX: Add identity to notes rather than commit --- src/phorkie/Repository/Post.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/phorkie/Repository') diff --git a/src/phorkie/Repository/Post.php b/src/phorkie/Repository/Post.php index ed44cf1..9119e06 100644 --- a/src/phorkie/Repository/Post.php +++ b/src/phorkie/Repository/Post.php @@ -118,10 +118,11 @@ class Repository_Post } $commitmsg = "phorkie commit"; + if (isset($sessionData['identity'])) { - $commitmsg .= " from ".$sessionData['identity']; + $notes = $sessionData['identity']; } else { - $commitmsg .= " by ".$sessionData['ipaddr']; + $notes = $sessionData['ipaddr']; } if ($bCommit) { @@ -129,6 +130,11 @@ class Repository_Post ->setOption('message', $commitmsg) ->setOption('author', $sessionData['name'].' <'.$sessionData['email'].'>') ->execute(); + //FIXME: git needs ref BEFORE add. ideally VersionControl_Git needs to be updated + $vc->getCommand('notes --ref=identity add') + ->setOption('force') + ->setOption('message', "$notes") + ->execute(); $bChanged = true; } -- cgit v1.2.3