git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v4] archive: remove USE_THE_REPOSITORY_VARIABLE from archival modules

From
SGSrujith A Poojary via GitGitGadget <gitgitgadget@gmail.com>
Date
Nov 11, 2026, 08:25 UTC
Message-ID
<pull.2305.v4.git.1794385537870.gitgitgadget@gmail.com>
In-Reply-To
<pull.2305.git.1794251100.gitgitgadget@gmail.com>
From: Srujith A Poojary <poojarysrujith@gmail.com>

Refactor archive-tar.c and builtin/archive.c to clean up archiver initialization order and header dependencies.

Signed-off-by: Srujith A Poojary <poojarysrujith@gmail.com>
---
    [Outreachy PATCH] archive: remove USE_THE_REPOSITORY_VARIABLE from
    archival modules
    
    Refactored archive-tar.c, archive-zip.c, archive.c, and supporting files
    to use explicit struct repository *repo pointers instead of global
    repository variables.
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2305%2Fpoojarysrujith%2Farchive-libification-refactor-v4
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2305/poojarysrujith/archive-libification-refactor-v4
Pull-Request: https://github.com/gitgitgadget/git/pull/2305
Range-diff vs v3:
 1:  01c3cc2573 < -:  ---------- submodule: use the submodule repository to abbreviate commits
 2:  398b54f00a ! 1:  29130b6eb2 archive: remove USE_THE_REPOSITORY_VARIABLE from archival modules
     @@ Metadata
       ## Commit message ##
          archive: remove USE_THE_REPOSITORY_VARIABLE from archival modules
      
     -    Refactor archive-tar.c, archive-zip.c, archive.c, and supporting files
     -    to clean up archiver initialization functions and header dependencies.
     +    Refactor archive-tar.c and builtin/archive.c to clean up archiver
     +    initialization order and header dependencies.
      
          Signed-off-by: Srujith A Poojary <poojarysrujith@gmail.com>
      
       ## archive-tar.c ##
     -@@
     -  */
     - 
     - #define USE_THE_REPOSITORY_VARIABLE
     --
     - #include "git-compat-util.h"
     - #include "config.h"
     - #include "gettext.h"
     -@@ archive-tar.c: static void write_global_extended_header(struct archiver_args *args)
     - 	if (oid)
     - 		strbuf_append_ext_header(&ext_header, "comment",
     - 					 oid_to_hex(oid),
     --					 the_hash_algo->hexsz);
     -+					 args->repo->hash_algo->hexsz);
     - 	if (args->time > USTAR_MAX_MTIME) {
     - 		strbuf_append_ext_header_uint(&ext_header, "mtime",
     - 					      args->time);
     -@@ archive-tar.c: static struct archiver tar_archiver = {
     - void init_tar_archiver(void)
     - {
     +@@ archive-tar.c: void init_tar_archiver(void)
       	int i;
     -+	repo_config(the_repository, git_tar_config, NULL);
       	register_archiver(&tar_archiver);
       
     ++	/* Set built-in defaults first so user config can override them */
       	tar_filter_config("tar.tgz.command", internal_gzip_command, NULL);
       	tar_filter_config("tar.tgz.remote", "true", NULL);
       	tar_filter_config("tar.tar.gz.command", internal_gzip_command, NULL);
       	tar_filter_config("tar.tar.gz.remote", "true", NULL);
     --	repo_config(the_repository, git_tar_config, NULL);
     ++
     ++	/* Load repository config so user settings override the defaults above */
     + 	repo_config(the_repository, git_tar_config, NULL);
     ++
       	for (i = 0; i < nr_tar_filters; i++) {
       		/* omit any filters that never had a command configured */
       		if (tar_filters[i]->filter_command)
     -
     - ## builtin/archive.c ##
     -@@
     -  * Copyright (c) 2006 Franck Bui-Huu
     -  * Copyright (c) 2006 Rene Scharfe
     -  */
     -+#define USE_THE_REPOSITORY_VARIABLE
     - #include "builtin.h"
     - #include "archive.h"
     - #include "gettext.h"
 archive-tar.c | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/archive-tar.c b/archive-tar.c
index a1c66024d4..1b376d048a 100644
--- a/archive-tar.c
+++ b/archive-tar.c
@@ -531,11 +531,15 @@ void init_tar_archiver(void)
 	int i;
 	register_archiver(&tar_archiver);
 
+	/* Set built-in defaults first so user config can override them */
 	tar_filter_config("tar.tgz.command", internal_gzip_command, NULL);
 	tar_filter_config("tar.tgz.remote", "true", NULL);
 	tar_filter_config("tar.tar.gz.command", internal_gzip_command, NULL);
 	tar_filter_config("tar.tar.gz.remote", "true", NULL);
+
+	/* Load repository config so user settings override the defaults above */
 	repo_config(the_repository, git_tar_config, NULL);
+
 	for (i = 0; i < nr_tar_filters; i++) {
 		/* omit any filters that never had a command configured */
 		if (tar_filters[i]->filter_command)

base-commit: 6de20f6092dcf9bdb1c8efe03db4b70c82b423dd
-- 
gitgitgadget
Previous: Junio C HamanoNext: Karthik Nayak
Message 20 of 23 in “archive: remove USE_THE_REPOSITORY_VARIABLE from archival modules”
  1. 0/2 [Outreachy PATCH] archive: remove USE_THE_REPOSITORY_VARIABLE from archival modulesSrujith A Poojary via GitGitGadget, Nov 9, 2026
  2. 1/2 submodule: use the submodule repository to abbreviate commitsSrujith A Poojary via GitGitGadget, Nov 9, 2026
  3. 2/2 archive: remove USE_THE_REPOSITORY_VARIABLE from archival modulesSrujith A Poojary via GitGitGadget, Nov 9, 2026
  4. Junio C HamanoNov 9, 2026
  5. Srujith PoojaryNov 10, 2026
  6. 0/2 [Outreachy PATCH] archive: remove USE_THE_REPOSITORY_VARIABLE from archival modulesSrujith A Poojary via GitGitGadget, Nov 10, 2026
  7. 1/2 submodule: use the submodule repository to abbreviate commitsSrujith A Poojary via GitGitGadget, Nov 10, 2026
  8. 2/2 archive: remove USE_THE_REPOSITORY_VARIABLE from archival modulesSrujith A Poojary via GitGitGadget, Nov 10, 2026
  9. Junio C HamanoNov 10, 2026
  10. Srujith PoojaryNov 10, 2026
  11. 0/2 [Outreachy PATCH] archive: remove USE_THE_REPOSITORY_VARIABLE from archival modulesSrujith A Poojary via GitGitGadget, Nov 10, 2026
  12. 1/2 submodule: use the submodule repository to abbreviate commitsSrujith A Poojary via GitGitGadget, Nov 10, 2026
  13. Junio C HamanoNov 10, 2026
  14. Srujith PoojaryNov 11, 2026
  15. 2/2 archive: remove USE_THE_REPOSITORY_VARIABLE from archival modulesSrujith A Poojary via GitGitGadget, Nov 10, 2026
  16. Junio C HamanoNov 10, 2026
  17. Srujith PoojaryNov 11, 2026
  18. Srujith PoojaryNov 11, 2026
  19. Junio C HamanoNov 10, 2026
  20. archive: remove USE_THE_REPOSITORY_VARIABLE from archival modulesSrujith A Poojary via GitGitGadget, Nov 11, 2026
  21. Karthik NayakNov 11, 2026
  22. Srujith PoojaryNov 11, 2026
  23. archive-tar: add comments explaining configuration precedenceSrujith A Poojary via GitGitGadget, Nov 11, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.