From: Ramkumar Ramachandra <artagnon@gmail.com>
To: Git List <git@vger.kernel.org>
Cc: Junio C Hamano <gitster@pobox.com>
Subject: [PATCH 2/2] commit: make it work with status.short
Date: Mon, 24 Jun 2013 18:15:12 +0530 [thread overview]
Message-ID: <1372077912-18625-3-git-send-email-artagnon@gmail.com> (raw)
In-Reply-To: <1372077912-18625-1-git-send-email-artagnon@gmail.com>
50e4f75 (status: introduce status.short to enable --short by default,
2013-06-11) introduced a regression in git commit; it is now impossible
to commit with status.short set.
This happens because commit internally runs run_status() to set
s->commitable and determine whether or not there is something to
commit. The problem arises from the fact that only STATUS_FORMAT_NONE
(or STATUS_FORMAT_LONG) is equipped to set s->commitable.
7c9f7038 (commit: support alternate status formats, 2009-09-05) clearly
states that --short and --porcelain imply --dry-run and are therefore
only intended for display purposes.
The bigger problem is that it is impossible to differentiate between a
status_format set by the command-line option parser versus that set by
the config parser. So these two are exactly equivalent:
$ git -c status.short=true commit
$ git commit --short
To alleviate this problem, clear status_format as soon as the config
parser has finished its work to nullify the effect of parsing
status.short, and get commit to work again.
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
builtin/commit.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/builtin/commit.c b/builtin/commit.c
index 896f002..dc5ed7d 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -1448,6 +1448,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
wt_status_prepare(&s);
gitmodules_config();
git_config(git_commit_config, &s);
+ status_format = STATUS_FORMAT_NONE; /* Ignore status.short */
determine_whence(&s);
s.colopts = 0;
--
1.8.3.1.550.gd96f26e.dirty
next prev parent reply other threads:[~2013-06-24 12:48 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-24 12:45 [PATCH (!) 0/2] Fix serious regressions in latest master Ramkumar Ramachandra
2013-06-24 12:45 ` [PATCH 1/2] status: really ignore config with --porcelain Ramkumar Ramachandra
2013-06-24 13:51 ` Matthieu Moy
2013-06-24 14:05 ` Ramkumar Ramachandra
2013-06-24 14:51 ` Matthieu Moy
2013-06-24 16:35 ` Junio C Hamano
2013-06-24 16:50 ` Matthieu Moy
2013-06-24 17:16 ` Junio C Hamano
2013-06-24 17:21 ` Matthieu Moy
2013-06-24 18:16 ` Junio C Hamano
2013-06-24 19:30 ` Ramkumar Ramachandra
2013-06-24 22:24 ` Junio C Hamano
2013-06-24 19:49 ` Junio C Hamano
2013-06-28 1:40 ` Jeff King
2013-06-28 3:59 ` Junio C Hamano
2013-06-28 17:37 ` Junio C Hamano
2013-06-28 19:31 ` Jeff King
2013-06-28 20:15 ` Junio C Hamano
2013-06-24 16:53 ` Ramkumar Ramachandra
2013-06-24 14:55 ` Junio C Hamano
2013-06-24 15:04 ` Matthieu Moy
2013-06-24 15:50 ` Ramkumar Ramachandra
2013-06-24 12:45 ` Ramkumar Ramachandra [this message]
2013-06-24 15:17 ` [PATCH 2/2] commit: make it work with status.short Junio C Hamano
2013-06-24 15:39 ` Ramkumar Ramachandra
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1372077912-18625-3-git-send-email-artagnon@gmail.com \
--to=artagnon@gmail.com \
--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.
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).