archive mirror
 help / color / mirror / Atom feed
From: "Matthew John Cheetham via GitGitGadget" <>
	Matthew John Cheetham <>,
	Matthew John Cheetham <>
Subject: [PATCH 1/3] wincred: ignore unknown lines (do not die)
Date: Thu, 22 Sep 2022 16:59:32 +0000	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

From: Matthew John Cheetham <>

It is the expectation that credential helpers be liberal in what they
accept and conservative in what they return, to allow for future growth
and evolution of the protocol/interaction.

All of the other helpers (store, cache, osxkeychain, libsecret,
gnome-keyring) except `netrc` currently ignore any credential lines
that are not recognised, whereas the Windows helper (wincred) instead

Fix the discrepancy and ignore unknown lines in the wincred helper.

Signed-off-by: Matthew John Cheetham <>
 contrib/credential/wincred/git-credential-wincred.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/contrib/credential/wincred/git-credential-wincred.c b/contrib/credential/wincred/git-credential-wincred.c
index 5091048f9c6..ead6e267c78 100644
--- a/contrib/credential/wincred/git-credential-wincred.c
+++ b/contrib/credential/wincred/git-credential-wincred.c
@@ -278,8 +278,11 @@ static void read_credential(void)
 			wusername = utf8_to_utf16_dup(v);
 		} else if (!strcmp(buf, "password"))
 			password = utf8_to_utf16_dup(v);
-		else
-			die("unrecognized input");
+		/*
+		 * 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.
+		 */

  reply	other threads:[~2022-09-22 16:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-22 16:59 [PATCH 0/3] Correct credential helper discrepancies handling input Matthew John Cheetham via GitGitGadget
2022-09-22 16:59 ` Matthew John Cheetham via GitGitGadget [this message]
2022-09-22 21:19   ` [PATCH 1/3] wincred: ignore unknown lines (do not die) Junio C Hamano
2022-09-22 22:09     ` Jeff King
2022-09-22 16:59 ` [PATCH 2/3] netrc: " Matthew John Cheetham via GitGitGadget
2022-09-22 16:59 ` [PATCH 3/3] osxkeychain: clarify that we ignore unknown lines Matthew John Cheetham via GitGitGadget
2022-09-22 18:31 ` [PATCH 0/3] Correct credential helper discrepancies handling input Derrick Stolee
2022-09-22 22:11 ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).