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

[PATCH v2 0/4] git-credential-store: XDG user-specific config file support

From
Paul Tan <pyokagan@gmail.com>
Date
Mar 8, 2015, 07:58 UTC
Message-ID
<1425801532-8483-1-git-send-email-pyokagan@gmail.com>
The previous patch series can be found at [1].
[1] http://thread.gmane.org/gmane.comp.version-control.git/264682
The changes are as follows:
* Code refactor: instead of a gigantic blob of code in main(),
  store_credential(), remove_credential() and lookup_credential() have been
  modified to take a string_list of precedence-ordered file paths. Although in
  this patch only support for XDG_CONFIG_HOME (user-specific config files) are
  implemented, this opens the door for support of XDG_CONFIG_DIRS (system-wide
  config files) to be implemented as well.
* parse_credential_file() returns the value of found_credential at all times.
  (Thanks Junio for pointing this out)
* parse_credential_file(), and thus "get" ignores unreadable/non-existing files
  instead of warning the user. This is done to follow the XDG base dir spec,
  which states that: "if for any reason a file in a certain directory is
  unaccessible, e.g. because the directory is non-existant, the file is
  non-existant or the user is not authorized to open the file, then the
  processing of the file in that directory should be skipped."[2]
[2] http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
* "store" now only write to a single file instead of writing to one and erasing
  from the rest, unlike the behavior in the 1st patch, as the complexity
  introduced by implementing this behavior is probably unnecessary. If the user
  really wanted all matching credentials to be erased, the user can simply just
  issue an erase. (Thanks Matthieu, Junio and Jeff for this suggestion)
* ~/.git-credentials now has greater precedence than the xdg credentials file.
  This is to be consistent with the behavior of git-config.
* Support for $XDG_CONFIG_HOME/git/credentials has been documented in
  git-credentials-store.
The changes for the tests are as follows:
* Instead of repeating ${XDG_CONFIG_HOME:-$HOME/.config} all over
  the place, add tests that test for $HOME/.config/git/credentials (when
  XDG_CONFIG_HOME is unset) and for $XDG_CONFIG_HOME/git/credentials with a
  custom $XDG_CONFIG_HOME directory set. This is to test that the new code
  respects the $XDG_CONFIG_HOME environment variable. (Thanks Junio)
* Use test_path_is_missing to test if files exist. (Thanks Matthieu)
* All code is now within test_expect_success and will now fail if any
  error occurs in the code block through the use of "&&". Furthermore, tests do
  not rely on previous tests passing as the credential files are overwritten in
  each test. (Thanks Matthieu and Junio for your code review)

The most current version of the patch queue is published in the xdg branch at [3]. I try to push -f regularly.

For your feedback, please.
[3] https://github.com/pyokagan/git
Paul Tan (4):
  git-credential-store: support multiple credential files
  git-credential-store: support XDG_CONFIG_HOME
  docs/git-credential-store: document XDG file and precedence
  t0302: test credential-store support for XDG_CONFIG_HOME
 Documentation/git-credential-store.txt | 37 +++++++++++++-
 credential-store.c                     | 86 +++++++++++++++++++++----------
 t/t0302-credential-store.sh            | 92 ++++++++++++++++++++++++++++++++++
 3 files changed, 186 insertions(+), 29 deletions(-)
-- 
2.1.4
Next: Paul Tan
Message 1 of 8 in “git-credential-store: XDG user-specific config file support”
  1. 0/4 git-credential-store: XDG user-specific config file supportPaul Tan, Mar 8, 2015
  2. 1/4 git-credential-store: support multiple credential filesPaul Tan, Mar 8, 2015
  3. 2/4 git-credential-store: support XDG_CONFIG_HOMEPaul Tan, Mar 8, 2015
  4. Paul TanMar 10, 2015
  5. 3/4 docs/git-credential-store: document XDG file and precedencePaul Tan, Mar 8, 2015
  6. 4/4 t0302: test credential-store support for XDG_CONFIG_HOMEPaul Tan, Mar 8, 2015
  7. Matthieu MoyMar 9, 2015
  8. Paul TanMar 10, 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.