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

Re: [PATCH v3 1/4] git-credential-store: support multiple credential files

From
Jeff King <peff@peff.net>
Date
Mar 13, 2015, 06:15 UTC
Message-ID
<20150313061530.GA24588@peff.net>
In-Reply-To
<1426056553-9364-2-git-send-email-pyokagan@gmail.com>
On Wed, Mar 11, 2015 at 02:49:10PM +0800, Paul Tan wrote:
Show 6 quoted lines
> Previously, git-credential-store only supported storing credentials in a
> single file: ~/.git-credentials. In order to support the XDG base
> directory specification[1], git-credential-store needs to be able to
> lookup and erase credentials from multiple files, as well as to pick the
> appropriate file to write to so that the credentials can be found on
> subsequent lookups.

I looked over the code here and in the second patch, and I didn't see any real problems. Thanks for iterating on this.

Two minor nits, that might not even be worth addressing:
> +static void store_credential(const struct string_list *fns, struct credential *c,
> +			     const char *default_fn)

I think you could even get away without passing default_fn here, and just use the rule "the first file in the list is the default". Unless you are anticipating ever passing something else, but I couldn't think of a case where that would be useful.

> +	struct string_list fns = STRING_LIST_INIT_NODUP;
This is declared NODUP...
> -	if (!file)
> +	if (file)
> +		string_list_append_nodup(&fns, file);

So you can just call the regular string_list_append here (the idea of declaring the list as DUP or NODUP is that the callers do not have to care; string_list_append does the right thing).

-Peff
Previous: Paul TanNext: Paul Tan
Message 3 of 17 in “git-credential-store: XDG user-specific config file support”
  1. 0/4 git-credential-store: XDG user-specific config file supportPaul Tan, Mar 11, 2015
  2. 1/4 git-credential-store: support multiple credential filesPaul Tan, Mar 11, 2015
  3. Jeff KingMar 13, 2015
  4. Paul TanMar 14, 2015
  5. Jeff KingMar 14, 2015
  6. Jeff KingMar 14, 2015
  7. Junio C HamanoMar 14, 2015
  8. Matthieu MoyMar 15, 2015
  9. Junio C HamanoMar 15, 2015
  10. Paul TanMar 18, 2015
  11. 2/4 git-credential-store: support XDG_CONFIG_HOMEPaul Tan, Mar 11, 2015
  12. 3/4 docs/git-credential-store: document XDG file and precedencePaul Tan, Mar 11, 2015
  13. Eric SunshineMar 11, 2015
  14. Paul TanMar 12, 2015
  15. 4/4 t0302: test credential-store support for XDG_CONFIG_HOMEPaul Tan, Mar 11, 2015
  16. Eric SunshineMar 11, 2015
  17. Paul TanMar 12, 2015

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.