remote forking: use the original http/https url in description
[phorkie.git] / src / phorkie / Repository / Post.php
index ed44cf1535bd030d2f3ff364e8c4e6d4c23d02b1..f94d9ab755d4ddc492451b19f54cdef8fb7a3d4a 100644 (file)
@@ -117,18 +117,24 @@ 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) {
             $vc->getCommand('commit')
-                ->setOption('message', $commitmsg)
+                ->setOption('message', '')
+                ->setOption('allow-empty-message')
                 ->setOption('author', $sessionData['name'].' <'.$sessionData['email'].'>')
                 ->execute();
+            //FIXME: git needs ref BEFORE add
+            //quick hack until http://pear.php.net/bugs/bug.php?id=19605 is fixed
+            $vc->getCommand('notes --ref=identity add')
+                               ->setOption('force')
+                ->setOption('message', "$notes")
+                ->execute();
             $bChanged = true;
         }