* [PATCH] git p4 submit: Add --{skip-,}edit-submit option
@ 2014-02-26 12:26 Crestez Dan Leonard
0 siblings, 0 replies; only message in thread
From: Crestez Dan Leonard @ 2014-02-26 12:26 UTC (permalink / raw)
To: git; +Cc: Pete Wyckoff
[-- Attachment #1: Type: text/plain, Size: 382 bytes --]
This allows skipping interactively editting the p4 changelist before
submit. This is useful for pushing series of patches to p4 quickly.
This was already possible through a config option.
Signed-off-by: Crestez Dan Leonard <cdleonard@gmail.com>
---
Documentation/git-p4.txt | 4 ++++
git-p4.py | 11 ++++++++++-
2 files changed, 14 insertions(+), 1 deletion(-)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-git-p4-submit-Add-skip-edit-submit-option.patch --]
[-- Type: text/x-patch; name="0001-git-p4-submit-Add-skip-edit-submit-option.patch", Size: 2332 bytes --]
diff --git a/Documentation/git-p4.txt b/Documentation/git-p4.txt
index 6ab5f94..619f45f 100644
--- a/Documentation/git-p4.txt
+++ b/Documentation/git-p4.txt
@@ -299,6 +299,10 @@ These options can be used to modify 'git p4 submit' behavior.
to bypass the prompt, causing conflicting commits to be automatically
skipped, or to quit trying to apply commits, without prompting.
+--skip-submit-edit --edit-submit::
+ Edit the changelist before template or not. This defaults to true,
+ unless overridden by the git-p4.skipSubmitEdit config option.
+
--branch <branch>::
After submitting, sync this named branch instead of the default
p4/master. See the "Sync options" section above for more
diff --git a/git-p4.py b/git-p4.py
index cdfa2df..cafd997 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -998,6 +998,10 @@ class P4Submit(Command, P4UserMap):
optparse.make_option("--prepare-p4-only", dest="prepare_p4_only", action="store_true"),
optparse.make_option("--conflict", dest="conflict_behavior",
choices=self.conflict_behavior_choices),
+ optparse.make_option("--skip-edit-submit", dest="edit_submit", action="store_true",
+ help="Skip editting the changelist before submit"),
+ optparse.make_option("--edit-submit", dest="edit_submit", action="store_false",
+ help="Edit the changelist before submit (default)"),
optparse.make_option("--branch", dest="branch"),
]
self.description = "Submit changes from git to the perforce depot."
@@ -1203,12 +1207,17 @@ class P4Submit(Command, P4UserMap):
return template
+ def get_edit_submit_value(self):
+ if hasattr(self, 'edit_submit'):
+ return self.edit_submit
+ return gitConfigBool('git-p4.skipSubmitEdit')
+
def edit_template(self, template_file):
"""Invoke the editor to let the user change the submission
message. Return true if okay to continue with the submit."""
# if configured to skip the editing part, just submit
- if gitConfigBool("git-p4.skipSubmitEdit"):
+ if self.get_edit_submit_value():
return True
# look at the modification time, to check later if the user saved
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-02-26 12:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-26 12:26 [PATCH] git p4 submit: Add --{skip-,}edit-submit option Crestez Dan Leonard
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).