From: Jared Hance <jaredhance@gmail.com>
To: git@vger.kernel.org
Cc: Jared Hance <jaredhance@gmail.com>
Subject: [PATCH v3 3/3] Use startup_info->prefix rather than prefix.
Date: Wed, 7 Mar 2012 17:21:27 -0500 [thread overview]
Message-ID: <a2980b437f2eb81b6bc28ad4ebbf05429485729e.1331158240.git.jaredhance@gmail.com> (raw)
In-Reply-To: <cover.1331158240.git.jaredhance@gmail.com>
In-Reply-To: <cover.1331158240.git.jaredhance@gmail.com>
In trace_repo_setup, prefix is passed in as startup_info->prefix. But, as
indicated but a FIXME comment, trace_repo_setup has access to
startup_info. The prefix parameter has therefore been eliminated.
Signed-off-by: Jared Hance <jaredhance@gmail.com>
---
cache.h | 2 +-
git.c | 2 +-
trace.c | 10 +++++-----
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/cache.h b/cache.h
index e5e1aa4..1113296 100644
--- a/cache.h
+++ b/cache.h
@@ -1213,7 +1213,7 @@ extern void trace_printf(const char *format, ...);
extern void trace_vprintf(const char *key, const char *format, va_list ap);
__attribute__((format (printf, 2, 3)))
extern void trace_argv_printf(const char **argv, const char *format, ...);
-extern void trace_repo_setup(const char *prefix);
+extern void trace_repo_setup(void);
extern int trace_want(const char *key);
extern void trace_strbuf(const char *key, const struct strbuf *buf);
diff --git a/git.c b/git.c
index 3805616..7dcc527 100644
--- a/git.c
+++ b/git.c
@@ -296,7 +296,7 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
if ((p->option & (RUN_SETUP | RUN_SETUP_GENTLY)) &&
startup_info->have_repository) /* get_git_dir() may set up repo, avoid that */
- trace_repo_setup(prefix);
+ trace_repo_setup();
}
commit_pager_choice();
diff --git a/trace.c b/trace.c
index d953416..09a470b 100644
--- a/trace.c
+++ b/trace.c
@@ -152,8 +152,7 @@ static const char *quote_crnl(const char *path)
return new_path;
}
-/* FIXME: move prefix to startup_info struct and get rid of this arg */
-void trace_repo_setup(const char *prefix)
+void trace_repo_setup(void)
{
static const char *key = "GIT_TRACE_SETUP";
const char *git_work_tree;
@@ -168,13 +167,14 @@ void trace_repo_setup(const char *prefix)
if (!(git_work_tree = get_git_work_tree()))
git_work_tree = "(null)";
- if (!prefix)
- prefix = "(null)";
+ if (!startup_info->prefix)
+ startup_info->prefix = "(null)";
trace_printf_key(key, "setup: git_dir: %s\n", quote_crnl(get_git_dir()));
trace_printf_key(key, "setup: worktree: %s\n", quote_crnl(git_work_tree));
trace_printf_key(key, "setup: cwd: %s\n", quote_crnl(cwd));
- trace_printf_key(key, "setup: prefix: %s\n", quote_crnl(prefix));
+ trace_printf_key(key, "setup: prefix: %s\n",
+ quote_crnl(startup_info->prefix));
}
int trace_want(const char *key)
--
1.7.3.4
next prev parent reply other threads:[~2012-03-07 22:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-07 22:21 [PATCH v3 0/3] Fix documented fixme's throughout Jared Hance
2012-03-07 22:21 ` [PATCH v3 1/3] Fix memory leak in apply_patch in apply.c Jared Hance
2012-03-07 23:39 ` Junio C Hamano
2012-03-21 22:18 ` [PATCH 1/2] apply: free patch->{def,old,new}_name fields Junio C Hamano
2012-03-21 22:21 ` [PATCH 2/2] apply: free patch->result Junio C Hamano
2012-03-07 22:21 ` [PATCH v3 2/3] Add threaded versions of functions in symlinks.c Jared Hance
2012-03-07 23:39 ` Junio C Hamano
2012-03-07 22:21 ` Jared Hance [this message]
2012-03-07 23:39 ` [PATCH v3 3/3] Use startup_info->prefix rather than prefix 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=a2980b437f2eb81b6bc28ad4ebbf05429485729e.1331158240.git.jaredhance@gmail.com \
--to=jaredhance@gmail.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).