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

[PATCH 3/3] osxkeychain: clarify that we ignore unknown lines

From
Matthew John Cheetham via GitGitGadget <gitgitgadget@gmail.com>
Date
Sep 22, 2022, 16:59 UTC
Message-ID
<2ece562a5952b5752de5040b17ec36076164c72f.1663865974.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.1363.git.1663865974.gitgitgadget@gmail.com>
From: Matthew John Cheetham <mjcheetham@outlook.com>

Like in all the other credential helpers, the osxkeychain helper ignores unknown credential lines.

Add a comment (a la the other helpers) to make it clear and explicit that this is the desired behaviour.

Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
---
 contrib/credential/osxkeychain/git-credential-osxkeychain.c | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/contrib/credential/osxkeychain/git-credential-osxkeychain.c b/contrib/credential/osxkeychain/git-credential-osxkeychain.c
index bf77748d602..e29cc28779d 100644
--- a/contrib/credential/osxkeychain/git-credential-osxkeychain.c
+++ b/contrib/credential/osxkeychain/git-credential-osxkeychain.c
@@ -159,6 +159,11 @@ static void read_credential(void)
 			username = xstrdup(v);
 		else if (!strcmp(buf, "password"))
 			password = xstrdup(v);
+		/*
+		 * Ignore other lines; we don't know what they mean, but
+		 * this future-proofs us when later versions of git do
+		 * learn new lines, and the helpers are updated to match.
+		 */
 	}
 }
 
-- 
gitgitgadget
Previous: Matthew John Cheetham via GitGitGadgetNext: Derrick Stolee
Message 6 of 8 in “Correct credential helper discrepancies handling input”
  1. 0/3 Correct credential helper discrepancies handling inputMatthew John Cheetham via GitGitGadget, Sep 22, 2022
  2. 1/3 wincred: ignore unknown lines (do not die)Matthew John Cheetham via GitGitGadget, Sep 22, 2022
  3. Junio C HamanoSep 22, 2022
  4. Jeff KingSep 22, 2022
  5. 2/3 netrc: ignore unknown lines (do not die)Matthew John Cheetham via GitGitGadget, Sep 22, 2022
  6. 3/3 osxkeychain: clarify that we ignore unknown linesMatthew John Cheetham via GitGitGadget, Sep 22, 2022
  7. Derrick StoleeSep 22, 2022
  8. Jeff KingSep 22, 2022

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.