* [PATCH] Modifying RCS keywords prevents submitting to p4 from git due to missing hunks. Optional shrinking of RCS keywords in git-p4. New option git-p4.kwstrip set to true or false controls the behavior
@ 2008-09-15 4:16 Dhruva Krishnamurthy
0 siblings, 0 replies; 2+ messages in thread
From: Dhruva Krishnamurthy @ 2008-09-15 4:16 UTC (permalink / raw)
To: GIT SCM <git@vger.kernel.org>; Junio C Hamano; +Cc: Dhruva Krishnamurthy
Signed-off-by: Dhruva Krishnamurthy <dhruva@ymail.com>
---
contrib/fast-import/git-p4 | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 2216cac..ac8b7f7 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -16,6 +16,9 @@ from sets import Set;
verbose = False
+# Handling of RCS keyowrds. To ensure backward compatibility, the default
+# is to strip keywords. Default behavior is controlled here
+kwstrip = True
def p4_build_cmd(cmd):
"""Build a suitable p4 command line.
@@ -975,7 +978,9 @@ class P4Sync(Command):
sys.stderr.write("p4 print fails with: %s\n" % repr(stat))
continue
- if stat['type'] in ('text+ko', 'unicode+ko', 'binary+ko'):
+ if not kwstrip:
+ pass
+ elif stat['type'] in ('text+ko', 'unicode+ko', 'binary+ko'):
text = re.sub(r'(?i)\$(Id|Header):[^$]*\$',r'$\1$', text)
elif stat['type'] in ('text+k', 'ktext', 'kxtext', 'unicode+k', 'binary+k'):
text = re.sub(r'\$(Id|Header|Author|Date|DateTime|Change|File|Revision):[^$]*\$',r'$\1$', text)
@@ -1850,6 +1855,16 @@ def main():
(cmd, args) = parser.parse_args(sys.argv[2:], cmd);
global verbose
verbose = cmd.verbose
+
+ global kwstrip
+ kwval = gitConfig("git-p4.kwstrip")
+ if len(kwval) > 0:
+ kwval = kwval.lower();
+ if kwval == "false":
+ kwstrip = False
+ elif kwval == "true":
+ kwstrip = True
+
if cmd.needsGit:
if cmd.gitdir == None:
cmd.gitdir = os.path.abspath(".git")
--
1.6.0.1.454.g63d55
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Modifying RCS keywords prevents submitting to p4 from git due to missing hunks. Optional shrinking of RCS keywords in git-p4. New option git-p4.kwstrip set to true or false controls the behavior
@ 2008-09-15 6:02 dhruva
0 siblings, 0 replies; 2+ messages in thread
From: dhruva @ 2008-09-15 6:02 UTC (permalink / raw)
To: sverre; +Cc: GIT SCM, Junio C Hamano
I had a real tough time configuring 'git send-email'. Looks like I finally have something working... I am still finding it tough to handle identity. I am figuring it out now by trial and error (with more errors) basis
-dhruva
----- Original Message ----
> From: Sverre Rabbelier <alturin@gmail.com>
> To: Dhruva Krishnamurthy <dhruva@ymail.com>
> Cc: "GIT SCM <git@vger.kernel.org>, Junio C Hamano" <gitster@pobox.com>
> Sent: Monday, 15 September, 2008 10:24:37 AM
> Subject: Re: [PATCH] Modifying RCS keywords prevents submitting to p4 from git due to missing hunks. Optional shrinking of RCS keywords in git-p4. New option git-p4.kwstrip set to true or false controls the behavior
>
> On Mon, Sep 15, 2008 at 06:16, Dhruva Krishnamurthy wrote:
> >
> > Signed-off-by: Dhruva Krishnamurthy
>
> I think something went wrong here, yes? The current title is way too
> long, and there is no commit message, perhaps you meant to put (part
> of) the title in the message instead?
>
> "[PATCH] Modifying RCS keywords prevents submitting to p4 from git due
> to missing hunks. Optional shrinking of RCS keywords in git-p4. New
> option git-p4.kwstrip set to true or false controls the behavior"
>
> --
> Cheers,
>
> Sverre Rabbelier
Unlimited freedom, unlimited storage. Get it now, on http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08..html/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-09-15 6:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-15 4:16 [PATCH] Modifying RCS keywords prevents submitting to p4 from git due to missing hunks. Optional shrinking of RCS keywords in git-p4. New option git-p4.kwstrip set to true or false controls the behavior Dhruva Krishnamurthy
-- strict thread matches above, loose matches on Subject: below --
2008-09-15 6:02 dhruva
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).