{"thread":{"id":"38815","subject":"[PATCH] [GSoC] Add configuration options for some commonly used command-line options","startedAt":"2015-03-15T19:29:33Z","lastAt":"2015-03-15T20:24:06Z","messageCount":3,"participants":["Koosha Khajehmoogahi","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"257741","messageId":"5505DD9D.8010102@posteo.de","threadId":"38815","inReplyTo":null,"subject":"[PATCH] [GSoC] Add configuration options for some commonly used command-line options","fromName":"Koosha Khajehmoogahi","fromEmail":"koosha@posteo.de","sentAt":"2015-03-15T19:29:33Z","receivedAt":"2015-03-15T19:29:33Z","isPatch":true,"sender":{"key":"koosha@posteo.de","avatar":null},"body":"This patch adds a 'showmerges' config. option for git-log.\nThis option determines whether the log should contain merge\ncommits or not. In essence, if this option is set to true,\ngit-log will be run as 'git-log --no-merges'.\n\nSigned-off-by: Koosha Khajehmoogahi <koosha@posteo.de>\n---\n Documentation/config.txt | 3 +++\n builtin/log.c            | 8 ++++++++\n 2 files changed, 11 insertions(+)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 1530255..7775b8c 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -1735,6 +1735,9 @@ log.showroot::\n \tTools like linkgit:git-log[1] or linkgit:git-whatchanged[1], which\n \tnormally hide the root commit will now show it. True by default.\n \n+log.showmerges::\n+\tIf true, merges will be shown in the log list. True by default.\n+\n log.mailmap::\n \tIf true, makes linkgit:git-log[1], linkgit:git-show[1], and\n \tlinkgit:git-whatchanged[1] assume `--use-mailmap`.\ndiff --git a/builtin/log.c b/builtin/log.c\nindex dd8f3fc..bb36f61 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -31,6 +31,7 @@ static const char *default_date_mode = NULL;\n \n static int default_abbrev_commit;\n static int default_show_root = 1;\n+static int default_max_parents = -1;\n static int decoration_style;\n static int decoration_given;\n static int use_mailmap_config;\n@@ -108,6 +109,7 @@ static void cmd_log_init_defaults(struct rev_info *rev)\n \trev->diffopt.stat_graph_width = -1; /* respect statGraphWidth config */\n \trev->abbrev_commit = default_abbrev_commit;\n \trev->show_root_diff = default_show_root;\n+\trev->max_parents = default_max_parents;\n \trev->subject_prefix = fmt_patch_subject_prefix;\n \tDIFF_OPT_SET(&rev->diffopt, ALLOW_TEXTCONV);\n \n@@ -390,6 +392,12 @@ static int git_log_config(const char *var, const char *value, void *cb)\n \t\tdefault_show_root = git_config_bool(var, value);\n \t\treturn 0;\n \t}\n+\n+\tif (!strcmp(var, \"log.showmerges\")) {\n+\t\tdefault_max_parents = git_config_bool(var, value) ? -1 : 1;\n+\t\treturn 0;\n+\t}\n+\n \tif (skip_prefix(var, \"color.decorate.\", &slot_name))\n \t\treturn parse_decorate_color_config(var, slot_name, value);\n \tif (!strcmp(var, \"log.mailmap\")) {\n-- \n1.9.1\n"},{"id":"257742","messageId":"5505DEF4.3060208@posteo.de","threadId":"38815","inReplyTo":"5505DD9D.8010102@posteo.de","subject":"Re: [PATCH] [GSoC] Add configuration options for some commonly used command-line options","fromName":"Koosha Khajehmoogahi","fromEmail":"koosha@posteo.de","sentAt":"2015-03-15T19:35:16Z","receivedAt":"2015-03-15T19:35:16Z","isPatch":true,"sender":{"key":"koosha@posteo.de","avatar":null},"body":"\n\nOn 03/15/2015 08:29 PM, Koosha Khajehmoogahi wrote:\n> This patch adds a 'showmerges' config. option for git-log.\n> This option determines whether the log should contain merge\n> commits or not. In essence, if this option is set to true,\n\nSorry, this should be 'false'.\n\n> git-log will be run as 'git-log --no-merges'.\n> \n> Signed-off-by: Koosha Khajehmoogahi <koosha@posteo.de>\n> ---\n>  Documentation/config.txt | 3 +++\n>  builtin/log.c            | 8 ++++++++\n>  2 files changed, 11 insertions(+)\n> \n> diff --git a/Documentation/config.txt b/Documentation/config.txt\n> index 1530255..7775b8c 100644\n> --- a/Documentation/config.txt\n> +++ b/Documentation/config.txt\n> @@ -1735,6 +1735,9 @@ log.showroot::\n>  \tTools like linkgit:git-log[1] or linkgit:git-whatchanged[1], which\n>  \tnormally hide the root commit will now show it. True by default.\n>  \n> +log.showmerges::\n> +\tIf true, merges will be shown in the log list. True by default.\n> +\n>  log.mailmap::\n>  \tIf true, makes linkgit:git-log[1], linkgit:git-show[1], and\n>  \tlinkgit:git-whatchanged[1] assume `--use-mailmap`.\n> diff --git a/builtin/log.c b/builtin/log.c\n> index dd8f3fc..bb36f61 100644\n> --- a/builtin/log.c\n> +++ b/builtin/log.c\n> @@ -31,6 +31,7 @@ static const char *default_date_mode = NULL;\n>  \n>  static int default_abbrev_commit;\n>  static int default_show_root = 1;\n> +static int default_max_parents = -1;\n>  static int decoration_style;\n>  static int decoration_given;\n>  static int use_mailmap_config;\n> @@ -108,6 +109,7 @@ static void cmd_log_init_defaults(struct rev_info *rev)\n>  \trev->diffopt.stat_graph_width = -1; /* respect statGraphWidth config */\n>  \trev->abbrev_commit = default_abbrev_commit;\n>  \trev->show_root_diff = default_show_root;\n> +\trev->max_parents = default_max_parents;\n>  \trev->subject_prefix = fmt_patch_subject_prefix;\n>  \tDIFF_OPT_SET(&rev->diffopt, ALLOW_TEXTCONV);\n>  \n> @@ -390,6 +392,12 @@ static int git_log_config(const char *var, const char *value, void *cb)\n>  \t\tdefault_show_root = git_config_bool(var, value);\n>  \t\treturn 0;\n>  \t}\n> +\n> +\tif (!strcmp(var, \"log.showmerges\")) {\n> +\t\tdefault_max_parents = git_config_bool(var, value) ? -1 : 1;\n> +\t\treturn 0;\n> +\t}\n> +\n>  \tif (skip_prefix(var, \"color.decorate.\", &slot_name))\n>  \t\treturn parse_decorate_color_config(var, slot_name, value);\n>  \tif (!strcmp(var, \"log.mailmap\")) {\n> \n\n-- \nKoosha\n"},{"id":"257746","messageId":"xmqqlhiyt3fd.fsf@gitster.dls.corp.google.com","threadId":"38815","inReplyTo":"5505DD9D.8010102@posteo.de","subject":"Re: [PATCH] [GSoC] Add configuration options for some commonly used command-line options","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-03-15T20:24:06Z","receivedAt":"2015-03-15T20:24:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Koosha Khajehmoogahi <koosha@posteo.de> writes:\n\n> This patch adds a 'showmerges' config. option for git-log.\n> This option determines whether the log should contain merge\n> commits or not. In essence, if this option is set to true,\n> git-log will be run as 'git-log --no-merges'.\n>\n> Signed-off-by: Koosha Khajehmoogahi <koosha@posteo.de>\n> ---\n>  Documentation/config.txt | 3 +++\n>  builtin/log.c            | 8 ++++++++\n>  2 files changed, 11 insertions(+)\n>\n> diff --git a/Documentation/config.txt b/Documentation/config.txt\n> index 1530255..7775b8c 100644\n> --- a/Documentation/config.txt\n> +++ b/Documentation/config.txt\n> @@ -1735,6 +1735,9 @@ log.showroot::\n>  \tTools like linkgit:git-log[1] or linkgit:git-whatchanged[1], which\n>  \tnormally hide the root commit will now show it. True by default.\n>  \n> +log.showmerges::\n> +\tIf true, merges will be shown in the log list. True by default.\n\nWhen you have to help your colleague by inspecting the history in\nher repository, and your colleague has this set to false, and you do\nwant your \"git log\" to show merge commits, how would you override\nthis setting?\n\n\tgit log --merges\n\nis not it.\n\nAvoid introducing a configuration that users cannot override it from\nthe command line.  If there is a way to override (and for the\npurpose of this discussion, \"git -c log.showmerges=yes\" does not\ncount), document it here.\n\nTests need to make sure that (1) with configuration without command\nline override, the various settings of the variable give behaviour\nyou wanted to give, and (2) with configuration with command line\noverride, the values set to the variable does not have any effect to\nthe behaviour (i.e. the command line override wins).\n\nThanks.\n"}]}