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

Re: Consider adding pruning of refs to git maintenance

From
Shubham Kanodia <shubham.kanodia10@gmail.com>
Date
Dec 17, 2024, 11:21 UTC
Message-ID
<CAG=Um+1NwB=ymwg+oM62f_W8G=3Gt14UFGe+S2MM3gTOdUcuHg@mail.gmail.com>
In-Reply-To
<xmqqcyhq3ge7.fsf@gitster.g>
On Tue, Dec 17, 2024 at 1:11 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 31 quoted lines
>
> Patrick Steinhardt <ps@pks.im> writes:
>
> > If we want to have such a feature I'd thus claim that it would be most
> > sensible to make it opt-in rather than opt-out. I wouldn't want to be
> > surprised by remote refs vanishing after going to bed, but may be okay
> > with it when I explicitly ask for it.
> >
> > At that point one has to raise the question whether it is still all that
> > useful compared to running `git remote prune` manually every now and
> > then. Mostly because explicitly configuring maintenance is probably
> > something that only power users would do, and those power users would
> > likely know to prune manually.
>
> I am 100% in agreement with your reasoning.  If this thing is to
> exist, it has to be opt-in.  We also need to add ample warning why
> doing this asynchronously behind user's back while the user could be
> working in the same repository is prone to cause surprises in the
> documentation in big red letters.
>
> I however am OK with the idea of having it as an optional "task"
> that is disabled by default in "git maintenance".  "git maintenance"
> can be viewed as a platform-neutral way to set up scheduled tasks.
>
> A user may be a Git expert who knows what `git remote prune` does,
> and understands and accepts the risk of confusion doing so without
> explicit "do it now" from the end-user, but may not be a Linux or a
> macOS or a Windows expert to know how to write crontab or its
> equivalents on various schemes to define scheduled tasks.
>
> Thanks.

Thanks for sharing your thoughts here. For some context — I currently look after git performance for a very large repository (60k+ refs) with a lot of active developers. I've observed that while power git users keep their repository tidy even without runnining maintenance, the majority of users infact don't know (or execute these), and run into performance issues. Easier fleet management was perhaps was one of the motivations behind adding this to `git-maintenance`.

While its pretty rare that someone relies on a `refs/remote/*` reference (without creating a local copy of it in `refs/heads`), I can see why it can be surprising and an opt-in should be okay for me.

Thanks, Shubham K

Previous: Junio C HamanoNext: Shubham Kanodia
Message 4 of 11 in “Consider adding pruning of refs to git maintenance”
  1. Shubham KanodiaDec 16, 2024
  2. Patrick SteinhardtDec 17, 2024
  3. Junio C HamanoDec 17, 2024
  4. Shubham KanodiaDec 17, 2024
  5. Shubham KanodiaDec 17, 2024
  6. Junio C HamanoDec 17, 2024
  7. Shubham KanodiaDec 18, 2024
  8. Junio C HamanoDec 18, 2024
  9. Shubham KanodiaDec 22, 2024
  10. Junio C HamanoDec 23, 2024
  11. Shubham KanodiaDec 23, 2024

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.