From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Subject: [PATCH 5/6] log: pass rev_info to git_log_config()
Date: Wed, 3 Oct 2012 18:33:38 -0700 [thread overview]
Message-ID: <1349314419-8397-6-git-send-email-gitster@pobox.com> (raw)
In-Reply-To: <1349314419-8397-1-git-send-email-gitster@pobox.com>
Call init_revisions() first to prepare the revision traversal
parameters and pass it to git_log_config(), so that necessary bits
in the traversal parameters can be tweaked before we call the
command line parsing infrastructure setup_revisions() from
the cmd_log_init_finish() function.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
* This is made separate from the next one that touches the contents
of "rev" to make sure the existing code does not depend on the
current initialization order. I do not think it does but better
be careful to keep the history easier to bisect, than be sorry
when an issue does appear.
builtin/log.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/builtin/log.c b/builtin/log.c
index 09cf43e..07a0078 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -360,9 +360,8 @@ int cmd_whatchanged(int argc, const char **argv, const char *prefix)
struct rev_info rev;
struct setup_revision_opt opt;
- git_config(git_log_config, NULL);
-
init_revisions(&rev, prefix);
+ git_config(git_log_config, &rev);
rev.diff = 1;
rev.simplify_history = 0;
memset(&opt, 0, sizeof(opt));
@@ -450,10 +449,9 @@ int cmd_show(int argc, const char **argv, const char *prefix)
struct pathspec match_all;
int i, count, ret = 0;
- git_config(git_log_config, NULL);
-
init_pathspec(&match_all, NULL);
init_revisions(&rev, prefix);
+ git_config(git_log_config, &rev);
rev.diff = 1;
rev.always_show_header = 1;
rev.no_walk = REVISION_WALK_NO_WALK_SORTED;
@@ -530,9 +528,8 @@ int cmd_log_reflog(int argc, const char **argv, const char *prefix)
struct rev_info rev;
struct setup_revision_opt opt;
- git_config(git_log_config, NULL);
-
init_revisions(&rev, prefix);
+ git_config(git_log_config, &rev);
init_reflog_walk(&rev.reflog_info);
rev.verbose_header = 1;
memset(&opt, 0, sizeof(opt));
@@ -552,9 +549,8 @@ int cmd_log(int argc, const char **argv, const char *prefix)
struct rev_info rev;
struct setup_revision_opt opt;
- git_config(git_log_config, NULL);
-
init_revisions(&rev, prefix);
+ git_config(git_log_config, &rev);
rev.always_show_header = 1;
memset(&opt, 0, sizeof(opt));
opt.def = "HEAD";
@@ -1121,8 +1117,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
extra_hdr.strdup_strings = 1;
extra_to.strdup_strings = 1;
extra_cc.strdup_strings = 1;
- git_config(git_format_config, NULL);
init_revisions(&rev, prefix);
+ git_config(git_format_config, &rev);
rev.commit_format = CMIT_FMT_EMAIL;
rev.verbose_header = 1;
rev.diff = 1;
--
1.8.0.rc0.57.g712528f
next prev parent reply other threads:[~2012-10-04 21:54 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-01 22:44 [ANNOUNCE] Git v1.8.0-rc0 Junio C Hamano
2012-10-03 20:18 ` grep.patternType (was: Re: [ANNOUNCE] Git v1.8.0-rc0) Junio C Hamano
2012-10-03 22:14 ` grep.patternType Junio C Hamano
2012-10-04 6:05 ` grep.patternType Michal Kiedrowicz
2012-10-05 5:38 ` grep.patternType J Smith
2012-10-04 1:33 ` [PATCH 0/6] Tying loose ends of extended "grep" Junio C Hamano
2012-10-04 1:33 ` [PATCH 1/6] grep: move configuration support to top-level grep.[ch] Junio C Hamano
2012-10-04 1:33 ` [PATCH 2/6] grep: move pattern-type bits " Junio C Hamano
2012-10-04 1:33 ` [PATCH 3/6] log --grep: use the same helper to set -E/-F options as "git grep" Junio C Hamano
2012-10-04 8:09 ` Jeff King
2012-10-04 1:33 ` [PATCH 4/6] log --grep: accept --basic-regexp and --perl-regexp Junio C Hamano
2012-10-04 8:12 ` Jeff King
2012-10-04 16:44 ` Junio C Hamano
2012-10-04 1:33 ` Junio C Hamano [this message]
2012-10-04 7:05 ` [PATCH 5/6] log: pass rev_info to git_log_config() Junio C Hamano
2012-10-05 4:16 ` Junio C Hamano
2012-10-05 15:33 ` Jeff King
2012-10-05 19:07 ` Junio C Hamano
2012-10-04 1:33 ` [PATCH 6/6] log --grep: honor grep.patterntype etc. configuration variables Junio C Hamano
2012-10-04 8:17 ` Jeff King
2012-10-04 16:46 ` Junio C Hamano
2012-10-04 18:01 ` Jeff King
2012-10-04 19:09 ` 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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1349314419-8397-6-git-send-email-gitster@pobox.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).