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

Re: [PATCH] builtin/gc: warn when core.commitGraph is disabled

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
May 13, 2021, 11:24 UTC
Message-ID
<87k0o2svru.fsf@evledraar.gmail.com>
In-Reply-To
<b87b12b4b3c311eba1fd0024e87935e7@oschina.cn>
On Thu, May 13 2021, lilinchao@oschina.cn wrote:
Show 18 quoted lines
>>
>>On Mon, May 10 2021, lilinchao@oschina.cn wrote:
>>
>>> From: Li Linchao <lilinchao@oschina.cn>
>>>
>>> Throw warning message when core.commitGraph is disabled in commit-graph
>>> maintenance task.
>>
>>Won't this cause the gc.log issue noted in
>>https://lore.kernel.org/git/87r1l27rae.fsf@evledraar.gmail.com/
>>
>>More importantly, I don't think this UX makes sense. We said we didn't
>>want it, so why warn about it?
>>
>>Maybe there are good reasons to, but this commit message / patch doesn't
>>make the case for it...
>>
> Uh, well, maybe I should argue for this patch a bit more.
> First this is in git maintenance task, I've read the link you post,
> and I feel it has nothing to do with maintenance task.

Yes, maybe the issue I noted with gc.log being populated because something wrote to stderr won't happen here. I was just asking if you'd taken it into account.

> Second I hope the `commit-graph` task can do the same thing with
> `incremental repack` task that to warn user when the related necessary
> setting is not yet ready, instead of running quietly, but doing
> nothing.

I agree that if you ask git to --do-stuff and core.stuff=false then we should probably emit a warning, "but you disabled stuff!".

In this case though, isn't the entry point just "incremental", we then check should_write_commit_graph (as an aside, and not new in your change, shouldn't this "is the config set" be moved there & be the first thing we check?).

Then we run maintenance_task_commit_graph, where we see that the config is disabled.

So aren't there users that want incremental maintenance, but have also disabled core.commitGraph (or writeCommitGraph or whatever), that are then going to get a warning about something they explicitly disabled?

Or is this warning just for cases where the user has somehow scheduled a "commit graph" task, with config disabled, and the task can therefore never do anything useful? I agree that in such a case it probably makes sense to warn (or just exit non-zero?).

Anyway, I really do mean what I said about the "issue" being that the commit message needs to "make a case for it". I.e. even as someone who's hacked on the gc.c code (although not since "maintenance" became a thing), I honestly don't know if this warning is OK, i.e. are we at the point where we issue it where the user really wants the commit graph, but we just have a misconfiguration?

I *suspect* not, and that it's going to be annoying to people who really don't want the commit-graph, but who run "incremental", but maybe I'm wrong.

If that is the case maybe there's still a case for saying something, but that should probably be an advise(), not a warning().

Or the whole thing is fine, I honestly don't know :)
Previous: lilinchao@oschina.cnNext: Junio C Hamano
Message 4 of 6 in “builtin/gc: warn when core.commitGraph is disabled”
  1. builtin/gc: warn when core.commitGraph is disabledlilinchao@oschina.cn, May 10, 2021
  2. Ævar Arnfjörð BjarmasonMay 10, 2021
  3. lilinchao@oschina.cnMay 13, 2021
  4. Ævar Arnfjörð BjarmasonMay 13, 2021
  5. Junio C HamanoMay 10, 2021
  6. lilinchao@oschina.cnMay 11, 2021

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.