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

Re: [RFC] control, what refs are honored by core.logAllRefUpdates

From
Jeff King <peff@peff.net>
Date
Jul 12, 2011, 18:25 UTC
Message-ID
<20110712182517.GA17787@sigill.intra.peff.net>
In-Reply-To
<CAKPyHN0+BaPtrRMVrWCZQ2mbJQz_vxsOOsG4Z=Ksqc1RJvF1Ew@mail.gmail.com>
On Tue, Jul 12, 2011 at 08:15:21PM +0200, Bert Wesarg wrote:
Show 17 quoted lines
> >> Setting core.autoLogRef to the empty value, will reset the list.
> >
> > It is unclear what it is reset to.  Do you mean it clears, e.g.
> >
> >    [core]
> >        autoLogRef = heads
> >        autoLogRef = remotes
> >        autoLogRef = notes
> >        autoLogRef =
> >        autoLogRef = heads
> >
> > would first create a list of three elements, clears it and then the final
> > result has only refs/heads/ in the list?
> >
> Exactly. I think the --notes option does have a similar semantics. (I
> added Jeff to the Cc). There is --no-notes, which resets the notes
> list and than subsequent --notes= options populate the list again.

Yeah, --notes versus --no-notes is as you say. This topic came up recently when discussing config for the user-defined archive filters, too. This is a fairly natural solution, as it lets you say "append to what's there" versus "replace what's there", which is what you really want[1].

I think I'd rather see something more syntactically explicit for resetting, though, like:

  [core]
    autoLogRef = heads
    autoLogRef = remotes
    autoLogRef = notes
    !autoLogRef
    autoLogref = heads

(for that matter, I have often wished that "!autoLogRef" was boolean false, just as "autoLogRef" is boolean true). But it may not be worth changing the config syntax for.

-Peff

[1] If we were starting from scratch, you could make that distinction with a new operator, like:

  [core]
    autoLogRef = heads
    autoLogRef += remotes
    autoLogRef += notes
    autoLogRef = heads

which would be equivalent to what you wrote above. But because it switches the semantics of "=" to "replace" instead of "append" for multi-value keys, it would break all current config that uses multiple "fetch" lines (for example).

Previous: Bert WesargNext: Jonathan Nieder
Message 4 of 7 in “Re: [RFC] control, what refs are honored by core.logAllRefUpdates”
  1. Bert WesargJul 12, 2011
  2. Junio C HamanoJul 12, 2011
  3. Bert WesargJul 12, 2011
  4. Jeff KingJul 12, 2011
  5. Jonathan NiederJul 12, 2011
  6. Bert WesargJul 13, 2011
  7. Jeff KingJul 13, 2011

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.