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

Re: [PATCH v2] [Outreachy Patch] prune-packed: remove USE_THE_REPOSITORY_VARIABLE

From
Patrick Steinhardt <ps@pks.im>
Date
Oct 23, 2026, 07:02 UTC
Message-ID
<atsGfWzCMW0LMHNX@pks.im>
In-Reply-To
<pull.2266.v2.git.1792428811100.gitgitgadget@gmail.com>
On Mon, Oct 19, 2026 at 04:53:31PM +0000, Shashank S via GitGitGadget wrote:
Show 11 quoted lines
> Range-diff vs v1:
> 
>  1:  5d9ba0cf3a ! 1:  6b583e1d46 prune-packed: remove USE_THE_REPOSITORY_VARIABLE
>      @@
>        ## Metadata ##
>      -Author: Shashank <shashu8660@gmail.com>
>      +Author: Shashank S Mogaveera <shashu8660@gmail.com>
>       
>        ## Commit message ##
>      -    prune-packed: remove USE_THE_REPOSITORY_VARIABLE
>      +    [Outreachy Patch] prune-packed: remove USE_THE_REPOSITORY_VARIABLE
This prefix shouldn't be part of the patch subject itself.
Show 10 quoted lines
>      -    Right now, the prune_packed_objects() function uses the global
>      +    The prune_packed_objects() function uses the global
>           the_repository variable. To help with the libification effort,
>           change this function so it takes a 'struct repository' pointer
>           as an argument instead.
>      @@ Commit message
>           prune_object() callbacks to read from this new struct.
>       
>           Update the builtins that call this function (builtin/prune-packed.c,
>      -    builtin/prune.c, and builtin/repack.c) to pass their local `repo`
One small nit: I don't think we need to have the list here.
Show 6 quoted lines
>      -    variables. Because we are now actually using the 'repo'  parameter
>      -    in these files, we can safely remove the UNUSED macro from them.
>      +    builtin/prune.c, and builtin/repack.c) to pass their local 'repo'
>      +    variables. We can safely remove the UNUSED macro from them because
>      +    these commands are all declared with the RUN_SETUP flag in git.c,
>      +    which guarantees that the 'repo' pointer will never be NULL.

As mentioned by Junio, this isn't true. The repo pointer _may_ be NULL in the case where "-h" is passed.

Thanks!
Patrick
Previous: Shashank S via GitGitGadgetNext: Shashank S
Message 7 of 14 in “prune-packed: remove USE_THE_REPOSITORY_VARIABLE”
  1. prune-packed: remove USE_THE_REPOSITORY_VARIABLEShashank S via GitGitGadget, Oct 18, 2026
  2. Patrick SteinhardtOct 19, 2026
  3. Shashank SOct 19, 2026
  4. Junio C HamanoOct 19, 2026
  5. Shashank SOct 20, 2026
  6. [Outreachy Patch] prune-packed: remove USE_THE_REPOSITORY_VARIABLEShashank S via GitGitGadget, Oct 19, 2026
  7. Patrick SteinhardtOct 23, 2026
  8. Shashank SOct 24, 2026
  9. prune-packed: remove USE_THE_REPOSITORY_VARIABLEShashank S via GitGitGadget, Oct 24, 2026
  10. Patrick SteinhardtOct 26, 2026
  11. Shashank SOct 27, 2026
  12. prune-packed: remove USE_THE_REPOSITORY_VARIABLEShashank S via GitGitGadget, Oct 27, 2026
  13. Patrick SteinhardtOct 28, 2026
  14. Junio C HamanoOct 28, 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.