git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git-p4.skipSubmitEdit
@ 2011-09-08 20:40 L. A. Linden Levy
  2011-09-09 10:05 ` git-p4.skipSubmitEdit Vitor Antunes
  2011-09-12  7:34 ` git-p4.skipSubmitEdit Luke Diamand
  0 siblings, 2 replies; 17+ messages in thread
From: L. A. Linden Levy @ 2011-09-08 20:40 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 2848 bytes --]

Hi All,

I have been using git-p4 for a while and it has allowed me to completely
change the way I develop and still be able to use perforce which my
company has for its main VCS. One thing that was driving me nuts was
that "git p4 submit" cycles through all of my individual commits and
asks me if I want to change them. The way I develop I often am checking
in 20 to 50 different small commits each with a descriptive git comment.
I felt like I was doing double duty by having emacs open on every commit
into perforce. So I modified git-p4 to have an option to skip the
editor. This option coupled with git-p4.skipSubmitEditCheck will make
the submission non-interactive for "git p4 submit".

Below are the patch and environment results:


$ git config -l
...
user.name=Loren A. Linden Levy
git-p4.skipsubmitedit=true
git-p4.skipsubmiteditcheck=true
...

$ git format-patch origin/master --stdout

From 16c4344de0047cbaf3381eca590a3e59b0d0a25c Mon Sep 17 00:00:00 2001
From: "Loren A. Linden Levy" <lindenle@gmail.com>
Date: Thu, 8 Sep 2011 13:37:22 -0700
Subject: [PATCH] changed git-p4

---
 contrib/fast-import/git-p4 |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 2f7b270..a438b3e 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -935,18 +935,23 @@ class P4Submit(Command, P4UserMap):
             tmpFile.write(submitTemplate + separatorLine + diff +
newdiff)
             tmpFile.close()
             mtime = os.stat(fileName).st_mtime
-            if os.environ.has_key("P4EDITOR"):
-                editor = os.environ.get("P4EDITOR")
+            if gitConfig("git-p4.skipSubmitEdit") == "true":
+                pass
             else:
-                editor = read_pipe("git var GIT_EDITOR").strip()
-            system(editor + " " + fileName)
-
+                if os.environ.has_key("P4EDITOR"):
+                    editor = os.environ.get("P4EDITOR")
+                else:
+                    editor = read_pipe("git var GIT_EDITOR").strip()
+                    
+                    system(editor + " " + fileName)
+                    
             if gitConfig("git-p4.skipSubmitEditCheck") == "true":
                 checkModTime = False
             else:
                 checkModTime = True
 
             response = "y"
+
             if checkModTime and (os.stat(fileName).st_mtime <= mtime):
                 response = "x"
                 while response != "y" and response != "n":
-- 
1.7.6.347.g4db0d


-- 
Alex Linden Levy
Senior Software Engineer
MobiTV, Inc.
6425 Christie Avenue, 5th Floor, Emeryville, CA 94608
phone 510.450.5190 mobile 720.352.8394
email alevy@mobitv.com  web www.mobitv.com



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2011-12-17 17:41 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-08 20:40 git-p4.skipSubmitEdit L. A. Linden Levy
2011-09-09 10:05 ` git-p4.skipSubmitEdit Vitor Antunes
2011-09-09 17:47   ` git-p4.skipSubmitEdit Luke Diamand
2011-09-09 17:52     ` git-p4.skipSubmitEdit L. A. Linden Levy
2011-09-10  6:10       ` git-p4.skipSubmitEdit Luke Diamand
2011-09-12  7:34 ` git-p4.skipSubmitEdit Luke Diamand
2011-09-12 17:12   ` git-p4.skipSubmitEdit L. A. Linden Levy
2011-10-18  0:45     ` git-p4.skipSubmitEdit Pete Wyckoff
2011-10-18 16:51       ` git-p4.skipSubmitEdit L. A. Linden Levy
2011-10-18 17:35         ` git-p4.skipSubmitEdit Pete Wyckoff
2011-10-18 17:53       ` git-p4.skipSubmitEdit Luke Diamand
2011-10-20  1:16         ` git-p4.skipSubmitEdit Pete Wyckoff
2011-12-16 15:38           ` git-p4.skipSubmitEdit Michael Horowitz
2011-12-16 19:50             ` git-p4.skipSubmitEdit Luke Diamand
2011-12-17  0:46               ` git-p4.skipSubmitEdit Michael Horowitz
2011-12-17  0:49                 ` git-p4.skipSubmitEdit Michael Horowitz
2011-12-17 17:39                   ` [PATCH] git-p4: fix skipSubmitEdit regression Pete Wyckoff

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).