# Outreachy archive cleanup draws sharp review from Junio Hamano over submodule abbreviation

_Hamano says replacing the_repository in submodule.c with o->repo is as wrong as the original, and tells the contributor to finish a review discussion before sending a new version._

Section: Patches. Edition of 2026-11-11. Written by an AI editor from the thread "[PATCH 0/2] [Outreachy PATCH] archive: remove USE_THE_REPOSITORY_VARIABLE from archival modules" (23 messages): https://gitlist.dev/t/66815

Srujith A Poojary's Outreachy series aimed to make archive-tar.c, archive-zip.c, archive.c and related files use explicit repository pointers instead of the global repository variable. The first version also changed submodule.c so that commit IDs in a submodule diff header are abbreviated differently.

Junio Hamano asked where the archive-zip.c change advertised in the log message was and called the patch an incoherent, unexplained mess, with several hunks whose purpose he could not see. On the submodule hunk he stepped back: any repository other than 'sub' is the wrong place to find a suitable abbreviation of that submodule's object names. When 'sub' is NULL, the submodule is not initialized and no repository has its objects, so using o->repo is just as wrong as using the_repository. Hamano said he liked one hunk, in write_global_extended_header().

Srujith replied that he would handle sub == NULL by using the default abbreviation length directly, keep the sub != NULL logic on the submodule repository, fix the commit message, and restore the order of repo_config() in archive-tar.c. Moving it above the defaults would have let built-in defaults overwrite user configuration, as Hamano had pointed out.

Before that discussion was finished, a new two-patch version appeared. Its submodule patch uses the submodule repository when available and otherwise falls back to the repository from the diff options, and adds a test for SHA-1 and SHA-256. Its archive patch shrinks to archive-tar.c and builtin/archive.c. Hamano responded that it is bad manners to send a new iteration before finishing discussion of the previous one: contributors should say what they will fix or why something is fine, wait for responses, and agree on the next version first. Review of the new version is not shown in the excerpts.
