{"thread":{"id":"38855","subject":"[PATCH] git=p4.py rebase now honor's client spec","startedAt":"2015-03-19T12:28:09Z","lastAt":"2015-03-20T08:13:54Z","messageCount":3,"participants":["Sam Bishop","brian m. carlson","Luke Diamand"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"258022","messageId":"D1303946.5CED%Sam.Bishop@blackboard.com","threadId":"38855","inReplyTo":null,"subject":"[PATCH] git=p4.py rebase now honor's client spec","fromName":"Sam Bishop","fromEmail":"sam.bishop@blackboard.com","sentAt":"2015-03-19T12:28:09Z","receivedAt":"2015-03-19T12:28:09Z","isPatch":true,"sender":{"key":"sam.bishop@blackboard.com","avatar":null},"body":"When using the git-p4.py script, I found that if I used a client spec when\ncloning out a perforce repository, and then using a git-p4.py rebase, that\nthe rebase command would be using the current perforce client spec,\ninstead of the one used when doing the initial clone. My proposed patch\ncauses the rebase command to switch to the perforce client spec used when\ndoing the initial git-p4.py clone.\n\nThis email and any attachments may contain confidential and proprietary information of Blackboard that is for the sole use of the intended recipient. If you are not the intended recipient, disclosure, copying, re-distribution or other use of any of this information is strictly prohibited. Please immediately notify the sender and delete this transmission if you received this email in error.\n\n\nFrom c66fbd5019a2b8b6452166868b33ce426f93d96f Mon Sep 17 00:00:00 2001\nFrom: Sam Bishop <Sam.Bishop@blackboard.com>\nDate: Wed, 18 Mar 2015 15:26:48 -0400\nSubject: [PATCH] Git-p4 rebase command will now honor perforce client spec.\n\nWhen specifiying a client spec while cloning a perforce repo\nthe name of the client spec will now be saved in the .git/config\nfile, so that it may be referenced later when doing a git p4 rebase.\n---\n git-p4.py | 3 +++\n 1 file changed, 3 insertions(+)\n\ndiff --git a/git-p4.py b/git-p4.py\nindex ff132b2..f4f242a 100755\n--- a/git-p4.py\n+++ b/git-p4.py\n@@ -1807,6 +1807,7 @@ class View(object):\n         self.client_prefix = \"//%s/\" % client_name\n         # cache results of \"p4 where\" to lookup client file locations\n         self.client_spec_path_cache = {}\n+        self.client_name = client_name\n \n     def append(self, view_line):\n         \"\"\"Parse a view line, splitting it into depot and client\n@@ -2787,6 +2788,7 @@ class P4Sync(Command, P4UserMap):\n         else:\n             if gitConfigBool(\"git-p4.useclientspec\"):\n                 self.useClientSpec = True\n+                os.environ['P4CLIENT'] = gitConfig(\"git-p4.clientSpecName\")\n         if self.useClientSpec:\n             self.clientSpecDirs = getClientSpec()\n \n@@ -3177,6 +3179,7 @@ class P4Clone(P4Sync):\n         # auto-set this variable if invoked with --use-client-spec\n         if self.useClientSpec_from_options:\n             system(\"git config --bool git-p4.useclientspec true\")\n+            system([\"git\", \"config\", \"--add\", \"git-p4.clientSpecName\", self.clientSpecDirs.client_name])\n \n         return True\n \n-- \n1.9.3 (Apple Git-50)\n\n"},{"id":"258069","messageId":"20150319215816.GI612775@vauxhall.crustytoothpaste.net","threadId":"38855","inReplyTo":"D1303946.5CED%Sam.Bishop@blackboard.com","subject":"Re: [PATCH] git=p4.py rebase now honor's client spec","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2015-03-19T21:58:17Z","receivedAt":"2015-03-19T21:58:17Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On Thu, Mar 19, 2015 at 12:28:09PM +0000, Sam Bishop wrote:\n> When using the git-p4.py script, I found that if I used a client spec when\n> cloning out a perforce repository, and then using a git-p4.py rebase, that\n> the rebase command would be using the current perforce client spec,\n> instead of the one used when doing the initial clone. My proposed patch\n> causes the rebase command to switch to the perforce client spec used when\n> doing the initial git-p4.py clone.\n> \n> This email and any attachments may contain confidential and\n> proprietary information of Blackboard that is for the sole use of the\n> intended recipient. If you are not the intended recipient, disclosure,\n> copying, re-distribution or other use of any of this information is\n> strictly prohibited. Please immediately notify the sender and delete\n> this transmission if you received this email in error.\n\nYou might want to read Documentation/SubmittingPatches for information\non patch submission procedures.  Most notably, you'll need to sign-off\nyour work to indicate that you can submit it under the appropriate\nlicense.\n\nThe confidentiality notice above is not only inappropriate for a public\nmailing list, it discourages people from even looking at your patch, as\nyou just claimed it was confidential and proprietary and nobody wants to\nbe sued.\n-- \nbrian m. carlson / brian with sandals: Houston, Texas, US\n+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only\nOpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187\n"},{"id":"258091","messageId":"550BD6C2.4070208@diamand.org","threadId":"38855","inReplyTo":"20150319215816.GI612775@vauxhall.crustytoothpaste.net","subject":"Re: [PATCH] git=p4.py rebase now honor's client spec","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2015-03-20T08:13:54Z","receivedAt":"2015-03-20T08:13:54Z","isPatch":true,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"On 19/03/15 21:58, brian m. carlson wrote:\n> On Thu, Mar 19, 2015 at 12:28:09PM +0000, Sam Bishop wrote:\n>> When using the git-p4.py script, I found that if I used a client spec when\n>> cloning out a perforce repository, and then using a git-p4.py rebase, that\n>> the rebase command would be using the current perforce client spec,\n>> instead of the one used when doing the initial clone. My proposed patch\n>> causes the rebase command to switch to the perforce client spec used when\n>> doing the initial git-p4.py clone.\n>>\n\nThat's very useful, thanks. I've noticed that behaviour in the past and \nalways thought it ought to be fixed. As Brian notes, it needs a \n\"Signed-off\" line in the patch.\n\nA very small nit: could you prefix the subject with \"git p4:\" so that \nit's consistent with other recent git-p4 changes - it makes it easier to \npick them out when reviewing changes.\n\nCould you run the git-p4 unit tests on it please (t/t98*)? I could be \nwrong about this, but it looks to me like t9806-git-p4-options.sh \ndoesn't pass now with this change (*)\n\nThanks!\nLuke\n\n(*) There's at least one test that doesn't pass anyway, but this seems \nto be new.\n"}]}