From: Ramkumar Ramachandra <artagnon@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Git Mailing List <git@vger.kernel.org>,
Jonathan Nieder <jrnieder@gmail.com>
Subject: [PATCH v6 3/3] merge: Make 'merge.log' an integer or boolean option
Date: Wed, 25 Aug 2010 16:18:50 +0530 [thread overview]
Message-ID: <1282733330-32334-4-git-send-email-artagnon@gmail.com> (raw)
In-Reply-To: <1282733330-32334-1-git-send-email-artagnon@gmail.com>
Make 'merge.log' an integer or boolean option to set the number of
shortlog entries to display in the merge commit. Note that it defaults
to false, and that true means a default value of 20. Also update
corresponding documentation.
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Thanks-to: Jonathan Nieder <jrnieder@gmail.com>
Thanks-to: Johannes Sixt <j.sixt@viscovery.net>
---
Documentation/git-fmt-merge-msg.txt | 6 ++++--
Documentation/merge-config.txt | 6 ++++--
builtin/fmt-merge-msg.c | 14 +++++---------
builtin/merge.c | 8 ++++++--
4 files changed, 19 insertions(+), 15 deletions(-)
diff --git a/Documentation/git-fmt-merge-msg.txt b/Documentation/git-fmt-merge-msg.txt
index f04a9ff..40dba8c 100644
--- a/Documentation/git-fmt-merge-msg.txt
+++ b/Documentation/git-fmt-merge-msg.txt
@@ -54,8 +54,10 @@ CONFIGURATION
-------------
merge.log::
- Whether to include summaries of merged commits in newly
- merge commit messages. False by default.
+ In addition to branch names, populate the log message with at
+ most the specified number of one-line descriptions from the
+ actual commits that are being merged. Defaults to false, and
+ true is a synoym for 20.
merge.summary::
Synonym to `merge.log`; this is deprecated and will be removed in
diff --git a/Documentation/merge-config.txt b/Documentation/merge-config.txt
index b72f533..92772e7 100644
--- a/Documentation/merge-config.txt
+++ b/Documentation/merge-config.txt
@@ -7,8 +7,10 @@ merge.conflictstyle::
marker and the original text before the `=======` marker.
merge.log::
- Whether to include summaries of merged commits in newly created
- merge commit messages. False by default.
+ In addition to branch names, populate the log message with at
+ most the specified number of one-line descriptions from the
+ actual commits that are being merged. Defaults to false, and
+ true is a synoym for 20.
merge.renameLimit::
The number of files to consider when performing rename detection
diff --git a/builtin/fmt-merge-msg.c b/builtin/fmt-merge-msg.c
index ec933df..b61416e 100644
--- a/builtin/fmt-merge-msg.c
+++ b/builtin/fmt-merge-msg.c
@@ -15,15 +15,11 @@ static int shortlog_len;
static int fmt_merge_msg_config(const char *key, const char *value, void *cb)
{
- static int found_merge_log = 0;
- if (!strcmp("merge.log", key)) {
- found_merge_log = 1;
- shortlog_len = git_config_bool(key, value) ? DEFAULT_MERGE_LOG_LEN : 0;
- return 0;
- }
- if (!found_merge_log && !strcmp("merge.summary", key)) {
- shortlog_len = git_config_bool(key, value) ? DEFAULT_MERGE_LOG_LEN : 0;
- return 0;
+ if (!strcmp(key, "merge.log") || !strcmp(key, "merge.summary")) {
+ int is_bool;
+ shortlog_len = git_config_bool_or_int(key, value, &is_bool);
+ if (is_bool && shortlog_len)
+ shortlog_len = DEFAULT_MERGE_LOG_LEN;
}
return 0;
}
diff --git a/builtin/merge.c b/builtin/merge.c
index b067b84..45ff6d6 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -507,8 +507,12 @@ static int git_merge_config(const char *k, const char *v, void *cb)
return git_config_string(&pull_twohead, k, v);
else if (!strcmp(k, "pull.octopus"))
return git_config_string(&pull_octopus, k, v);
- else if (!strcmp(k, "merge.log") || !strcmp(k, "merge.summary"))
- shortlog_len = git_config_bool(k, v) ? DEFAULT_MERGE_LOG_LEN : 0;
+ else if (!strcmp(k, "merge.log") || !strcmp(k, "merge.summary")) {
+ int is_bool;
+ shortlog_len = git_config_bool_or_int(k, v, &is_bool);
+ if (is_bool && shortlog_len)
+ shortlog_len = DEFAULT_MERGE_LOG_LEN;
+ }
else if (!strcmp(k, "merge.renormalize"))
option_renormalize = git_config_bool(k, v);
return git_diff_ui_config(k, v, cb);
--
1.7.2.2.409.gdbb11.dirty
next prev parent reply other threads:[~2010-08-25 10:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-25 10:48 [PATCH v6 0/3] rr/fmt-merge-msg replacement Ramkumar Ramachandra
2010-08-25 10:48 ` [PATCH v6 1/3] fmt_merge_msg: Change fmt_merge_msg API to accept shortlog_len Ramkumar Ramachandra
2010-08-25 10:48 ` [PATCH v6 2/3] merge: Make '--log' an integer option for number of shortlog entries Ramkumar Ramachandra
2010-08-25 10:48 ` Ramkumar Ramachandra [this message]
2010-08-25 20:43 ` [PATCH v6 0/3] rr/fmt-merge-msg replacement Junio C Hamano
2010-08-26 5:12 ` Ramkumar Ramachandra
2010-08-26 16:58 ` Junio C Hamano
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=1282733330-32334-4-git-send-email-artagnon@gmail.com \
--to=artagnon@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jrnieder@gmail.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).