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

Re: [PATCH] credential: let empty credential specs reset helper list

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 26, 2016, 23:26 UTC
Message-ID
<xmqqy4a7hx4h.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20160226223719.GA2429@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 7 quoted lines
> I think there is another reason, which is that the interface we expose
> to config callbacks (and via "config --get-all") is to sequentially pass
> in all values. How does that interact with this "reset"? For example,
> what is the output of:
>
>   git config foo.bar one
>   git -c '!foo.bar' config --get-all foo.bar

The callback API needs to be extended to include this "reset" bit, not just "var" and "value", obviously. And then of course the users of the API need to be updated to act on that "reset" thing.

That is what I meant by "multi-value things need custom code". The single-valued ones can do "last one wins", and "reset" can be turned into "the initial state" assignment for the variable; multi-value cumulative ones already have custom code to accumulate things into list, and they need to learn to empty the list upon seeing the "reset" bit.

But that is not as fundamental as "new syntax breaks old clients". If we want our new code to do useful things, obviously we would need to work on making it do so ;-)

Show 5 quoted lines
> I think you could get away without changing the users of the multi-value
> variables, using the "negative" approach I mentioned above. Basically:
> ...
> But like I said, that does feel somewhat half-implemented to me, since
> it treats the command-line specially.

I agree with you that that is a kludge and not the right way forward.

Previous: Jeff King
Message 6 of 6 in “credential: let empty credential specs reset helper list”
  1. credential: let empty credential specs reset helper listJeff King, Feb 26, 2016
  2. Junio C HamanoFeb 26, 2016
  3. Junio C HamanoFeb 26, 2016
  4. Jacob KellerFeb 26, 2016
  5. Jeff KingFeb 26, 2016
  6. Junio C HamanoFeb 26, 2016

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.