From: "Dmitry Torilov via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Dmitry Torilov <d.torilov@gmail.com>,
Dmitry Torilov <d.torilov@gmail.com>
Subject: [PATCH] chore: use prefix from startup_info
Date: Mon, 29 Mar 2021 22:33:53 +0000 [thread overview]
Message-ID: <pull.922.git.1617057233885.gitgitgadget@gmail.com> (raw)
From: Dmitry Torilov <d.torilov@gmail.com>
trace.h: update trace_repo_setup signature
trace.c: update trace_repo_setup implementation
git.c: update trace_repo_setup usage
Signed-off-by: Dmitry Torilov <d.torilov@gmail.com>
---
[PATCH] trace: use prefix from startup_info
trace.h: update trace_repo_setup signature trace.c: update
trace_repo_setup implementation git.c: update trace_repo_setup usage
I'm new to git, I want to try to make a test contribution.
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-922%2Ftorilov%2Ftrace_repo_setup-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-922/torilov/trace_repo_setup-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/922
git.c | 3 ++-
trace.c | 4 ++--
trace.h | 2 +-
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/git.c b/git.c
index 9bc077a025cb..310cf54e08f6 100644
--- a/git.c
+++ b/git.c
@@ -424,6 +424,7 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
prefix = setup_git_directory_gently(&nongit_ok);
}
prefix = precompose_argv_prefix(argc, argv, prefix);
+ startup_info->prefix = prefix;
if (use_pager == -1 && p->option & (RUN_SETUP | RUN_SETUP_GENTLY) &&
!(p->option & DELAY_PAGER_CONFIG))
use_pager = check_pager_config(p->cmd);
@@ -432,7 +433,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 f726686fd92f..4c6414683414 100644
--- a/trace.c
+++ b/trace.c
@@ -367,9 +367,9 @@ static const char *quote_crnl(const char *path)
return new_path.buf;
}
-/* 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)
{
+ const char *prefix = startup_info->prefix;
const char *git_work_tree;
char *cwd;
diff --git a/trace.h b/trace.h
index 0dbbad0e41cb..844b3ce47d2b 100644
--- a/trace.h
+++ b/trace.h
@@ -93,7 +93,7 @@ extern struct trace_key trace_default_key;
extern struct trace_key trace_perf_key;
extern struct trace_key trace_setup_key;
-void trace_repo_setup(const char *prefix);
+void trace_repo_setup(void);
/**
* Checks whether the trace key is enabled. Used to prevent expensive
base-commit: 84d06cdc06389ae7c462434cb7b1db0980f63860
--
gitgitgadget
next reply other threads:[~2021-03-29 22:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-29 22:33 Dmitry Torilov via GitGitGadget [this message]
2021-03-29 23:53 ` [PATCH] chore: use prefix from startup_info Junio C Hamano
2021-03-31 5:04 ` Torsten Bögershausen
2021-04-04 6:17 ` [PATCH v2 1/2] precompose_utf8: Make precompose_string_if_needed() public tboegi
2021-04-04 6:17 ` [PATCH v2 2/2] MacOs: Precompose startup_info->prefix tboegi
2021-04-04 7:58 ` Junio C Hamano
2021-04-04 17:14 ` [PATCH v3 1/2] precompose_utf8: Make precompose_string_if_needed() public tboegi
2021-04-04 17:14 ` [PATCH v3 2/2] MacOs: Precompose startup_info->prefix tboegi
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=pull.922.git.1617057233885.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=d.torilov@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).