git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] chore: use prefix from startup_info
@ 2021-03-29 22:33 Dmitry Torilov via GitGitGadget
  2021-03-29 23:53 ` Junio C Hamano
  0 siblings, 1 reply; 8+ messages in thread
From: Dmitry Torilov via GitGitGadget @ 2021-03-29 22:33 UTC (permalink / raw)
  To: git; +Cc: Dmitry Torilov, Dmitry Torilov

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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-04-04 17:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-29 22:33 [PATCH] chore: use prefix from startup_info Dmitry Torilov via GitGitGadget
2021-03-29 23:53 ` 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

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).