From: "Dmitry V. Levin" <ldv@altlinux.org>
To: Git Mailing List <git@vger.kernel.org>
Cc: Junio C Hamano <gitster@pobox.com>
Subject: [PATCH 2/2] git-commit: Add --no-status option
Date: Thu, 6 Sep 2007 03:49:53 +0400 [thread overview]
Message-ID: <20070905234953.GB643@nomad.office.altlinux.org> (raw)
By default, git-commit runs git-runstatus to print changes between
the index and the working tree. 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@altlinux.org>
---
Documentation/git-commit.txt | 7 ++++++-
git-commit.sh | 11 ++++++++++-
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
index e54fb12..177e7cd 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>]
+ [--no-status] [--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.
+--no-status::
+ Do not examine paths in the working tree that has 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 800f96c..75126f1 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] [--no-status] [--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 t = "$status" || return 0
git runstatus ${color} \
${verbose:+--verbose} \
${amend:+--amend} \
@@ -81,6 +82,7 @@ edit_flag=
no_edit=
log_given=
log_message=
+status=t
verify=t
quiet=
verbose=
@@ -184,6 +186,13 @@ $1"
no_edit=t
shift
;;
+ --no-s|--no-st|--no-sta|--no-stat|--no-statu|\
+ --no-status)
+ test "$status_only" = t &&
+ die "Option $1 does not make sense with ${0##*/}."
+ status=
+ shift
+ ;;
-n|--n|--no|--no-|--no-v|--no-ve|--no-ver|--no-veri|--no-verif|\
--no-verify)
verify=
--
ldv
next reply other threads:[~2007-09-05 23:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-05 23:49 Dmitry V. Levin [this message]
2007-09-06 22:15 ` [PATCH 2/2] git-commit: Add --no-status option Alex Riesen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070905234953.GB643@nomad.office.altlinux.org \
--to=ldv@altlinux.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).