Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Keene <seraphire@gmail.com>2020-02-11 21:58:00 +0300
committerJunio C Hamano <gitster@pobox.com>2020-02-11 23:04:05 +0300
commitaa8b766a1393070fc85a585b875a4a4f34a08573 (patch)
tree7dccdc555f45e7e4ff80967db01b688ca3b502d9 /git-p4.py
parent9f59ca4d6afc69aec09eeec10e823222f4d7507b (diff)
git-p4: add p4-pre-submit exit text
When the p4-pre-submit exits with a non-zero exit code, the application will abort the process with no additional information presented to the user. This can be confusing for new users as it may not be clear that the p4-pre-submit action caused the error. Add text to explain why the program aborted the submit action. Signed-off-by: Ben Keene <seraphire@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-p4.py')
-rwxr-xr-xgit-p4.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/git-p4.py b/git-p4.py
index 4eccea3fa5..b1c86678fc 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -2405,7 +2405,15 @@ class P4Submit(Command, P4UserMap):
sys.exit("number of commits (%d) must match number of shelved changelist (%d)" %
(len(commits), num_shelves))
- if not run_git_hook("p4-pre-submit"):
+ try:
+ if not run_git_hook("p4-pre-submit"):
+ print("\nThe p4-pre-submit hook failed, aborting the submit.\n\nYou can skip " \
+ "this pre-submission check by adding\nthe command line option '--no-verify', " \
+ "however,\nthis will also skip the p4-changelist hook as well.")
+ sys.exit(1)
+ except Exception as e:
+ print("\nThe p4-pre-submit hook failed, aborting the submit.\n\nThe hook failed "\
+ "with the error '{0}'".format(e.message) )
sys.exit(1)
#