By default, git-commit runs git-runstatus to print changes between the index file and the working tree, and between the index file and the current commit. This operation is very costly and is not always necessary. New option allows user to commit without running git-runstatus when appropriate. Signed-off-by: Dmitry V. Levin <ldv@xxxxxxxxxxxx> --- Documentation/git-commit.txt | 7 ++++++- git-commit.sh | 10 +++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt index e54fb12..4387147 100644 --- a/Documentation/git-commit.txt +++ b/Documentation/git-commit.txt @@ -10,7 +10,7 @@ SYNOPSIS [verse] 'git-commit' [-a | --interactive] [-s] [-v] [-u] [(-c | -C) <commit> | -F <file> | -m <msg> | --amend] - [--no-verify] [-e] [--author <author>] + [--fast] [--no-verify] [-e] [--author <author>] [--] [[-i | -o ]<file>...] DESCRIPTION @@ -85,6 +85,11 @@ OPTIONS -s|--signoff:: Add Signed-off-by line at the end of the commit message. +--fast:: + Do not examine paths in the working tree that have changes + unrecorded to the index file, and changes between the + index file and the current commit. + --no-verify:: This option bypasses the pre-commit hook. See also link:hooks.html[hooks]. diff --git a/git-commit.sh b/git-commit.sh index 9844691..028eac5 100755 --- a/git-commit.sh +++ b/git-commit.sh @@ -3,7 +3,7 @@ # Copyright (c) 2005 Linus Torvalds # Copyright (c) 2006 Junio C Hamano -USAGE='[-a | --interactive] [-s] [-v] [--no-verify] [-m <message> | -F <logfile> | (-C|-c) <commit> | --amend] [-u] [-e] [--author <author>] [--template <file>] [[-i | -o] <path>...]' +USAGE='[-a | --interactive] [-s] [-v] [--fast] [--no-verify] [-m <message> | -F <logfile> | (-C|-c) <commit> | --amend] [-u] [-e] [--author <author>] [--template <file>] [[-i | -o] <path>...]' SUBDIRECTORY_OK=Yes . git-sh-setup require_work_tree @@ -54,6 +54,7 @@ run_status () { else color=--nocolor fi + test -z "$fast" || return 0 git runstatus ${color} \ ${verbose:+--verbose} \ ${amend:+--amend} \ @@ -81,6 +82,7 @@ edit_flag= no_edit= log_given= log_message= +fast= verify=t quiet= verbose= @@ -184,6 +186,12 @@ $1" no_edit=t shift ;; + --f|--fa|--fas|--fast) + test "$status_only" = t && + die "Option $1 does not make sense with ${0##*/}." + fast=t + shift + ;; -n|--n|--no|--no-|--no-v|--no-ve|--no-ver|--no-veri|--no-verif|\ --no-verify) verify= -- ldv - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html