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

Re: [PATCH] credential-osxkeychain: load Security framework dynamically

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 14, 2011, 23:18 UTC
Message-ID
<7vhb4esogg.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1316040926-89429-1-git-send-email-jaysoffian@gmail.com>
Jay Soffian <jaysoffian@gmail.com> writes:
> Something like this. I'm going to pause here for feedback. Is the (not yet
> existant) followup commit referenced above allowing git-credential-osxkeychain
> to be a hard link to git a worthwhile endeavor? Or would a better approach be
> to make git-credential-osxkeychain.c not use any git code?
Most definitely the latter, I would think.

The whole point of making the Git credential code talk with a defined interface with external programs is so that these keychain helpers can be written independently from the rest of Git.

If the reason why your keychain helper benefits from linking with the rest of Git is because some pieces of information you need in order to respond to the requests from credential interface is hard to get if your helper is built as an independent program, that is a sign that we are not exposing enough information to scripts, iow, the failure in the design of the credential interface. If that is the case (and I doubt it is), we would need to fix the interface (either the credential interface, or perhaps "git config") so that such an independent program does not have to peek inside the internals of Git.

If the reason is because you want to reuse some generic C API we have that are not necessarily tied to Git (e.g. strbuf, string-list, etc.), on the other hand, please resist the temptation to do so. It would not help your program to serve as an example of independent external keychain helpers, i.e. a demonstration of how simple to write them.

Previous: Jeff King
Message 7 of 7 in “contrib: add a credential helper for Mac OS X's keychain”
  1. contrib: add a credential helper for Mac OS X's keychainJay Soffian, Sep 14, 2011
  2. Jay SoffianSep 14, 2011
  3. credential-osxkeychain: load Security framework dynamicallyJay Soffian, Sep 14, 2011
  4. Jeff KingSep 14, 2011
  5. Jay SoffianSep 14, 2011
  6. Jeff KingSep 15, 2011
  7. Junio C HamanoSep 14, 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.