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

Re: [PATCH v2 1/4] progress: add sparse mode to force 100% complete message

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Mar 19, 2019, 18:46 UTC
Message-ID
<CAPig+cQhs-YDv2LySbAJkXOWGEAQohkPipj1WLz-BZqrWFyo1Q@mail.gmail.com>
In-Reply-To
<fbb2ce21-18ce-3d1e-e6f6-907c8b9693d9@jeffhostetler.com>
On Tue, Mar 19, 2019 at 2:33 PM Jeff Hostetler <git@jeffhostetler.com> wrote:
Show 16 quoted lines
> On 3/19/2019 12:42 PM, Eric Sunshine wrote:
> > Rather than adding a new "sparse" mode, I wonder if this entire
> > concept can be boiled down to a single new function:
> >
> >      void finish_progress(struct progress **p_progress, const char *msg)
> >      {
> >          [...]
> >      }
> >
> > without having to make any other changes to the implementation or add
> > a new field to the structure.
>
> The existing model has start_progress() and start_delayed_progress().
> I was following that model and added the new option at the start.
> I'm not planning on adding any additional flags, but if we had some
> we'd want them available on the startup next to this one.

Perhaps it makes sense to just take a 'flags' argument instead of 'sparse' so we don't have to worry about this going forward. In other words:

    #define PROGRESS_DELAYED (1 << 0)
    #define PROGRESS_SPARSE (1 << 1)
    struct progress *start_progress_x(const char *title, uint64_t total,
        unsigned flags);

which covers "delayed" start and "sparse". ("_x" is a placeholder since I can't think of a good name).

Show 7 quoted lines
> >                                It would mean, though, that the caller
> > would have to remember to invoke finish_progress() rather than
> > stop_progress().
>
> Right, I was trying to isolate the change to the setup, so that loop
> bottoms and any in-loop return points don't all have to worry about
> whether to call stop_ or finish_.
Yes, I understand the benefit.
Anyhow, my comments are akin to bikeshedding, thus not necessarily actionable.
Previous: Jeff HostetlerNext: Jeff Hostetler via GitGitGadget
Message 15 of 26 in “multi-pack-index: fix verify on large repos”
  1. 0/3 multi-pack-index: fix verify on large reposJeff Hostetler via GitGitGadget, Mar 18, 2019
  2. 1/3 midx: verify: add midx packfiles to the packed_git listJeff Hostetler via GitGitGadget, Mar 18, 2019
  3. 3/3 trace2:data: add trace2 data to midxJeff Hostetler via GitGitGadget, Mar 18, 2019
  4. 2/3 midx: verify: group objects by packfile to speed up object verificationJeff Hostetler via GitGitGadget, Mar 18, 2019
  5. Ævar Arnfjörð BjarmasonMar 18, 2019
  6. Jeff HostetlerMar 18, 2019
  7. Ævar Arnfjörð BjarmasonMar 18, 2019
  8. Junio C HamanoMar 19, 2019
  9. Jeff HostetlerMar 19, 2019
  10. Ævar Arnfjörð BjarmasonMar 19, 2019
  11. 0/4 multi-pack-index: fix verify on large reposJeff Hostetler via GitGitGadget, Mar 19, 2019
  12. 1/4 progress: add sparse mode to force 100% complete messageJeff Hostetler via GitGitGadget, Mar 19, 2019
  13. Eric SunshineMar 19, 2019
  14. Jeff HostetlerMar 19, 2019
  15. Eric SunshineMar 19, 2019
  16. 3/4 midx: verify: add midx packfiles to the packed_git listJeff Hostetler via GitGitGadget, Mar 19, 2019
  17. Jeff HostetlerMar 19, 2019
  18. 2/4 trace2:data: add trace2 data to midxJeff Hostetler via GitGitGadget, Mar 19, 2019
  19. 4/4 midx: verify: group objects by packfile to speed up object verificationJeff Hostetler via GitGitGadget, Mar 19, 2019
  20. 0/4 multi-pack-index: fix verify on large reposJeff Hostetler via GitGitGadget, Mar 21, 2019
  21. 2/4 trace2:data: add trace2 data to midxJeff Hostetler via GitGitGadget, Mar 21, 2019
  22. 3/4 midx: add progress indicators in multi-pack-index verifyJeff Hostetler via GitGitGadget, Mar 21, 2019
  23. 1/4 progress: add sparse mode to force 100% complete messageJeff Hostetler via GitGitGadget, Mar 21, 2019
  24. 4/4 midx: during verify group objects by packfile to speed verificationJeff Hostetler via GitGitGadget, Mar 21, 2019
  25. Junio C HamanoMar 22, 2019
  26. Jeff HostetlerMar 25, 2019

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.