From: Sam Bishop <Sam.Bishop@blackboard.com>
To: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: [PATCH] git=p4.py rebase now honor's client spec
Date: Thu, 19 Mar 2015 12:28:09 +0000 [thread overview]
Message-ID: <D1303946.5CED%Sam.Bishop@blackboard.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 801 bytes --]
When using the git-p4.py script, I found that if I used a client spec when
cloning out a perforce repository, and then using a git-p4.py rebase, that
the rebase command would be using the current perforce client spec,
instead of the one used when doing the initial clone. My proposed patch
causes the rebase command to switch to the perforce client spec used when
doing the initial git-p4.py clone.
This 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.
[-- Attachment #2: fix_git_p4_rebase.patch --]
[-- Type: application/octet-stream, Size: 1642 bytes --]
From c66fbd5019a2b8b6452166868b33ce426f93d96f Mon Sep 17 00:00:00 2001
From: Sam Bishop <Sam.Bishop@blackboard.com>
Date: Wed, 18 Mar 2015 15:26:48 -0400
Subject: [PATCH] Git-p4 rebase command will now honor perforce client spec.
When specifiying a client spec while cloning a perforce repo
the name of the client spec will now be saved in the .git/config
file, so that it may be referenced later when doing a git p4 rebase.
---
git-p4.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/git-p4.py b/git-p4.py
index ff132b2..f4f242a 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -1807,6 +1807,7 @@ class View(object):
self.client_prefix = "//%s/" % client_name
# cache results of "p4 where" to lookup client file locations
self.client_spec_path_cache = {}
+ self.client_name = client_name
def append(self, view_line):
"""Parse a view line, splitting it into depot and client
@@ -2787,6 +2788,7 @@ class P4Sync(Command, P4UserMap):
else:
if gitConfigBool("git-p4.useclientspec"):
self.useClientSpec = True
+ os.environ['P4CLIENT'] = gitConfig("git-p4.clientSpecName")
if self.useClientSpec:
self.clientSpecDirs = getClientSpec()
@@ -3177,6 +3179,7 @@ class P4Clone(P4Sync):
# auto-set this variable if invoked with --use-client-spec
if self.useClientSpec_from_options:
system("git config --bool git-p4.useclientspec true")
+ system(["git", "config", "--add", "git-p4.clientSpecName", self.clientSpecDirs.client_name])
return True
--
1.9.3 (Apple Git-50)
next reply other threads:[~2015-03-19 12:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-19 12:28 Sam Bishop [this message]
2015-03-19 21:58 ` [PATCH] git=p4.py rebase now honor's client spec brian m. carlson
2015-03-20 8:13 ` Luke Diamand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=D1303946.5CED%Sam.Bishop@blackboard.com \
--to=sam.bishop@blackboard.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).