{"thread":{"id":"21868","subject":"[PATCH] Add commit.infodisplay option to give message editor empty file","startedAt":"2009-12-04T23:04:39Z","lastAt":"2009-12-08T14:07:33Z","messageCount":15,"participants":["James P. Howard, II","Junio C Hamano","Jeff King","James Pickens"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"129255","messageId":"1259967879-65517-1-git-send-email-jh@jameshoward.us","threadId":"21868","inReplyTo":null,"subject":"[PATCH] Add commit.infodisplay option to give message editor empty file","fromName":"James P. Howard, II","fromEmail":"jh@jameshoward.us","sentAt":"2009-12-04T23:04:39Z","receivedAt":"2009-12-04T23:04:39Z","isPatch":true,"sender":{"key":"jh@jameshoward.us","avatar":"https://avatars.githubusercontent.com/u/156522?v=4"},"body":"This patch creates commit.infodisplay which causes git commit to\ndisplay the status information on the standard output rather\nthan in the temporary file for the commit message.  By doing\nthis, it becomes feasible to set core.editor for commit messages\nto be a line editor, e.g. ex or ed.\n\nSigned-off-by: James P. Howard, II <jh@jameshoward.us>\n---\n Documentation/config.txt |    5 +++++\n builtin-commit.c         |   31 ++++++++++++++++++-------------\n cache.h                  |    1 +\n environment.c            |    3 +++\n 4 files changed, 27 insertions(+), 13 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex a1e36d7..56b3238 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -705,6 +705,11 @@ color.ui::\n \tterminal. When more specific variables of color.* are set, they always\n \ttake precedence over this setting. Defaults to false.\n \n+commit.infodisplay::\n+\tWhen true and a commit message is not specified on the command line,\n+\tthe status information is not placed in the message template but is\n+\tprinted to the standard output.\n+\n commit.template::\n \tSpecify a file to use as the template for new commit messages.\n \t\"{tilde}/\" is expanded to the value of `$HOME` and \"{tilde}user/\" to the\ndiff --git a/builtin-commit.c b/builtin-commit.c\nindex e93a647..e4db374 100644\n--- a/builtin-commit.c\n+++ b/builtin-commit.c\n@@ -463,7 +463,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \tint commitable, saved_color_setting;\n \tstruct strbuf sb = STRBUF_INIT;\n \tchar *buffer;\n-\tFILE *fp;\n+\tFILE *fp, *infofp;\n \tconst char *hook_arg1 = NULL;\n \tconst char *hook_arg2 = NULL;\n \tint ident_shown = 0;\n@@ -540,7 +540,12 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \n \tif (fwrite(sb.buf, 1, sb.len, fp) < sb.len)\n \t\tdie_errno(\"could not write commit template\");\n-\n+\tif (info_display)\n+\t\tinfofp = stdout;\n+\telse {\n+\t\tinfofp = fp;\n+\t\tfprintf(infofp, \"\\n\");\n+\t}\n \tstrbuf_release(&sb);\n \n \tdetermine_author_info();\n@@ -552,7 +557,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \t\tconst char *committer_ident;\n \n \t\tif (in_merge)\n-\t\t\tfprintf(fp,\n+\t\t\tfprintf(infofp,\n \t\t\t\t\"#\\n\"\n \t\t\t\t\"# It looks like you may be committing a MERGE.\\n\"\n \t\t\t\t\"# If this is not correct, please remove the file\\n\"\n@@ -561,28 +566,27 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \t\t\t\t\"#\\n\",\n \t\t\t\tgit_path(\"MERGE_HEAD\"));\n \n-\t\tfprintf(fp,\n-\t\t\t\"\\n\"\n+\t\tfprintf(infofp,\n \t\t\t\"# Please enter the commit message for your changes.\");\n \t\tif (cleanup_mode == CLEANUP_ALL)\n-\t\t\tfprintf(fp,\n+\t\t\tfprintf(infofp,\n \t\t\t\t\" Lines starting\\n\"\n \t\t\t\t\"# with '#' will be ignored, and an empty\"\n \t\t\t\t\" message aborts the commit.\\n\");\n \t\telse /* CLEANUP_SPACE, that is. */\n-\t\t\tfprintf(fp,\n+\t\t\tfprintf(infofp,\n \t\t\t\t\" Lines starting\\n\"\n \t\t\t\t\"# with '#' will be kept; you may remove them\"\n \t\t\t\t\" yourself if you want to.\\n\"\n \t\t\t\t\"# An empty message aborts the commit.\\n\");\n \t\tif (only_include_assumed)\n-\t\t\tfprintf(fp, \"# %s\\n\", only_include_assumed);\n+\t\t\tfprintf(infofp, \"# %s\\n\", only_include_assumed);\n \n \t\tauthor_ident = xstrdup(fmt_name(author_name, author_email));\n \t\tcommitter_ident = fmt_name(getenv(\"GIT_COMMITTER_NAME\"),\n \t\t\t\t\t   getenv(\"GIT_COMMITTER_EMAIL\"));\n \t\tif (strcmp(author_ident, committer_ident))\n-\t\t\tfprintf(fp,\n+\t\t\tfprintf(infofp,\n \t\t\t\t\"%s\"\n \t\t\t\t\"# Author:    %s\\n\",\n \t\t\t\tident_shown++ ? \"\" : \"#\\n\",\n@@ -590,18 +594,18 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \t\tfree(author_ident);\n \n \t\tif (!user_ident_explicitly_given)\n-\t\t\tfprintf(fp,\n+\t\t\tfprintf(infofp,\n \t\t\t\t\"%s\"\n \t\t\t\t\"# Committer: %s\\n\",\n \t\t\t\tident_shown++ ? \"\" : \"#\\n\",\n \t\t\t\tcommitter_ident);\n \n \t\tif (ident_shown)\n-\t\t\tfprintf(fp, \"#\\n\");\n+\t\t\tfprintf(infofp, \"#\\n\");\n \n \t\tsaved_color_setting = s->use_color;\n \t\ts->use_color = 0;\n-\t\tcommitable = run_status(fp, index_file, prefix, 1, s);\n+\t\tcommitable = run_status(infofp, index_file, prefix, 1, s);\n \t\ts->use_color = saved_color_setting;\n \t} else {\n \t\tunsigned char sha1[20];\n@@ -1006,7 +1010,8 @@ static int git_commit_config(const char *k, const char *v, void *cb)\n \n \tif (!strcmp(k, \"commit.template\"))\n \t\treturn git_config_pathname(&template_file, k, v);\n-\n+\tif (!strcmp(k, \"commit.infodisplay\"))\n+\t\tinfo_display = git_config_bool(k, v);\n \treturn git_status_config(k, v, s);\n }\n \ndiff --git a/cache.h b/cache.h\nindex bf468e5..2b36fb3 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -529,6 +529,7 @@ extern int auto_crlf;\n extern int read_replace_refs;\n extern int fsync_object_files;\n extern int core_preload_index;\n+extern int info_display;\n \n enum safe_crlf {\n \tSAFE_CRLF_FALSE = 0,\ndiff --git a/environment.c b/environment.c\nindex 5171d9f..ac7cfed 100644\n--- a/environment.c\n+++ b/environment.c\n@@ -55,6 +55,9 @@ int grafts_replace_parents = 1;\n /* Parallel index stat data preload? */\n int core_preload_index = 0;\n \n+/* Controls whether commit information is appended to message text or displayed */\n+int info_display = 0;\n+\n /* This is set by setup_git_dir_gently() and/or git_default_config() */\n char *git_work_tree_cfg;\n static char *work_tree;\n-- \n1.6.5.3\n"},{"id":"129258","messageId":"7vpr6t6fnz.fsf@alter.siamese.dyndns.org","threadId":"21868","inReplyTo":"1259967879-65517-1-git-send-email-jh@jameshoward.us","subject":"Re: [PATCH] Add commit.infodisplay option to give message editor empty file","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-12-05T07:30:56Z","receivedAt":"2009-12-05T07:30:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"James P. Howard, II\" <jh@jameshoward.us> writes:\n\n> This patch creates commit.infodisplay which causes git commit to\n> display the status information on the standard output rather\n> than in the temporary file for the commit message.  By doing\n> this, it becomes feasible to set core.editor for commit messages\n> to be a line editor, e.g. ex or ed.\n\nTwo points and a half:\n\n - Why does info_display need to be visible to everybody else by being in\n   cache.h and environment.c?  Shouldn't its scope be similar to that of\n   template_file, that is static to builtin-commit.c?\n\n - A configuration variable that does not allow the users to override from\n   the command line is a no-no.  We usually do command line option first\n   and then (or at the same time) configuration variable as a typesaver.\n\n - While the amount of change necessary for this change doesn't look too\n   bad, is it really worth it?  What is wrong with \"1,$p\" while using ed\n   as your editor?\n"},{"id":"129273","messageId":"20091205154753.GA3717@thermopylae.local","threadId":"21868","inReplyTo":"7vpr6t6fnz.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Add commit.infodisplay option to give message editor empty file","fromName":"James P. Howard, II","fromEmail":"jh@jameshoward.us","sentAt":"2009-12-05T15:47:53Z","receivedAt":"2009-12-05T15:47:53Z","isPatch":true,"sender":{"key":"jh@jameshoward.us","avatar":"https://avatars.githubusercontent.com/u/156522?v=4"},"body":"On Fri, Dec 04, 2009 at 11:30:56PM -0800, Junio C Hamano wrote:\n\n> Two points and a half:\n> \n>  - Why does info_display need to be visible to everybody else by being in\n>    cache.h and environment.c?  Shouldn't its scope be similar to that of\n>    template_file, that is static to builtin-commit.c?\n> \n>  - A configuration variable that does not allow the users to override from\n>    the command line is a no-no.  We usually do command line option first\n>    and then (or at the same time) configuration variable as a typesaver.\n\nI can make these changes in the next few days.\n \n>  - While the amount of change necessary for this change doesn't look too\n>    bad, is it really worth it?  What is wrong with \"1,$p\" while using ed\n>    as your editor?\n\nI tried a few variants of this, and shell script wrappers for ex (and\ngate, which is a specizalized text editor that actually works kind of\nwell for commit message editing), and it worked fairly well.\n\nThe real motivation is that this feature ditches all assumptions about\nthe capabilities of the text editor.  I am not sure where that leads\nyet, but I'd rather make it possible.\n\nJames\n\n-- \nJames P. Howard, II, MPA MBCS\njh@jameshoward.us\n"},{"id":"129275","messageId":"20091205162827.GA9584@sigill.intra.peff.net","threadId":"21868","inReplyTo":"20091205154753.GA3717@thermopylae.local","subject":"Re: [PATCH] Add commit.infodisplay option to give message editor empty file","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-12-05T16:28:27Z","receivedAt":"2009-12-05T16:28:27Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Dec 05, 2009 at 10:47:53AM -0500, James P. Howard, II wrote:\n\n> >  - While the amount of change necessary for this change doesn't look too\n> >    bad, is it really worth it?  What is wrong with \"1,$p\" while using ed\n> >    as your editor?\n> \n> I tried a few variants of this, and shell script wrappers for ex (and\n> gate, which is a specizalized text editor that actually works kind of\n> well for commit message editing), and it worked fairly well.\n> \n> The real motivation is that this feature ditches all assumptions about\n> the capabilities of the text editor.  I am not sure where that leads\n> yet, but I'd rather make it possible.\n\nIs your problem that your editor doesn't show the template content and\nyou want to see it, or is it that your editor isn't pleasant to use when\nthe buffer is pre-filled with the template?\n\nIf the former, it seems like just dumping it to stdout isn't all that\nsatisfying, either. What happens when your editing causes the\ninformation to scroll off the screen and you want to see it again?\nCouldn't you get the same thing just by doing \"git status; git commit\"?\n\nIf the latter, I think we would be better served by an option to simply\nturn off the template. Then that is also helpful for the case of people\nusing decent editors, but who don't want to waste the CPU time on\ngenerating the template information (which can be substantial for things\nlike media repositories).\n\nI suspect your answer will be that it is some of both, but this just\nreally feels like we are putting hacks into git because of one\nfeatureless editor. Hacks like that would be better suited (IMHO) to a\nwrapper script for the editor.\n\n-Peff\n"},{"id":"129301","messageId":"20091205230903.GA3816@thermopylae.local","threadId":"21868","inReplyTo":"20091205162827.GA9584@sigill.intra.peff.net","subject":"Re: [PATCH] Add commit.infodisplay option to give message editor empty file","fromName":"James P. Howard, II","fromEmail":"jh@jameshoward.us","sentAt":"2009-12-05T23:09:03Z","receivedAt":"2009-12-05T23:09:03Z","isPatch":true,"sender":{"key":"jh@jameshoward.us","avatar":"https://avatars.githubusercontent.com/u/156522?v=4"},"body":"On Sat, Dec 05, 2009 at 11:28:27AM -0500, Jeff King wrote:\n\n> If the latter, I think we would be better served by an option to simply\n> turn off the template. Then that is also helpful for the case of people\n> using decent editors, but who don't want to waste the CPU time on\n> generating the template information (which can be substantial for things\n> like media repositories).\n\nActually, I find this a reasonable solution for both cases and would be\nwilling to reimplment my change this way, as it meets my needs and would\nbe useful to others.  The only question I have is, what should variable/\ncommand line option be called?\n\nJames\n\n-- \nJames P. Howard, II, MPA MBCS\njh@jameshoward.us\n"},{"id":"129311","messageId":"20091206042206.GC23983@coredump.intra.peff.net","threadId":"21868","inReplyTo":"20091205230903.GA3816@thermopylae.local","subject":"Re: [PATCH] Add commit.infodisplay option to give message editor empty file","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-12-06T04:22:06Z","receivedAt":"2009-12-06T04:22:06Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Dec 05, 2009 at 06:09:03PM -0500, James P. Howard, II wrote:\n\n> On Sat, Dec 05, 2009 at 11:28:27AM -0500, Jeff King wrote:\n> \n> > If the latter, I think we would be better served by an option to simply\n> > turn off the template. Then that is also helpful for the case of people\n> > using decent editors, but who don't want to waste the CPU time on\n> > generating the template information (which can be substantial for things\n> > like media repositories).\n> \n> Actually, I find this a reasonable solution for both cases and would be\n> willing to reimplment my change this way, as it meets my needs and would\n> be useful to others.  The only question I have is, what should variable/\n> command line option be called?\n\nI would be tempted to call it \"--no-template\", but I think that is too\nconfusing. The \"--template\" option is not really about the git-generated\ntemplate, but about a user-defined template that goes on top of the\ngit-generated one (I would have expected --template=/dev/null to do what\nyou want, too, but it retains the git template).\n\nProbably \"--no-status\" would be a good name, as the generated template\nis the format generated by \"git status\".\n\n-Peff\n"},{"id":"129315","messageId":"7v7ht0jzta.fsf@alter.siamese.dyndns.org","threadId":"21868","inReplyTo":"20091206042206.GC23983@coredump.intra.peff.net","subject":"Re: [PATCH] Add commit.infodisplay option to give message editor empty file","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-12-06T08:01:53Z","receivedAt":"2009-12-06T08:01:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> I would be tempted to call it \"--no-template\", but I think that is too\n> confusing. The \"--template\" option is not really about the git-generated\n> template, but about a user-defined template that goes on top of the\n> git-generated one (I would have expected --template=/dev/null to do what\n> you want, too, but it retains the git template).\n>\n> Probably \"--no-status\" would be a good name, as the generated template\n> is the format generated by \"git status\".\n\nI wonder which part is the most expensive in generating the status\noutput.  Perhaps -suno is sufficient?\n"},{"id":"129325","messageId":"20091206131217.GA12851@sigill.intra.peff.net","threadId":"21868","inReplyTo":"7v7ht0jzta.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Add commit.infodisplay option to give message editor empty file","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-12-06T13:12:18Z","receivedAt":"2009-12-06T13:12:18Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Dec 06, 2009 at 12:01:53AM -0800, Junio C Hamano wrote:\n\n> Jeff King <peff@peff.net> writes:\n> \n> > I would be tempted to call it \"--no-template\", but I think that is too\n> > confusing. The \"--template\" option is not really about the git-generated\n> > template, but about a user-defined template that goes on top of the\n> > git-generated one (I would have expected --template=/dev/null to do what\n> > you want, too, but it retains the git template).\n> >\n> > Probably \"--no-status\" would be a good name, as the generated template\n> > is the format generated by \"git status\".\n> \n> I wonder which part is the most expensive in generating the status\n> output.  Perhaps -suno is sufficient?\n\nSpeaking from my experience, it is doing break and rename detection on\nlarge files, which there is currently no way to turn off (I hacked\naround it with \"$EDITOR msg && git commit --quiet -F msg\").\n\nKeep in mind this is one of my gigantic photo repositories, and the\ncommit in question made a minor change to almost 3G worth of files. So\nit is not the end of the world for me to use the hack above on those\nrare occasions. But since James wants it for other reasons, and it\nshould be a trivial patch, I think it would be nice for commit to\nsupport it natively.\n\nIt would also make sense to me for \"--quiet\" to suppress the template,\nbut that is a behavior change that I suppose some people might not like.\n\n-Peff\n"},{"id":"129456","messageId":"88a2333a0912071443u3e308da5md3ce962c6c1eeebd@mail.gmail.com","threadId":"21868","inReplyTo":"20091206042206.GC23983@coredump.intra.peff.net","subject":"Re: [PATCH] Add commit.infodisplay option to give message editor empty file","fromName":"James P. Howard, II","fromEmail":"jh@jameshoward.us","sentAt":"2009-12-07T22:43:24Z","receivedAt":"2009-12-07T22:43:24Z","isPatch":true,"sender":{"key":"jh@jameshoward.us","avatar":"https://avatars.githubusercontent.com/u/156522?v=4"},"body":"On Sat, Dec 5, 2009 at 23:22, Jeff King <peff@peff.net> wrote:\n\n> Probably \"--no-status\" would be a good name, as the generated template\n> is the format generated by \"git status\".\n\nI have produced a patch against master that implements this in, what I\nhope, is a better way.\n\nJames\n\n-- \nJames P. Howard, II, MPA MBCS\njh@jameshoward.us\n"},{"id":"129457","messageId":"1260225927-33612-1-git-send-email-jh@jameshoward.us","threadId":"21868","inReplyTo":"20091206131217.GA12851@sigill.intra.peff.net","subject":"[PATCH] Add commit.status, --status, and --no-status","fromName":"James P. Howard, II","fromEmail":"jh@jameshoward.us","sentAt":"2009-12-07T22:45:27Z","receivedAt":"2009-12-07T22:45:27Z","isPatch":true,"sender":{"key":"jh@jameshoward.us","avatar":"https://avatars.githubusercontent.com/u/156522?v=4"},"body":"This commit provides support for commit.status, --status, and\n--no-status, which control whether or not the git status information\nis included in the commit message template when using an editor to\nprepare the commit message.  It does not affect the effects of a\nuser's commit.template settings.\n\nSigned-off-by: James P. Howard, II <jh@jameshoward.us>\n---\n Documentation/config.txt     |    5 +++++\n Documentation/git-commit.txt |   14 +++++++++++++-\n builtin-commit.c             |    9 +++++++--\n 3 files changed, 25 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex a1e36d7..5561560 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -705,6 +705,11 @@ color.ui::\n \tterminal. When more specific variables of color.* are set, they always\n \ttake precedence over this setting. Defaults to false.\n \n+commit.status\n+\tA boolean to enable/disable inclusion of status information in the\n+\tcommit message template when using an editor to prepare the commit\n+\tmessage.  Defaults to true.\n+\n commit.template::\n \tSpecify a file to use as the template for new commit messages.\n \t\"{tilde}/\" is expanded to the value of `$HOME` and \"{tilde}user/\" to the\ndiff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt\nindex d227cec..0e53518 100644\n--- a/Documentation/git-commit.txt\n+++ b/Documentation/git-commit.txt\n@@ -11,7 +11,8 @@ SYNOPSIS\n 'git commit' [-a | --interactive] [-s] [-v] [-u<mode>] [--amend] [--dry-run]\n \t   [(-c | -C) <commit>] [-F <file> | -m <msg>] [--reset-author]\n \t   [--allow-empty] [--no-verify] [-e] [--author=<author>]\n-\t   [--cleanup=<mode>] [--] [[-i | -o ]<file>...]\n+\t   [--cleanup=<mode>] [--status | --no-status] [--]\n+\t   [[-i | -o ]<file>...]\n \n DESCRIPTION\n -----------\n@@ -207,6 +208,17 @@ specified.\n \tto be committed, paths with local changes that will be left\n \tuncommitted and paths that are untracked.\n \n+--status::\n+\tInclude the output of linkgit:git-status[1] in the commit\n+\tmessage template when using an editor to prepare the commit\n+\tmessage.  Defaults to on, but can be used to override\n+\tconfiguration variable commit.status.\n+\n+--no-status::\n+\tDo not include the output of linkgit:git-status[1] in the\n+\tcommit message template when using an editor to prepare the\n+\tdefault commit message.\n+\n \\--::\n \tDo not interpret any more arguments as options.\n \ndiff --git a/builtin-commit.c b/builtin-commit.c\nindex e93a647..095c186 100644\n--- a/builtin-commit.c\n+++ b/builtin-commit.c\n@@ -67,7 +67,7 @@ static enum {\n } cleanup_mode;\n static char *cleanup_arg;\n \n-static int use_editor = 1, initial_commit, in_merge;\n+static int use_editor = 1, initial_commit, in_merge, include_status = 1;\n static const char *only_include_assumed;\n static struct strbuf message;\n \n@@ -97,6 +97,7 @@ static struct option builtin_commit_options[] = {\n \tOPT_BOOLEAN('s', \"signoff\", &signoff, \"add Signed-off-by:\"),\n \tOPT_FILENAME('t', \"template\", &template_file, \"use specified template file\"),\n \tOPT_BOOLEAN('e', \"edit\", &edit_flag, \"force edit of commit\"),\n+\tOPT_BOOLEAN(0, \"status\", &include_status, \"include status in commit message template\"),\n \n \tOPT_GROUP(\"Commit contents options\"),\n \tOPT_BOOLEAN('a', \"all\", &all, \"commit all changed files\"),\n@@ -547,7 +548,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \n \t/* This checks if committer ident is explicitly given */\n \tgit_committer_info(0);\n-\tif (use_editor) {\n+\tif (use_editor && include_status) {\n \t\tchar *author_ident;\n \t\tconst char *committer_ident;\n \n@@ -1006,6 +1007,10 @@ static int git_commit_config(const char *k, const char *v, void *cb)\n \n \tif (!strcmp(k, \"commit.template\"))\n \t\treturn git_config_pathname(&template_file, k, v);\n+\tif (!strcmp(k, \"commit.status\")) {\n+\t\tinclude_status = git_config_bool(k, v);\n+\t\treturn 0;\n+\t}\n \n \treturn git_status_config(k, v, s);\n }\n-- \n1.6.5.3\n"},{"id":"129459","messageId":"885649360912071639o4c609dbapea9891aae639194c@mail.gmail.com","threadId":"21868","inReplyTo":"1260225927-33612-1-git-send-email-jh@jameshoward.us","subject":"Re: [PATCH] Add commit.status, --status, and --no-status","fromName":"James Pickens","fromEmail":"jepicken@gmail.com","sentAt":"2009-12-08T00:39:51Z","receivedAt":"2009-12-08T00:39:51Z","isPatch":true,"sender":{"key":"jepicken@gmail.com","avatar":null},"body":"On Mon, Dec 7, 2009, James P. Howard, II <jh@jameshoward.us> wrote:\n> This commit provides support for commit.status, --status, and\n> --no-status, which control whether or not the git status information\n> is included in the commit message template when using an editor to\n> prepare the commit message.  It does not affect the effects of a\n> user's commit.template settings.\n\nAt the risk of sounding like a curmudgeon, I have to register an objection\nto this _as a config option_, for the same reasons that I objected to the\n'grep --full-tree' config option [1].  Both options fundamentally change\nuser visible behavior, both options IMHO will be used by a small minority\nof git users, and in both cases, the desired behavior can be attained using\naliases in combination with a new command line option.\n\nSorry if I'm obstructing progress, but I think that, for the good of the\nGit community as a whole, it's best to keep the number of config options\n(and to a lesser extent, command line options) as low as possible.\n\nNote that I do not object to adding --no-status as a command line option.\n\n[1] http://article.gmane.org/gmane.comp.version-control.git/133681\n\nJames\n"},{"id":"129486","messageId":"20091208060415.GC9951@coredump.intra.peff.net","threadId":"21868","inReplyTo":"1260225927-33612-1-git-send-email-jh@jameshoward.us","subject":"Re: [PATCH] Add commit.status, --status, and --no-status","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-12-08T06:04:15Z","receivedAt":"2009-12-08T06:04:15Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Dec 07, 2009 at 05:45:27PM -0500, James P. Howard, II wrote:\n\n> This commit provides support for commit.status, --status, and\n> --no-status, which control whether or not the git status information\n> is included in the commit message template when using an editor to\n> prepare the commit message.  It does not affect the effects of a\n> user's commit.template settings.\n\nThanks, this looks very cleanly done. The only complaint I would make is\nthat it should probably include a simple test case.\n\n-Peff\n"},{"id":"129493","messageId":"7vr5r6ndkz.fsf@alter.siamese.dyndns.org","threadId":"21868","inReplyTo":"20091208060415.GC9951@coredump.intra.peff.net","subject":"Re: [PATCH] Add commit.status, --status, and --no-status","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-12-08T07:13:00Z","receivedAt":"2009-12-08T07:13:00Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Mon, Dec 07, 2009 at 05:45:27PM -0500, James P. Howard, II wrote:\n>\n>> This commit provides support for commit.status, --status, and\n>> --no-status, which control whether or not the git status information\n>> is included in the commit message template when using an editor to\n>> prepare the commit message.  It does not affect the effects of a\n>> user's commit.template settings.\n>\n> Thanks, this looks very cleanly done. The only complaint I would make is\n> that it should probably include a simple test case.\n\nYes.  Also I am a _bit_ worried about the name \"status\", as the longer\nterm direction is to make \"status\" not \"a preview of commit\", may confuse\npeople who do read Release Notes.\n"},{"id":"129500","messageId":"20091208075517.GC12049@coredump.intra.peff.net","threadId":"21868","inReplyTo":"7vr5r6ndkz.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Add commit.status, --status, and --no-status","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-12-08T07:55:17Z","receivedAt":"2009-12-08T07:55:17Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Dec 07, 2009 at 11:13:00PM -0800, Junio C Hamano wrote:\n\n> >> This commit provides support for commit.status, --status, and\n> >> --no-status, which control whether or not the git status information\n> >> is included in the commit message template when using an editor to\n> >> prepare the commit message.  It does not affect the effects of a\n> >> user's commit.template settings.\n> >\n> > Thanks, this looks very cleanly done. The only complaint I would make is\n> > that it should probably include a simple test case.\n> \n> Yes.  Also I am a _bit_ worried about the name \"status\", as the longer\n> term direction is to make \"status\" not \"a preview of commit\", may confuse\n> people who do read Release Notes.\n\nI thought about that, but what other name does it have? That text has\nalways been called \"status\", and we will continue to support that output\nformat as \"git status\" _and_ as \"commit --dry-run\". So I think\nexplaining it as \"usually we stick the output of 'git status' into the\ncommit message, but this suppresses it\" is not that hard (and that was\nhow I read the documentation in his patch).\n\nThe only trick is that it is not a vanilla \"git status\", but rather\n\"status after we have staged things for commit\". But I think that is\nfairly obvious since you are, after all, calling \"commit\".\n\nBut then again, I am probably way too deep in this topic to provide a\nregular git user's perspective of what is obvious.\n\n-Peff\n"},{"id":"129539","messageId":"88a2333a0912080607q1881ce68j269eeba75769b1fa@mail.gmail.com","threadId":"21868","inReplyTo":"7vr5r6ndkz.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Add commit.status, --status, and --no-status","fromName":"James P. Howard, II","fromEmail":"jh@jameshoward.us","sentAt":"2009-12-08T14:07:33Z","receivedAt":"2009-12-08T14:07:33Z","isPatch":true,"sender":{"key":"jh@jameshoward.us","avatar":"https://avatars.githubusercontent.com/u/156522?v=4"},"body":"On Tue, Dec 8, 2009 at 02:13, Junio C Hamano <gitster@pobox.com> wrote:\n> Jeff King <peff@peff.net> writes:\n>\n>> On Mon, Dec 07, 2009 at 05:45:27PM -0500, James P. Howard, II wrote:\n>>\n>>> This commit provides support for commit.status, --status, and\n>>> --no-status, which control whether or not the git status information\n>>> is included in the commit message template when using an editor to\n>>> prepare the commit message.  It does not affect the effects of a\n>>> user's commit.template settings.\n>>\n>> Thanks, this looks very cleanly done. The only complaint I would make is\n>> that it should probably include a simple test case.\n>\n> Yes.  Also I am a _bit_ worried about the name \"status\", as the longer\n> term direction is to make \"status\" not \"a preview of commit\", may confuse\n> people who do read Release Notes.\n\nRight now, this option does not affect how the commit message is prepared\nin git tag.  If the option were extended to cover that case as well, what would\na sensible name for the option be, then?\n\nJames\n\n-- \nJames P. Howard, II, MPA MBCS\njh@jameshoward.us\n"}]}