{"thread":{"id":"64793","subject":"[GSoC PATCH v1] builtin: stop using the_repository","startedAt":"2026-01-13T16:16:12Z","lastAt":"2026-01-13T18:07:09Z","messageCount":3,"participants":["Abraham Samuel Adekunle","Junio C Hamano","Samuel Abraham"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"533751","messageId":"aWZkEYHhcIhdAjkh@Adekunles-MacBook-Air.local","threadId":"64793","inReplyTo":null,"subject":"[GSoC PATCH v1] builtin: stop using the_repository","fromName":"Abraham Samuel Adekunle","fromEmail":"abrahamadekunle50@gmail.com","sentAt":"2026-01-13T16:16:20Z","receivedAt":"2026-01-13T16:16:12Z","isPatch":true,"sender":{"key":"abrahamadekunle50@gmail.com","avatar":"https://avatars.githubusercontent.com/u/110066922?v=4"},"body":"The builtins use the_repository global variable which might\nnot work well when running many repos in the same process at once.\n\nStop using the_repository in these builtins to align with the goal of\nlibification of Git.\n\nSigned-off-by: Abraham Samuel Adekunle <abrahamadekunle50@gmail.com>\n---\n builtin/bugreport.c    | 13 ++++++-------\n builtin/bundle.c       | 13 ++++++-------\n builtin/check-attr.c   | 26 +++++++++++++-------------\n builtin/check-ignore.c | 27 +++++++++++++++------------\n 4 files changed, 40 insertions(+), 39 deletions(-)\n\ndiff --git a/builtin/bugreport.c b/builtin/bugreport.c\nindex f78c3f2aed..77eb8bd9c1 100644\n--- a/builtin/bugreport.c\n+++ b/builtin/bugreport.c\n@@ -1,4 +1,3 @@\n-#define USE_THE_REPOSITORY_VARIABLE\n #include \"builtin.h\"\n #include \"abspath.h\"\n #include \"editor.h\"\n@@ -37,7 +36,7 @@ static void get_system_info(struct strbuf *sys_info)\n \t\t    shell ? shell : \"<unset>\");\n }\n \n-static void get_populated_hooks(struct strbuf *hook_info, int nongit)\n+static void get_populated_hooks(struct repository *repo, struct strbuf *hook_info, int nongit)\n {\n \tconst char **p;\n \n@@ -50,7 +49,7 @@ static void get_populated_hooks(struct strbuf *hook_info, int nongit)\n \tfor (p = hook_name_list; *p; p++) {\n \t\tconst char *hook = *p;\n \n-\t\tif (hook_exists(the_repository, hook))\n+\t\tif (hook_exists(repo, hook))\n \t\t\tstrbuf_addf(hook_info, \"%s\\n\", hook);\n \t}\n }\n@@ -93,7 +92,7 @@ static void get_header(struct strbuf *buf, const char *title)\n int cmd_bugreport(int argc,\n \t\t  const char **argv,\n \t\t  const char *prefix,\n-\t\t  struct repository *repo UNUSED)\n+\t\t  struct repository *repo)\n {\n \tstruct strbuf buffer = STRBUF_INIT;\n \tstruct strbuf report_path = STRBUF_INIT;\n@@ -141,7 +140,7 @@ int cmd_bugreport(int argc,\n \t}\n \tstrbuf_addstr(&report_path, \".txt\");\n \n-\tswitch (safe_create_leading_directories(the_repository, report_path.buf)) {\n+\tswitch (safe_create_leading_directories(repo, report_path.buf)) {\n \tcase SCLD_OK:\n \tcase SCLD_EXISTS:\n \t\tbreak;\n@@ -158,7 +157,7 @@ int cmd_bugreport(int argc,\n \t\tstrbuf_addftime(&zip_path, option_suffix, localtime_r(&now, &tm), 0, 0);\n \t\tstrbuf_addstr(&zip_path, \".zip\");\n \n-\t\tif (create_diagnostics_archive(the_repository, &zip_path, diagnose))\n+\t\tif (create_diagnostics_archive(repo, &zip_path, diagnose))\n \t\t\tdie_errno(_(\"unable to create diagnostics archive %s\"), zip_path.buf);\n \n \t\tstrbuf_release(&zip_path);\n@@ -171,7 +170,7 @@ int cmd_bugreport(int argc,\n \tget_system_info(&buffer);\n \n \tget_header(&buffer, _(\"Enabled Hooks\"));\n-\tget_populated_hooks(&buffer, !startup_info->have_repository);\n+\tget_populated_hooks(repo, &buffer, !startup_info->have_repository);\n \n \t/* fopen doesn't offer us an O_EXCL alternative, except with glibc. */\n \treport = xopen(report_path.buf, O_CREAT | O_EXCL | O_WRONLY, 0666);\ndiff --git a/builtin/bundle.c b/builtin/bundle.c\nindex 1e170e9278..ef21ccfd89 100644\n--- a/builtin/bundle.c\n+++ b/builtin/bundle.c\n@@ -1,4 +1,3 @@\n-#define USE_THE_REPOSITORY_VARIABLE\n #include \"builtin.h\"\n #include \"abspath.h\"\n #include \"gettext.h\"\n@@ -68,7 +67,7 @@ static int parse_options_cmd_bundle(int argc,\n }\n \n static int cmd_bundle_create(int argc, const char **argv, const char *prefix,\n-\t\t\t     struct repository *repo UNUSED) {\n+\t\t\t     struct repository *repo) {\n \tstruct strvec pack_opts = STRVEC_INIT;\n \tint version = -1;\n \tint ret;\n@@ -101,7 +100,7 @@ static int cmd_bundle_create(int argc, const char **argv, const char *prefix,\n \n \tif (!startup_info->have_repository)\n \t\tdie(_(\"Need a repository to create a bundle.\"));\n-\tret = !!create_bundle(the_repository, bundle_file, argc, argv, &pack_opts, version);\n+\tret = !!create_bundle(repo, bundle_file, argc, argv, &pack_opts, version);\n \tstrvec_clear(&pack_opts);\n \tfree(bundle_file);\n \treturn ret;\n@@ -125,7 +124,7 @@ static int open_bundle(const char *path, struct bundle_header *header,\n }\n \n static int cmd_bundle_verify(int argc, const char **argv, const char *prefix,\n-\t\t\t     struct repository *repo UNUSED) {\n+\t\t\t     struct repository *repo) {\n \tstruct bundle_header header = BUNDLE_HEADER_INIT;\n \tint bundle_fd = -1;\n \tint quiet = 0;\n@@ -152,7 +151,7 @@ static int cmd_bundle_verify(int argc, const char **argv, const char *prefix,\n \t\tgoto cleanup;\n \t}\n \tclose(bundle_fd);\n-\tif (verify_bundle(the_repository, &header,\n+\tif (verify_bundle(repo, &header,\n \t\t\t  quiet ? VERIFY_BUNDLE_QUIET : VERIFY_BUNDLE_VERBOSE)) {\n \t\tret = 1;\n \t\tgoto cleanup;\n@@ -193,7 +192,7 @@ static int cmd_bundle_list_heads(int argc, const char **argv, const char *prefix\n }\n \n static int cmd_bundle_unbundle(int argc, const char **argv, const char *prefix,\n-\t\t\t       struct repository *repo UNUSED) {\n+\t\t\t       struct repository *repo) {\n \tstruct bundle_header header = BUNDLE_HEADER_INIT;\n \tint bundle_fd = -1;\n \tint ret;\n@@ -221,7 +220,7 @@ static int cmd_bundle_unbundle(int argc, const char **argv, const char *prefix,\n \tif (progress)\n \t\tstrvec_pushl(&extra_index_pack_args, \"-v\", \"--progress-title\",\n \t\t\t     _(\"Unbundling objects\"), NULL);\n-\tret = !!unbundle(the_repository, &header, bundle_fd,\n+\tret = !!unbundle(repo, &header, bundle_fd,\n \t\t\t &extra_index_pack_args, NULL) ||\n \t\tlist_bundle_refs(&header, argc, argv);\n \tbundle_header_release(&header);\ndiff --git a/builtin/check-attr.c b/builtin/check-attr.c\nindex 51ed48ce43..cdeef0656d 100644\n--- a/builtin/check-attr.c\n+++ b/builtin/check-attr.c\n@@ -61,7 +61,7 @@ static void output_attr(struct attr_check *check, const char *file)\n \t}\n }\n \n-static void check_attr(const char *prefix, struct attr_check *check,\n+static void check_attr(struct repository *repo, const char *prefix, struct attr_check *check,\n \t\t       int collect_all,\n \t\t       const char *file)\n \n@@ -70,16 +70,16 @@ static void check_attr(const char *prefix, struct attr_check *check,\n \t\tprefix_path(prefix, prefix ? strlen(prefix) : 0, file);\n \n \tif (collect_all) {\n-\t\tgit_all_attrs(the_repository->index, full_path, check);\n+\t\tgit_all_attrs(repo->index, full_path, check);\n \t} else {\n-\t\tgit_check_attr(the_repository->index, full_path, check);\n+\t\tgit_check_attr(repo->index, full_path, check);\n \t}\n \toutput_attr(check, file);\n \n \tfree(full_path);\n }\n \n-static void check_attr_stdin_paths(const char *prefix, struct attr_check *check,\n+static void check_attr_stdin_paths(struct repository *repo, const char *prefix, struct attr_check *check,\n \t\t\t\t   int collect_all)\n {\n \tstruct strbuf buf = STRBUF_INIT;\n@@ -94,7 +94,7 @@ static void check_attr_stdin_paths(const char *prefix, struct attr_check *check,\n \t\t\t\tdie(\"line is badly quoted\");\n \t\t\tstrbuf_swap(&buf, &unquoted);\n \t\t}\n-\t\tcheck_attr(prefix, check, collect_all, buf.buf);\n+\t\tcheck_attr(repo, prefix, check, collect_all, buf.buf);\n \t\tmaybe_flush_or_die(stdout, \"attribute to stdout\");\n \t}\n \tstrbuf_release(&buf);\n@@ -110,7 +110,7 @@ static NORETURN void error_with_usage(const char *msg)\n int cmd_check_attr(int argc,\n \t\t   const char **argv,\n \t\t   const char *prefix,\n-\t\t   struct repository *repo UNUSED)\n+\t\t   struct repository *repo)\n {\n \tstruct attr_check *check;\n \tstruct object_id initialized_oid;\n@@ -119,15 +119,15 @@ int cmd_check_attr(int argc,\n \tif (!is_bare_repository())\n \t\tsetup_work_tree();\n \n-\trepo_config(the_repository, git_default_config, NULL);\n+\trepo_config(repo, git_default_config, NULL);\n \n \targc = parse_options(argc, argv, prefix, check_attr_options,\n \t\t\t     check_attr_usage, PARSE_OPT_KEEP_DASHDASH);\n \n-\tprepare_repo_settings(the_repository);\n-\tthe_repository->settings.command_requires_full_index = 0;\n+\tprepare_repo_settings(repo);\n+\trepo->settings.command_requires_full_index = 0;\n \n-\tif (repo_read_index(the_repository) < 0) {\n+\tif (repo_read_index(repo) < 0) {\n \t\tdie(\"invalid cache\");\n \t}\n \n@@ -189,16 +189,16 @@ int cmd_check_attr(int argc,\n \t}\n \n \tif (source) {\n-\t\tif (repo_get_oid_tree(the_repository, source, &initialized_oid))\n+\t\tif (repo_get_oid_tree(repo, source, &initialized_oid))\n \t\t\tdie(\"%s: not a valid tree-ish source\", source);\n \t\tset_git_attr_source(source);\n \t}\n \n \tif (stdin_paths)\n-\t\tcheck_attr_stdin_paths(prefix, check, all_attrs);\n+\t\tcheck_attr_stdin_paths(repo, prefix, check, all_attrs);\n \telse {\n \t\tfor (i = filei; i < argc; i++)\n-\t\t\tcheck_attr(prefix, check, all_attrs, argv[i]);\n+\t\t\tcheck_attr(repo, prefix, check, all_attrs, argv[i]);\n \t\tmaybe_flush_or_die(stdout, \"attribute to stdout\");\n \t}\n \ndiff --git a/builtin/check-ignore.c b/builtin/check-ignore.c\nindex 644c9a414f..68a05562fa 100644\n--- a/builtin/check-ignore.c\n+++ b/builtin/check-ignore.c\n@@ -70,8 +70,10 @@ static void output_pattern(const char *path, struct path_pattern *pattern)\n \t}\n }\n \n-static int check_ignore(struct dir_struct *dir,\n-\t\t\tconst char *prefix, int argc, const char **argv)\n+static int check_ignore(struct repository *repo,\n+\t\t\tstruct dir_struct *dir,\n+\t\t\tconst char *prefix,\n+\t\t\tint argc, const char **argv)\n {\n \tconst char *full_path;\n \tchar *seen;\n@@ -95,21 +97,21 @@ static int check_ignore(struct dir_struct *dir,\n \t\t       PATHSPEC_KEEP_ORDER,\n \t\t       prefix, argv);\n \n-\tdie_path_inside_submodule(the_repository->index, &pathspec);\n+\tdie_path_inside_submodule(repo->index, &pathspec);\n \n \t/*\n \t * look for pathspecs matching entries in the index, since these\n \t * should not be ignored, in order to be consistent with\n \t * 'git status', 'git add' etc.\n \t */\n-\tseen = find_pathspecs_matching_against_index(&pathspec, the_repository->index,\n+\tseen = find_pathspecs_matching_against_index(&pathspec, repo->index,\n \t\t\t\t\t\t     PS_HEED_SKIP_WORKTREE);\n \tfor (i = 0; i < pathspec.nr; i++) {\n \t\tfull_path = pathspec.items[i].match;\n \t\tpattern = NULL;\n \t\tif (!seen[i]) {\n \t\t\tint dtype = DT_UNKNOWN;\n-\t\t\tpattern = last_matching_pattern(dir, the_repository->index,\n+\t\t\tpattern = last_matching_pattern(dir, repo->index,\n \t\t\t\t\t\t\tfull_path, &dtype);\n \t\t\tif (!verbose && pattern &&\n \t\t\t    pattern->flags & PATTERN_FLAG_NEGATIVE)\n@@ -126,7 +128,8 @@ static int check_ignore(struct dir_struct *dir,\n \treturn num_ignored;\n }\n \n-static int check_ignore_stdin_paths(struct dir_struct *dir, const char *prefix)\n+static int check_ignore_stdin_paths(struct repository *repo,\n+\t\t\tstruct dir_struct *dir, const char *prefix)\n {\n \tstruct strbuf buf = STRBUF_INIT;\n \tstruct strbuf unquoted = STRBUF_INIT;\n@@ -143,7 +146,7 @@ static int check_ignore_stdin_paths(struct dir_struct *dir, const char *prefix)\n \t\t\tstrbuf_swap(&buf, &unquoted);\n \t\t}\n \t\tpathspec[0] = buf.buf;\n-\t\tnum_ignored += check_ignore(dir, prefix,\n+\t\tnum_ignored += check_ignore(repo, dir, prefix,\n \t\t\t\t\t    1, (const char **)pathspec);\n \t\tmaybe_flush_or_die(stdout, \"check-ignore to stdout\");\n \t}\n@@ -155,12 +158,12 @@ static int check_ignore_stdin_paths(struct dir_struct *dir, const char *prefix)\n int cmd_check_ignore(int argc,\n \t\t     const char **argv,\n \t\t     const char *prefix,\n-\t\t     struct repository *repo UNUSED)\n+\t\t     struct repository *repo)\n {\n \tint num_ignored;\n \tstruct dir_struct dir = DIR_INIT;\n \n-\trepo_config(the_repository, git_default_config, NULL);\n+\trepo_config(repo, git_default_config, NULL);\n \n \targc = parse_options(argc, argv, prefix, check_ignore_options,\n \t\t\t     check_ignore_usage, 0);\n@@ -184,15 +187,15 @@ int cmd_check_ignore(int argc,\n \t\tdie(_(\"--non-matching is only valid with --verbose\"));\n \n \t/* read_cache() is only necessary so we can watch out for submodules. */\n-\tif (!no_index && repo_read_index(the_repository) < 0)\n+\tif (!no_index && repo_read_index(repo) < 0)\n \t\tdie(_(\"index file corrupt\"));\n \n \tsetup_standard_excludes(&dir);\n \n \tif (stdin_paths) {\n-\t\tnum_ignored = check_ignore_stdin_paths(&dir, prefix);\n+\t\tnum_ignored = check_ignore_stdin_paths(repo, &dir, prefix);\n \t} else {\n-\t\tnum_ignored = check_ignore(&dir, prefix, argc, argv);\n+\t\tnum_ignored = check_ignore(repo, &dir, prefix, argc, argv);\n \t\tmaybe_flush_or_die(stdout, \"ignore to stdout\");\n \t}\n \n-- \n2.39.5 (Apple Git-154)\n\n"},{"id":"533753","messageId":"xmqq7btljvt2.fsf@gitster.g","threadId":"64793","inReplyTo":"aWZkEYHhcIhdAjkh@Adekunles-MacBook-Air.local","subject":"Re: [GSoC PATCH v1] builtin: stop using the_repository","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-01-13T16:56:25Z","receivedAt":"2026-01-13T16:56:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Abraham Samuel Adekunle <abrahamadekunle50@gmail.com> writes:\n\n> The builtins use the_repository global variable which might\n> not work well when running many repos in the same process at once.\n\nThis is true, but ...\n\n> Stop using the_repository in these builtins to align with the goal of\n> libification of Git.\n\n... in general, each file under builtin/ is about a single command\nthat _uses_ libified part of Git.  So it is perfectly fine for the\nlibification goal to include \"libified functions should not assume\nthat it works on the_repository, but they should accept a repo\nparameter to tell them which repository to work with\".  But it is\nnot necessary, and I would say it is harmful, to subject builtin/*.c\nto the same criteria.  The builtin command implementations can call\nlibified function by passing the_repository to libified API function\nthat expects a repo parameter.\n\n> Signed-off-by: Abraham Samuel Adekunle <abrahamadekunle50@gmail.com>\n> ---\n>  builtin/bugreport.c    | 13 ++++++-------\n>  builtin/bundle.c       | 13 ++++++-------\n>  builtin/check-attr.c   | 26 +++++++++++++-------------\n>  builtin/check-ignore.c | 27 +++++++++++++++------------\n>  4 files changed, 40 insertions(+), 39 deletions(-)\n>\n> diff --git a/builtin/bugreport.c b/builtin/bugreport.c\n> index f78c3f2aed..77eb8bd9c1 100644\n> --- a/builtin/bugreport.c\n> +++ b/builtin/bugreport.c\n> @@ -1,4 +1,3 @@\n> -#define USE_THE_REPOSITORY_VARIABLE\n>  #include \"builtin.h\"\n>  #include \"abspath.h\"\n>  #include \"editor.h\"\n> @@ -37,7 +36,7 @@ static void get_system_info(struct strbuf *sys_info)\n>  \t\t    shell ? shell : \"<unset>\");\n>  }\n>  \n> -static void get_populated_hooks(struct strbuf *hook_info, int nongit)\n> +static void get_populated_hooks(struct repository *repo, struct strbuf *hook_info, int nongit)\n>  {\n>  \tconst char **p;\n>  \n> @@ -50,7 +49,7 @@ static void get_populated_hooks(struct strbuf *hook_info, int nongit)\n>  \tfor (p = hook_name_list; *p; p++) {\n>  \t\tconst char *hook = *p;\n>  \n> -\t\tif (hook_exists(the_repository, hook))\n> +\t\tif (hook_exists(repo, hook))\n>  \t\t\tstrbuf_addf(hook_info, \"%s\\n\", hook);\n>  \t}\n>  }\n\nIt is not strictly necessary to churn a file-scope static function\nlike this one into taking an arbitrary repo parameter, as the only\ncaller of the function, presumably cmd_foo() in the builtin/foo.c\nfile, would pass the_repository anyway, whether it explicitly names\nthe_repository or passes the repo parameter that it got from its\ncaller, git.c:run_builtin().  We _can_ consider a change like the\nabove as a preparation to potentially move these functions to the\nlibified part of Git, so even though I said it is not necessary, it\nis also OK to perform such a change.\n\n> @@ -93,7 +92,7 @@ static void get_header(struct strbuf *buf, const char *title)\n>  int cmd_bugreport(int argc,\n>  \t\t  const char **argv,\n>  \t\t  const char *prefix,\n> -\t\t  struct repository *repo UNUSED)\n> +\t\t  struct repository *repo)\n>  {\n>  \tstruct strbuf buffer = STRBUF_INIT;\n>  \tstruct strbuf report_path = STRBUF_INIT;\n> @@ -141,7 +140,7 @@ int cmd_bugreport(int argc,\n>  \t}\n>  \tstrbuf_addstr(&report_path, \".txt\");\n>  \n> -\tswitch (safe_create_leading_directories(the_repository, report_path.buf)) {\n> +\tswitch (safe_create_leading_directories(repo, report_path.buf)) {\n>  \tcase SCLD_OK:\n>  \tcase SCLD_EXISTS:\n>  \t\tbreak;\n> @@ -158,7 +157,7 @@ int cmd_bugreport(int argc,\n>  \t\tstrbuf_addftime(&zip_path, option_suffix, localtime_r(&now, &tm), 0, 0);\n>  \t\tstrbuf_addstr(&zip_path, \".zip\");\n>  \n> -\t\tif (create_diagnostics_archive(the_repository, &zip_path, diagnose))\n> +\t\tif (create_diagnostics_archive(repo, &zip_path, diagnose))\n>  \t\t\tdie_errno(_(\"unable to create diagnostics archive %s\"), zip_path.buf);\n>  \n>  \t\tstrbuf_release(&zip_path);\n> @@ -171,7 +170,7 @@ int cmd_bugreport(int argc,\n>  \tget_system_info(&buffer);\n>  \n>  \tget_header(&buffer, _(\"Enabled Hooks\"));\n> -\tget_populated_hooks(&buffer, !startup_info->have_repository);\n> +\tget_populated_hooks(repo, &buffer, !startup_info->have_repository);\n>  \n>  \t/* fopen doesn't offer us an O_EXCL alternative, except with glibc. */\n>  \treport = xopen(report_path.buf, O_CREAT | O_EXCL | O_WRONLY, 0666);\n\nAll of the above look fine.\n\n> diff --git a/builtin/bundle.c b/builtin/bundle.c\n> index 1e170e9278..ef21ccfd89 100644\n> --- a/builtin/bundle.c\n> +++ b/builtin/bundle.c\n\nIs this patch meant as a microproject in preparation for applying\nfor GSoC?  If so, we ask to limit one quality focused one per\napplicant.\n\nhttps://git.github.io/General-Microproject-Information/#only-one-quality-focused-microproject-per-applicant\n"},{"id":"533764","messageId":"CADYq+faUHdCJ-CEnG5vGxkytW1O36pODd2SwXsUW+nbhE+RCnA@mail.gmail.com","threadId":"64793","inReplyTo":"xmqq7btljvt2.fsf@gitster.g","subject":"Re: [GSoC PATCH v1] builtin: stop using the_repository","fromName":"Samuel Abraham","fromEmail":"abrahamadekunle50@gmail.com","sentAt":"2026-01-13T18:07:06Z","receivedAt":"2026-01-13T18:07:09Z","isPatch":true,"sender":{"key":"abrahamadekunle50@gmail.com","avatar":"https://avatars.githubusercontent.com/u/110066922?v=4"},"body":"On Tue, Jan 13, 2026 at 5:56 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Abraham Samuel Adekunle <abrahamadekunle50@gmail.com> writes:\n>\n> > The builtins use the_repository global variable which might\n> > not work well when running many repos in the same process at once.\n>\n> This is true, but ...\n>\n> > Stop using the_repository in these builtins to align with the goal of\n> > libification of Git.\n>\n> ... in general, each file under builtin/ is about a single command\n> that _uses_ libified part of Git.  So it is perfectly fine for the\n> libification goal to include \"libified functions should not assume\n> that it works on the_repository, but they should accept a repo\n> parameter to tell them which repository to work with\".  But it is\n> not necessary, and I would say it is harmful, to subject builtin/*.c\n> to the same criteria.  The builtin command implementations can call\n> libified function by passing the_repository to libified API function\n> that expects a repo parameter.\n\nOh thank you Junio for clarifying\n\n>\n> > Signed-off-by: Abraham Samuel Adekunle <abrahamadekunle50@gmail.com>\n> > ---\n> >  builtin/bugreport.c    | 13 ++++++-------\n> >  builtin/bundle.c       | 13 ++++++-------\n> >  builtin/check-attr.c   | 26 +++++++++++++-------------\n> >  builtin/check-ignore.c | 27 +++++++++++++++------------\n> >  4 files changed, 40 insertions(+), 39 deletions(-)\n> >\n> > diff --git a/builtin/bugreport.c b/builtin/bugreport.c\n> > index f78c3f2aed..77eb8bd9c1 100644\n> > --- a/builtin/bugreport.c\n> > +++ b/builtin/bugreport.c\n> > @@ -1,4 +1,3 @@\n> > -#define USE_THE_REPOSITORY_VARIABLE\n> >  #include \"builtin.h\"\n> >  #include \"abspath.h\"\n> >  #include \"editor.h\"\n> > @@ -37,7 +36,7 @@ static void get_system_info(struct strbuf *sys_info)\n> >                   shell ? shell : \"<unset>\");\n> >  }\n> >\n> > -static void get_populated_hooks(struct strbuf *hook_info, int nongit)\n> > +static void get_populated_hooks(struct repository *repo, struct strbuf *hook_info, int nongit)\n> >  {\n> >       const char **p;\n> >\n> > @@ -50,7 +49,7 @@ static void get_populated_hooks(struct strbuf *hook_info, int nongit)\n> >       for (p = hook_name_list; *p; p++) {\n> >               const char *hook = *p;\n> >\n> > -             if (hook_exists(the_repository, hook))\n> > +             if (hook_exists(repo, hook))\n> >                       strbuf_addf(hook_info, \"%s\\n\", hook);\n> >       }\n> >  }\n>\n> It is not strictly necessary to churn a file-scope static function\n> like this one into taking an arbitrary repo parameter, as the only\n> caller of the function, presumably cmd_foo() in the builtin/foo.c\n> file, would pass the_repository anyway, whether it explicitly names\n> the_repository or passes the repo parameter that it got from its\n> caller, git.c:run_builtin().  We _can_ consider a change like the\n> above as a preparation to potentially move these functions to the\n> libified part of Git, so even though I said it is not necessary, it\n> is also OK to perform such a change.\n\nOkay thank you\n\n>\n> > @@ -93,7 +92,7 @@ static void get_header(struct strbuf *buf, const char *title)\n> >  int cmd_bugreport(int argc,\n> >                 const char **argv,\n> >                 const char *prefix,\n> > -               struct repository *repo UNUSED)\n> > +               struct repository *repo)\n> >  {\n> >       struct strbuf buffer = STRBUF_INIT;\n> >       struct strbuf report_path = STRBUF_INIT;\n> > @@ -141,7 +140,7 @@ int cmd_bugreport(int argc,\n> >       }\n> >       strbuf_addstr(&report_path, \".txt\");\n> >\n> > -     switch (safe_create_leading_directories(the_repository, report_path.buf)) {\n> > +     switch (safe_create_leading_directories(repo, report_path.buf)) {\n> >       case SCLD_OK:\n> >       case SCLD_EXISTS:\n> >               break;\n> > @@ -158,7 +157,7 @@ int cmd_bugreport(int argc,\n> >               strbuf_addftime(&zip_path, option_suffix, localtime_r(&now, &tm), 0, 0);\n> >               strbuf_addstr(&zip_path, \".zip\");\n> >\n> > -             if (create_diagnostics_archive(the_repository, &zip_path, diagnose))\n> > +             if (create_diagnostics_archive(repo, &zip_path, diagnose))\n> >                       die_errno(_(\"unable to create diagnostics archive %s\"), zip_path.buf);\n> >\n> >               strbuf_release(&zip_path);\n> > @@ -171,7 +170,7 @@ int cmd_bugreport(int argc,\n> >       get_system_info(&buffer);\n> >\n> >       get_header(&buffer, _(\"Enabled Hooks\"));\n> > -     get_populated_hooks(&buffer, !startup_info->have_repository);\n> > +     get_populated_hooks(repo, &buffer, !startup_info->have_repository);\n> >\n> >       /* fopen doesn't offer us an O_EXCL alternative, except with glibc. */\n> >       report = xopen(report_path.buf, O_CREAT | O_EXCL | O_WRONLY, 0666);\n>\n> All of the above look fine.\n>\n> > diff --git a/builtin/bundle.c b/builtin/bundle.c\n> > index 1e170e9278..ef21ccfd89 100644\n> > --- a/builtin/bundle.c\n> > +++ b/builtin/bundle.c\n>\n> Is this patch meant as a microproject in preparation for applying\n> for GSoC?  If so, we ask to limit one quality focused one per\n> applicant.\n>\n> https://git.github.io/General-Microproject-Information/#only-one-quality-focused-microproject-per-applicant\n\nNo, this patch is not meant as a microproject.\nI previously read in the General-Microproject-Information section\n\"After it's done, work on different things\"\nthat we can keep contributing after a micoproject if we are itching to do more.\nSo I just want to keep contributing.\n\nDo I drop the \"GSoC\" tag and send a v2?\nI will not include the tag in subsequent patches.\nThanks\n\nAbraham.\n"}]}