{"thread":{"id":"28705","subject":"[PATCH] Git-p4: Add \"git p4 change\" command.","startedAt":"2011-10-17T22:16:38Z","lastAt":"2011-10-17T22:20:34Z","messageCount":2,"participants":["Andrei Warkentin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"177898","messageId":"1318889798-17334-1-git-send-email-andreiw@vmware.com","threadId":"28705","inReplyTo":null,"subject":"[PATCH] Git-p4: Add \"git p4 change\" command.","fromName":"Andrei Warkentin","fromEmail":"andreiw@vmware.com","sentAt":"2011-10-17T22:16:38Z","receivedAt":"2011-10-17T22:16:38Z","isPatch":true,"sender":{"key":"andreiw@vmware.com","avatar":null},"body":"Many users of p4/sd use changelists for review, regression\ntests and batch builds.\n\n\"p4 change\" is almost equivalent to \"p4 submit\", yet will\njust create the changelist and not submit it.\n\nSigned-off-by: Andrei Warkentin <andreiw@vmware.com>\n---\n contrib/fast-import/git-p4     |   16 ++++++++++++----\n contrib/fast-import/git-p4.txt |   10 ++++++++++\n 2 files changed, 22 insertions(+), 4 deletions(-)\n\ndiff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4\nindex 2f7b270..19c295b 100755\n--- a/contrib/fast-import/git-p4\n+++ b/contrib/fast-import/git-p4\n@@ -959,7 +959,10 @@ class P4Submit(Command, P4UserMap):\n                 submitTemplate = message[:message.index(separatorLine)]\n                 if self.isWindows:\n                     submitTemplate = submitTemplate.replace(\"\\r\\n\", \"\\n\")\n-                p4_write_pipe(\"submit -i\", submitTemplate)\n+                if gitConfig(\"git-p4.changeOnSubmit\"):\n+                    p4_write_pipe(\"change -i\", submitTemplate)\n+                else:\n+                    p4_write_pipe(\"subadasdmit -i\", submitTemplate)\n \n                 if self.preserveUser:\n                     if p4User:\n@@ -981,9 +984,14 @@ class P4Submit(Command, P4UserMap):\n             file = open(fileName, \"w+\")\n             file.write(self.prepareLogMessage(template, logMessage))\n             file.close()\n-            print (\"Perforce submit template written as %s. \"\n-                   + \"Please review/edit and then use p4 submit -i < %s to submit directly!\"\n-                   % (fileName, fileName))\n+            if gitConfig(\"git-p4.changeOnSubmit\"):\n+                print (\"Perforce submit template written as %s. \"\n+                       + \"Please review/edit and then use p4 change -i < %s to create changelist!\"\n+                       % (fileName, fileName))\n+            else:\n+                print (\"Perforce submit template written as %s. \"\n+                       + \"Please review/edit and then use p4 submit -i < %s to submit directly!\"\n+                       % (fileName, fileName))\n \n     def run(self, args):\n         if len(args) == 0:\ndiff --git a/contrib/fast-import/git-p4.txt b/contrib/fast-import/git-p4.txt\nindex 52003ae..3a3a815 100644\n--- a/contrib/fast-import/git-p4.txt\n+++ b/contrib/fast-import/git-p4.txt\n@@ -180,6 +180,16 @@ git-p4.allowSubmit\n \n   git config [--global] git-p4.allowSubmit false\n \n+git-p4.changeOnSubmit\n+\n+  git config [--global] git-p4.changeOnSubmit false\n+\n+Most places using p4/sourcedepot don't actually want you submit\n+changes directly, and changelists are used to do regression testing,\n+batch builds and review, hence, by setting this parameter to\n+true you acknowledge you end up creating a changelist which you\n+must then manually commit.\n+\n git-p4.syncFromOrigin\n \n A useful setup may be that you have a periodically updated git repository\n-- \n1.7.4.1\n"},{"id":"177900","messageId":"682349072.26755.1318890034730.JavaMail.root@zimbra-prod-mbox-2.vmware.com","threadId":"28705","inReplyTo":"1318889798-17334-1-git-send-email-andreiw@vmware.com","subject":"Re: [PATCH] Git-p4: Add \"git p4 change\" command.","fromName":"Andrei Warkentin","fromEmail":"awarkentin@vmware.com","sentAt":"2011-10-17T22:20:34Z","receivedAt":"2011-10-17T22:20:34Z","isPatch":true,"sender":{"key":"awarkentin@vmware.com","avatar":null},"body":"----- Original Message -----\n> From: \"Andrei Warkentin\" <andreiw@vmware.com>\n> To: git@vger.kernel.org, gitster@pobox.com\n> Cc: \"Andrei Warkentin\" <andreiw@vmware.com>\n> Sent: Monday, October 17, 2011 6:16:38 PM\n> Subject: [PATCH] Git-p4: Add \"git p4 change\" command.\n> \n> Many users of p4/sd use changelists for review, regression\n> tests and batch builds.\n> \n> \"p4 change\" is almost equivalent to \"p4 submit\", yet will\n> just create the changelist and not submit it.\n> \n> Signed-off-by: Andrei Warkentin <andreiw@vmware.com>\n> ---\n\nSorry for the spam, this is the wrong patch :-(.\n\nA\n"}]}