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

Re: [PATCH v3] prune-packed: remove USE_THE_REPOSITORY_VARIABLE

From
SSShashank S <shashu8660@gmail.com>
Date
Oct 27, 2026, 17:11 UTC
Message-ID
<CANHmUQQ+MsNeJa4+SfufwVKB5cofZ1RkuQdHZh1aqpxybSgLTw@mail.gmail.com>
In-Reply-To
<at8RfoXGrC6s3km_@pks.im>
On Mon, 26 Oct 2026 at 14:08, Patrick Steinhardt <ps@pks.im> wrote:
Show 15 quoted lines
> >      +    call to parse_options() will give the short help and exit before the
> >      +    dereference occurs.
>
> This still doesn't quite put the finger on what's important. What you
> need to verify is that there is nothing between the `cmd_foobar()`
> entrypoint and the call to `parse_options()` that may dereference the
> NULL pointer. How abouT this:
>
>     Update the builtins that call this function to pass their local
>     `repo` parameters. As all of those builtins are declared with
>     `RUN_SETUP` we know that they won't execute outside a repository
>     and thus the repository parameter will be set. Unless the command
>     was invoked with "-h" to print help, but all new uses of the `repo`
>     variable are after a call to `parse_options()` which knows to exit
>     early in case it sees "-h".
Thank you i have update this into the v4 patch
>
Show 9 quoted lines
> > -     if (opts & PRUNE_PACKED_VERBOSE)
> > -             progress = start_delayed_progress(the_repository,
> > -                                               _("Removing duplicate objects"), 256);
> > +    struct prune_data cb_data = {
> > +     .r = r,
> > +     .opts = opts
> > +    };
>
> Indentation is wrong here now, even though it was correct in v2.
Sorry, I have done the correction in v4 patch .
Show 23 quoted lines
>
> > +    if (opts & PRUNE_PACKED_VERBOSE)
> > +     progress = start_delayed_progress(r,
> > +                       _("Removing duplicate objects"), 256);
> >
> > -     for_each_loose_file_in_source(the_repository->objects->source,
> > -                                   prune_object, NULL, prune_subdir, &opts);
> > +    for_each_loose_file_in_source(r->objects->source,
>
> Likewise, this is using spaces for indentation now.
>
> > +                   prune_object, NULL, prune_subdir, &cb_data);
> >
> > -     /* Ensure we show 100% before finishing progress */
> > -     display_progress(progress, 256);
> > -     stop_progress(&progress);
> > +    /* Ensure we show 100% before finishing progress */
> > +    display_progress(progress, 256);
> > +    stop_progress(&progress);
>
> Same here.
>
> Patrick
Thanks again for taking the time to explain all the mistakes .
Shashank S Mogaveera
Previous: Patrick SteinhardtNext: Shashank S via GitGitGadget
Message 11 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.