{"thread":{"id":"22692","subject":"[PATCH] Add `[decorate]' configuration section.","startedAt":"2010-02-17T08:22:46Z","lastAt":"2010-02-26T03:57:28Z","messageCount":10,"participants":["Steven Drake","Junio C Hamano","Heiko Voigt","Thomas Rast"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"134849","messageId":"16c38171fc04cee7bdc607bb4c6586925b15278c.1266394059.git.sdrake@xnet.co.nz","threadId":"22692","inReplyTo":null,"subject":"[PATCH] Add `[decorate]' configuration section.","fromName":"Steven Drake","fromEmail":"sdrake@xnet.co.nz","sentAt":"2010-02-17T08:22:46Z","receivedAt":"2010-02-17T08:22:46Z","isPatch":true,"sender":{"key":"sdrake@xnet.co.nz","avatar":null},"body":"This can be used to enable the display of ref names of commits that are\nshown by log commands.  Each of the log commands (whatchanged, show,\nreflog, and log) can be enable separately.\n\ne.g:\n\t[decorate]\n\t\tlog\n\t\treflog\n\nSigned-off-by: Steven Drake <sdrake@xnet.co.nz>\n---\n Documentation/config.txt |   12 ++++++++++++\n builtin-log.c            |   43 +++++++++++++++++++++++++++++++++++++++----\n 2 files changed, 51 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 4c36aa9..dc9d6fd 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -740,6 +740,18 @@ commit.template::\n \t\"{tilde}/\" is expanded to the value of `$HOME` and \"{tilde}user/\" to the\n \tspecified user's home directory.\n \n+decorate.whatchanged::\n+decorate.log::\n+decorate.reflog::\n+decorate.show::\n+\tPrint out the ref names of any commits that are shown by the different\n+\tlog command.  If 'short' is specified, the ref name prefixes\n+\t'refs/heads/', 'refs/tags/' and 'refs/remotes/' will not be printed.\n+\tIf 'full' is specified, the full ref name (including prefix) will be\n+\tprinted.  May be set as a bool which will be treated as 'short'.\n+\tThis is the same as the log commands '--decorate' option.\n+\n+\n diff.autorefreshindex::\n \tWhen using 'git diff' to compare with work tree\n \tfiles, do not consider stat-only change as changed.\ndiff --git a/builtin-log.c b/builtin-log.c\nindex 8d16832..51b5e10 100644\n--- a/builtin-log.c\n+++ b/builtin-log.c\n@@ -24,6 +24,8 @@\n static const char *default_date_mode = NULL;\n \n static int default_show_root = 1;\n+static struct { int whatchanged, show, reflog, log;} decorate = {0,0,0,0};\n+static int decoration_style = 0;\n static const char *fmt_patch_subject_prefix = \"PATCH\";\n static const char *fmt_pretty;\n \n@@ -35,7 +37,6 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,\n \t\t      struct rev_info *rev)\n {\n \tint i;\n-\tint decoration_style = 0;\n \n \trev->abbrev = DEFAULT_ABBREV;\n \trev->commit_format = CMIT_FMT_DEFAULT;\n@@ -58,9 +59,6 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,\n \t\tusage(builtin_log_usage);\n \targc = setup_revisions(argc, argv, rev, \"HEAD\");\n \n-\tif (!rev->show_notes_given && !rev->pretty_given)\n-\t\trev->show_notes = 1;\n-\n \tif (rev->diffopt.pickaxe || rev->diffopt.filter)\n \t\trev->always_show_header = 0;\n \tif (DIFF_OPT_TST(&rev->diffopt, FOLLOW_RENAMES)) {\n@@ -244,8 +242,41 @@ static int cmd_log_walk(struct rev_info *rev)\n \treturn diff_result_code(&rev->diffopt, 0);\n }\n \n+static int set_decoration_style(const char *var, const char *value)\n+{\n+\tswitch (git_config_maybe_bool(var, value)) {\n+\tcase 0:\n+\t\treturn 0;\n+\tcase 1:\n+\t\treturn DECORATE_SHORT_REFS;\n+\tdefault:\n+\t\tbreak;\n+\t}\n+\tif (!strcmp(value, \"full\"))\n+\t\treturn DECORATE_FULL_REFS;\n+\telse if (!strcmp(value, \"short\"))\n+\t\treturn DECORATE_SHORT_REFS;\n+\treturn 0;\n+}\n+\n static int git_log_config(const char *var, const char *value, void *cb)\n {\n+\tif (!strcmp(var, \"decorate.log\")) {\n+\t\tdecorate.log = set_decoration_style(var, value);\n+\t\treturn 0;\n+\t}\n+\tif (!strcmp(var, \"decorate.reflog\")) {\n+\t\tdecorate.reflog = set_decoration_style(var, value);\n+\t\treturn 0;\n+\t}\n+\tif (!strcmp(var, \"decorate.show\")) {\n+\t\tdecorate.show = set_decoration_style(var, value);\n+\t\treturn 0;\n+\t}\n+\tif (!strcmp(var, \"decorate.whatchanged\")) {\n+\t\tdecorate.whatchanged = set_decoration_style(var, value);\n+\t\treturn 0;\n+\t}\n \tif (!strcmp(var, \"format.pretty\"))\n \t\treturn git_config_string(&fmt_pretty, var, value);\n \tif (!strcmp(var, \"format.subjectprefix\"))\n@@ -264,6 +295,7 @@ int cmd_whatchanged(int argc, const char **argv, const char *prefix)\n \tstruct rev_info rev;\n \n \tgit_config(git_log_config, NULL);\n+\tdecoration_style = decorate.whatchanged;\n \n \tif (diff_use_color_default == -1)\n \t\tdiff_use_color_default = git_use_color_default;\n@@ -331,6 +363,7 @@ int cmd_show(int argc, const char **argv, const char *prefix)\n \tint i, count, ret = 0;\n \n \tgit_config(git_log_config, NULL);\n+\tdecoration_style = decorate.show;\n \n \tif (diff_use_color_default == -1)\n \t\tdiff_use_color_default = git_use_color_default;\n@@ -407,6 +440,7 @@ int cmd_log_reflog(int argc, const char **argv, const char *prefix)\n \tstruct rev_info rev;\n \n \tgit_config(git_log_config, NULL);\n+\tdecoration_style = decorate.reflog;\n \n \tif (diff_use_color_default == -1)\n \t\tdiff_use_color_default = git_use_color_default;\n@@ -440,6 +474,7 @@ int cmd_log(int argc, const char **argv, const char *prefix)\n \tstruct rev_info rev;\n \n \tgit_config(git_log_config, NULL);\n+\tdecoration_style = decorate.log;\n \n \tif (diff_use_color_default == -1)\n \t\tdiff_use_color_default = git_use_color_default;\n-- \n1.6.6\n"},{"id":"134869","messageId":"7vr5ojwy38.fsf@alter.siamese.dyndns.org","threadId":"22692","inReplyTo":"16c38171fc04cee7bdc607bb4c6586925b15278c.1266394059.git.sdrake@xnet.co.nz","subject":"Re: [PATCH] Add `[decorate]' configuration section.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-02-17T17:50:35Z","receivedAt":"2010-02-17T17:50:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Steven Drake <sdrake@xnet.co.nz> writes:\n\n> This can be used to enable the display of ref names of commits that are\n> shown by log commands.  Each of the log commands (whatchanged, show,\n> reflog, and log) can be enable separately.\n>\n> e.g:\n> \t[decorate]\n> \t\tlog\n> \t\treflog\n\nWhat is the reason to set these configuration differently except \"because\nwe can\"?  Also, if it is a good idea to allow setting them independently,\nyou would need to make it easier for people who want to set them all to\nthe same value, e.g. \"[decorate] logfamily = short\" or something.\n\nI somehow find the older \"log.decorate\" much more natural and the changes\nfrom it to this version not worth it, but maybe it is just me.\n"},{"id":"134871","messageId":"7vd403vhrn.fsf@alter.siamese.dyndns.org","threadId":"22692","inReplyTo":"7vr5ojwy38.fsf@alter.siamese.dyndns.org","subject":"Re* [PATCH] Add `[decorate]' configuration section.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-02-17T18:28:28Z","receivedAt":"2010-02-17T18:28:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> I somehow find the older \"log.decorate\" much more natural and the changes\n> from it to this version not worth it, but maybe it is just me.\n\nI was looking at your previous one.  Here is a bit of clean-up on top of\nyours.\n\n-- >8 --\nSubject: [PATCH] log.decorate: usability fixes\n\nThe configuration is meant to suppliment --decorate command line option\nthat can be used as a boolean to turn the feature on, so it is natural\nto expect\n\n\t[log]\n\t\tdecorate\n\t\tdecorate = yes\n\nto work.  The original commit would segfault with the first one, and\nwould not understand the second one.\n\nOnce a user has this configuration in ~/.gitconfig, there needs to be a\nway to override it from the command line.  Add --no-decorate option to\nlog family and also allow --decorate=no to mean the same thing.  Since\nwe allow setting log.decorate to 'true', the command line also should\naccept --decorate=yes and behave accordingly.\n\nNew tests in t4202 are designed to exercise the interaction between the\nconfiguration variable and the command line option that overrides it.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n Documentation/git-log.txt |    3 +-\n builtin-log.c             |   35 +++++++++++++++++++++++---------\n t/t4202-log.sh            |   49 +++++++++++++++++++++++++++++++++++++++++++++\n 3 files changed, 76 insertions(+), 11 deletions(-)\n\ndiff --git a/Documentation/git-log.txt b/Documentation/git-log.txt\nindex 0e39bb6..64bb879 100644\n--- a/Documentation/git-log.txt\n+++ b/Documentation/git-log.txt\n@@ -37,7 +37,8 @@ include::diff-options.txt[]\n \tand <until>, see \"SPECIFYING REVISIONS\" section in\n \tlinkgit:git-rev-parse[1].\n \n---decorate[=short|full]::\n+--no-decorate::\n+--decorate[=short|full|no]::\n \tPrint out the ref names of any commits that are shown. If 'short' is\n \tspecified, the ref name prefixes 'refs/heads/', 'refs/tags/' and\n \t'refs/remotes/' will not be printed. If 'full' is specified, the\ndiff --git a/builtin-log.c b/builtin-log.c\nindex 3100dc0..0afba31 100644\n--- a/builtin-log.c\n+++ b/builtin-log.c\n@@ -24,7 +24,7 @@\n static const char *default_date_mode = NULL;\n \n static int default_show_root = 1;\n-static int decoration_style = 0;\n+static int decoration_style;\n static const char *fmt_patch_subject_prefix = \"PATCH\";\n static const char *fmt_pretty;\n \n@@ -32,6 +32,23 @@ static const char * const builtin_log_usage =\n \t\"git log [<options>] [<since>..<until>] [[--] <path>...]\\n\"\n \t\"   or: git show [options] <object>...\";\n \n+static int parse_decoration_style(const char *var, const char *value)\n+{\n+\tswitch (git_config_maybe_bool(var, value)) {\n+\tcase 1:\n+\t\treturn DECORATE_SHORT_REFS;\n+\tcase 0:\n+\t\treturn 0;\n+\tdefault:\n+\t\tbreak;\n+\t}\n+\tif (!strcmp(value, \"full\"))\n+\t\treturn DECORATE_FULL_REFS;\n+\telse if (!strcmp(value, \"short\"))\n+\t\treturn DECORATE_SHORT_REFS;\n+\treturn -1;\n+}\n+\n static void cmd_log_init(int argc, const char **argv, const char *prefix,\n \t\t      struct rev_info *rev)\n {\n@@ -74,12 +91,11 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,\n \t\t\tdecoration_style = DECORATE_SHORT_REFS;\n \t\t} else if (!prefixcmp(arg, \"--decorate=\")) {\n \t\t\tconst char *v = skip_prefix(arg, \"--decorate=\");\n-\t\t\tif (!strcmp(v, \"full\"))\n-\t\t\t\tdecoration_style = DECORATE_FULL_REFS;\n-\t\t\telse if (!strcmp(v, \"short\"))\n-\t\t\t\tdecoration_style = DECORATE_SHORT_REFS;\n-\t\t\telse\n+\t\t\tdecoration_style = parse_decoration_style(arg, v);\n+\t\t\tif (decoration_style < 0)\n \t\t\t\tdie(\"invalid --decorate option: %s\", arg);\n+\t\t} else if (!strcmp(arg, \"--no-decorate\")) {\n+\t\t\tdecoration_style = 0;\n \t\t} else if (!strcmp(arg, \"--source\")) {\n \t\t\trev->show_source = 1;\n \t\t} else if (!strcmp(arg, \"-h\")) {\n@@ -253,10 +269,9 @@ static int git_log_config(const char *var, const char *value, void *cb)\n \tif (!strcmp(var, \"log.date\"))\n \t\treturn git_config_string(&default_date_mode, var, value);\n \tif (!strcmp(var, \"log.decorate\")) {\n-\t\tif (!strcmp(value, \"full\"))\n-\t\t\tdecoration_style = DECORATE_FULL_REFS;\n-\t\telse if (!strcmp(value, \"short\"))\n-\t\t\tdecoration_style = DECORATE_SHORT_REFS;\n+\t\tdecoration_style = parse_decoration_style(var, value);\n+\t\tif (decoration_style < 0)\n+\t\t\tdecoration_style = 0; /* maybe warn? */\n \t\treturn 0;\n \t}\n \tif (!strcmp(var, \"log.showroot\")) {\ndiff --git a/t/t4202-log.sh b/t/t4202-log.sh\nindex 1dc224f..2230e60 100755\n--- a/t/t4202-log.sh\n+++ b/t/t4202-log.sh\n@@ -387,5 +387,54 @@ test_expect_success 'log --graph with merge' '\n \ttest_cmp expect actual\n '\n \n+test_expect_success 'log.decorate configuration' '\n+\tgit config --unset-all log.decorate || :\n+\n+\tgit log --oneline >expect.none &&\n+\tgit log --oneline --decorate >expect.short &&\n+\tgit log --oneline --decorate=full >expect.full &&\n+\n+\techo \"[log] decorate\" >>.git/config &&\n+\tgit log --oneline >actual &&\n+\ttest_cmp expect.short actual &&\n+\n+\tgit config --unset-all log.decorate &&\n+\tgit config log.decorate true &&\n+\tgit log --oneline >actual &&\n+\ttest_cmp expect.short actual &&\n+\tgit log --oneline --decorate=full >actual &&\n+\ttest_cmp expect.full actual &&\n+\tgit log --oneline --decorate=no >actual &&\n+\ttest_cmp expect.none actual &&\n+\n+\tgit config --unset-all log.decorate &&\n+\tgit config log.decorate no &&\n+\tgit log --oneline >actual &&\n+\ttest_cmp expect.none actual &&\n+\tgit log --oneline --decorate >actual &&\n+\ttest_cmp expect.short actual &&\n+\tgit log --oneline --decorate=full >actual &&\n+\ttest_cmp expect.full actual &&\n+\n+\tgit config --unset-all log.decorate &&\n+\tgit config log.decorate short &&\n+\tgit log --oneline >actual &&\n+\ttest_cmp expect.short actual &&\n+\tgit log --oneline --no-decorate >actual &&\n+\ttest_cmp expect.none actual &&\n+\tgit log --oneline --decorate=full >actual &&\n+\ttest_cmp expect.full actual &&\n+\n+\tgit config --unset-all log.decorate &&\n+\tgit config log.decorate full &&\n+\tgit log --oneline >actual &&\n+\ttest_cmp expect.full actual &&\n+\tgit log --oneline --no-decorate >actual &&\n+\ttest_cmp expect.none actual &&\n+\tgit log --oneline --decorate >actual &&\n+\ttest_cmp expect.short actual\n+\n+'\n+\n test_done\n \n-- \n1.7.0.54.gbe03aa\n"},{"id":"135164","messageId":"20100220171732.GA15561@book.hvoigt.net","threadId":"22692","inReplyTo":"7vd403vhrn.fsf@alter.siamese.dyndns.org","subject":"Re: Re* [PATCH] Add `[decorate]' configuration section.","fromName":"Heiko Voigt","fromEmail":"hvoigt@hvoigt.net","sentAt":"2010-02-20T17:17:44Z","receivedAt":"2010-02-20T17:17:44Z","isPatch":true,"sender":{"key":"hvoigt@hvoigt.net","avatar":"https://avatars.githubusercontent.com/u/184958?v=4"},"body":"On Wed, Feb 17, 2010 at 10:28:28AM -0800, Junio C Hamano wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n\nI have just seen this in Junios tree:\n\ncommit 8a3d203bd02bec48a02557961899d81da172fa23 writes:\n> Author: Junio C Hamano <gitster@pobox.com>\n> Date:   Wed Feb 17 10:20:49 2010 -0800\n> \n>     log.decorate: usability fixes\n>     \n>     The configuration is meant to suppliment --decorate command line option\n>     that can be used as a boolean to turn the feature on, so it is natural\n>     to expect\n>     \n>         [log]\n>                 decorate\n>                 decorate = yes\n>     \n>     to work.  The original commit would segfault with the first one, and\n>     would not understand the second one.\n>     \n>     Once a user has this configuration in ~/.gitconfig, there needs to be a\n>     way to override it from the command line.  Add --no-decorate option to\n>     log family and also allow --decorate=no to mean the same thing.  Since\n>     we allow setting log.decorate to 'true', the command line also should\n>     accept --decorate=yes and behave accordingly.\n\nHow about calling that option --plain, --porcelain or similar and have it\ndisable all configs which change the current output? Because if we can go this\nway I would actually like to add more useful configurations. For example I\nalways find me typing:\n\ngit log --decorate --abbrev-commit -p\n\nwhich in most situations just gives you a nicer overview.\n\ncheers Heiko\n"},{"id":"135170","messageId":"201002201849.03656.trast@student.ethz.ch","threadId":"22692","inReplyTo":"20100220171732.GA15561@book.hvoigt.net","subject":"Re: Re* [PATCH] Add `[decorate]' configuration section.","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2010-02-20T17:49:03Z","receivedAt":"2010-02-20T17:49:03Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"On Saturday 20 February 2010 18:17:44 Heiko Voigt wrote:\n> On Wed, Feb 17, 2010 at 10:28:28AM -0800, Junio C Hamano wrote:\n> > Junio C Hamano <gitster@pobox.com> writes:\n> \n> I have just seen this in Junios tree:\n> \n> commit 8a3d203bd02bec48a02557961899d81da172fa23 writes:\n> > Author: Junio C Hamano <gitster@pobox.com>\n[...]\n> >     Once a user has this configuration in ~/.gitconfig, there needs to be a\n> >     way to override it from the command line.  Add --no-decorate option to\n> >     log family and also allow --decorate=no to mean the same thing.  Since\n> >     we allow setting log.decorate to 'true', the command line also should\n> >     accept --decorate=yes and behave accordingly.\n> \n> How about calling that option --plain, --porcelain or similar and have it\n> disable all configs which change the current output? Because if we can go this\n> way I would actually like to add more useful configurations. For example I\n> always find me typing:\n> \n> git log --decorate --abbrev-commit -p\n> \n> which in most situations just gives you a nicer overview.\n\nSince 66b2ed0 (Fix \"log\" family not to be too agressive about showing\nnotes, 2010-01-20), git log --pretty=... doesn't show notes.  Perhaps\nat least the 'raw' format should also implicitly disable other user\nconfiguration, including this?\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"},{"id":"135243","messageId":"7vk4u53ji4.fsf@alter.siamese.dyndns.org","threadId":"22692","inReplyTo":"201002201849.03656.trast@student.ethz.ch","subject":"Re: Re* [PATCH] Add `[decorate]' configuration section.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-02-22T05:52:03Z","receivedAt":"2010-02-22T05:52:03Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thomas Rast <trast@student.ethz.ch> writes:\n\n> Since 66b2ed0 (Fix \"log\" family not to be too agressive about showing\n> notes, 2010-01-20), git log --pretty=... doesn't show notes.  Perhaps\n> at least the 'raw' format should also implicitly disable other user\n> configuration, including this?\n\nSounds like a reasonable suggestion.\n"},{"id":"135701","messageId":"alpine.LNX.2.00.1002261131190.19126@vqena.qenxr.bet.am","threadId":"22692","inReplyTo":"7vr5ojwy38.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Add `[decorate]' configuration section.","fromName":"Steven Drake","fromEmail":"sdrake@xnet.co.nz","sentAt":"2010-02-25T22:44:11Z","receivedAt":"2010-02-25T22:44:11Z","isPatch":true,"sender":{"key":"sdrake@xnet.co.nz","avatar":null},"body":"Sorry for taking so  long to reply to your email, got destracted.\n \nOn Wed, 17 Feb 2010, Junio C Hamano wrote:\n> Steven Drake <sdrake@xnet.co.nz> writes:\n> \n> > This can be used to enable the display of ref names of commits that are\n> > shown by log commands.  Each of the log commands (whatchanged, show,\n> > reflog, and log) can be enable separately.\n> >\n> > e.g:\n> > \t[decorate]\n> > \t\tlog\n> > \t\treflog\n> \n> What is the reason to set these configuration differently except \"because\n> we can\"? \n\nBasicly yes, but I did this when I was looking at what you said in a reply\nabout the \"log.decorate\" changes, I.E.\n\n  On Tue, 16 Feb 2010, Junio C Hamano wrote:\n  > I was not worried about what your change does.  I am worried about\n  > protecting what the code after your change currently does from future\n  > changes done by other people while you are not actively watching the\n  > patches in flight on this list.\n\nBut that can easly be with the patch below.\n\n> Also, if it is a good idea to allow setting them independently,\n> you would need to make it easier for people who want to set them all to\n> the same value, e.g. \"[decorate] logfamily = short\" or something.\n\nGood Idea!\n\n> I somehow find the older \"log.decorate\" much more natural and the changes\n> from it to this version not worth it, but maybe it is just me.\n\nI agree with you, I just thought having a single \"[decorate]\" section in the\nconfig file was cleaner.  But nomater which way around it was done someone\nwould want t done the other way around.\n\n--- >8 ---\nSubject: [PATCH 1/1] log.decorate: future proofing against builtin-log.c changes\n\nInstead of directly setting 'decoration_style' in git_log_config() we set\nan intermediate variable, then for each of the commands we want\n'log.decorate' to have an affect 'decoration_style' is set from the\nintermediate.\n\nThis is to protect against future change to cmd_log_init() and how it is\nused or the commands 'log.decorate' affects.\n\nSigned-off-by: Steven Drake <sdrake@xnet.co.nz>\n---\n builtin-log.c |   12 ++++++++----\n 1 files changed, 8 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin-log.c b/builtin-log.c\nindex 0afba31..91712e6 100644\n--- a/builtin-log.c\n+++ b/builtin-log.c\n@@ -24,7 +24,7 @@\n static const char *default_date_mode = NULL;\n \n static int default_show_root = 1;\n-static int decoration_style;\n+static int default_decoration_style, decoration_style;\n static const char *fmt_patch_subject_prefix = \"PATCH\";\n static const char *fmt_pretty;\n \n@@ -269,9 +269,9 @@ static int git_log_config(const char *var, const char *value, void *cb)\n \tif (!strcmp(var, \"log.date\"))\n \t\treturn git_config_string(&default_date_mode, var, value);\n \tif (!strcmp(var, \"log.decorate\")) {\n-\t\tdecoration_style = parse_decoration_style(var, value);\n-\t\tif (decoration_style < 0)\n-\t\t\tdecoration_style = 0; /* maybe warn? */\n+\t\tdefault_decoration_style = parse_decoration_style(var, value);\n+\t\tif (default_decoration_style < 0)\n+\t\t\tdefault_decoration_style = 0; /* maybe warn? */\n \t\treturn 0;\n \t}\n \tif (!strcmp(var, \"log.showroot\")) {\n@@ -286,6 +286,7 @@ int cmd_whatchanged(int argc, const char **argv, const char *prefix)\n \tstruct rev_info rev;\n \n \tgit_config(git_log_config, NULL);\n+\tdecoration_style = default_decoration_style;\n \n \tif (diff_use_color_default == -1)\n \t\tdiff_use_color_default = git_use_color_default;\n@@ -353,6 +354,7 @@ int cmd_show(int argc, const char **argv, const char *prefix)\n \tint i, count, ret = 0;\n \n \tgit_config(git_log_config, NULL);\n+\tdecoration_style = default_decoration_style;\n \n \tif (diff_use_color_default == -1)\n \t\tdiff_use_color_default = git_use_color_default;\n@@ -429,6 +431,7 @@ int cmd_log_reflog(int argc, const char **argv, const char *prefix)\n \tstruct rev_info rev;\n \n \tgit_config(git_log_config, NULL);\n+\tdecoration_style = default_decoration_style;\n \n \tif (diff_use_color_default == -1)\n \t\tdiff_use_color_default = git_use_color_default;\n@@ -462,6 +465,7 @@ int cmd_log(int argc, const char **argv, const char *prefix)\n \tstruct rev_info rev;\n \n \tgit_config(git_log_config, NULL);\n+\tdecoration_style = default_decoration_style;\n \n \tif (diff_use_color_default == -1)\n \t\tdiff_use_color_default = git_use_color_default;\n-- \n1.6.6\n"},{"id":"135703","messageId":"7vk4u0rju2.fsf@alter.siamese.dyndns.org","threadId":"22692","inReplyTo":"alpine.LNX.2.00.1002261131190.19126@vqena.qenxr.bet.am","subject":"Re: [PATCH] Add `[decorate]' configuration section.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-02-25T23:12:21Z","receivedAt":"2010-02-25T23:12:21Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Steven Drake <sdrake@xnet.co.nz> writes:\n\n>   On Tue, 16 Feb 2010, Junio C Hamano wrote:\n>   > I was not worried about what your change does.  I am worried about\n>   > protecting what the code after your change currently does from future\n>   > changes done by other people while you are not actively watching the\n>   > patches in flight on this list.\n>\n> But that can easly be with the patch below.\n\nWhat does that buy us?  \"future changes\" can revert your patch to\nbuiltin-log.c easily.\n\nI was talking about having tests in the test suite; any \"future changes\"\nthat breaks the output your series has established would not pass if you\nspecify what the expected output should be there.  Of course they can\nchange the test pattern in their patches, but then we will immediately\nknow they are changing the output.\n"},{"id":"135707","messageId":"alpine.LNX.2.00.1002261304430.19372@vqena.qenxr.bet.am","threadId":"22692","inReplyTo":"7vk4u0rju2.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Add `[decorate]' configuration section.","fromName":"Steven Drake","fromEmail":"sdrake@xnet.co.nz","sentAt":"2010-02-26T00:06:13Z","receivedAt":"2010-02-26T00:06:13Z","isPatch":true,"sender":{"key":"sdrake@xnet.co.nz","avatar":null},"body":"On Thu, 25 Feb 2010, Junio C Hamano wrote:\n\n> Steven Drake <sdrake@xnet.co.nz> writes:\n> \n> >   On Tue, 16 Feb 2010, Junio C Hamano wrote:\n> >   > I was not worried about what your change does.  I am worried about\n> >   > protecting what the code after your change currently does from future\n> >   > changes done by other people while you are not actively watching the\n> >   > patches in flight on this list.\n> >\n> > But that can easly be with the patch below.\n> \n> What does that buy us?  \"future changes\" can revert your patch to\n> builtin-log.c easily.\n> \n> I was talking about having tests in the test suite; any \"future changes\"\n> that breaks the output your series has established would not pass if you\n> specify what the expected output should be there.  Of course they can\n> change the test pattern in their patches, but then we will immediately\n> know they are changing the output.\n\nSorry I didn't get what you meant!  I'll try writing a test.\n\n-- \nSteven\n"},{"id":"135724","messageId":"alpine.LNX.2.00.1002261655200.23793@vqena.qenxr.bet.am","threadId":"22692","inReplyTo":"alpine.LNX.2.00.1002261304430.19372@vqena.qenxr.bet.am","subject":"Re: [PATCH] Add `[decorate]' configuration section.","fromName":"Steven Drake","fromEmail":"sdrake@xnet.co.nz","sentAt":"2010-02-26T03:57:28Z","receivedAt":"2010-02-26T03:57:28Z","isPatch":true,"sender":{"key":"sdrake@xnet.co.nz","avatar":null},"body":"On Fri, 26 Feb 2010, Steven Drake wrote:\n> I'll try writing a test.\n\nOpps, noted that you did that in the \"log.decorate: usability fixes\" commit.\n\n-- \nSteven\n"}]}