From: "Nikita Leonov via GitGitGadget" <gitgitgadget@gmail.com> To: git@vger.kernel.org Cc: Johannes Schindelin <johannes.schindelin@gmx.de>, Nikita Leonov <nykyta.leonov@gmail.com> Subject: [PATCH v2 1/3] credential.c: fix credential reading with regards to CR/LF Date: Mon, 28 Sep 2020 11:40:22 +0000 [thread overview] Message-ID: <27f6400a21412d762b290a34a78ebe7296d36bf3.1601293224.git.gitgitgadget@gmail.com> (raw) In-Reply-To: <pull.710.v2.git.git.1601293224.gitgitgadget@gmail.com> From: Nikita Leonov <nykyta.leonov@gmail.com> This fix makes using Git credentials more friendly to Windows users. In previous version it was unable to finish input correctly without configuration changes (tested in PowerShell, CMD, Cygwin). We know credential filling should be finished by empty input, but the current implementation does not take into account CR/LF ending, and hence instead of the empty string we get '\r', which is interpreted as an incorrect string. So this commit changes default reading function to a more Windows compatible reading function. Signed-off-by: Nikita Leonov <nykyta.leonov@gmail.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> --- credential.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/credential.c b/credential.c index efc29dc5e1..e5202fbef2 100644 --- a/credential.c +++ b/credential.c @@ -202,7 +202,7 @@ int credential_read(struct credential *c, FILE *fp) { struct strbuf line = STRBUF_INIT; - while (strbuf_getline_lf(&line, fp) != EOF) { + while (strbuf_getline(&line, fp) != EOF) { char *key = line.buf; char *value = strchr(key, '='); -- gitgitgadget
next prev parent reply other threads:[~2020-09-28 11:40 UTC|newest] Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-02-14 13:49 [PATCH] " Johannes Schindelin via GitGitGadget 2020-02-14 17:55 ` Junio C Hamano 2020-02-14 18:32 ` Jeff King 2020-09-28 11:40 ` [PATCH v2 0/3] Prepare git credential to read input with DOS line endings Johannes Schindelin via GitGitGadget 2020-09-28 11:40 ` Nikita Leonov via GitGitGadget [this message] 2020-09-29 0:42 ` [PATCH v2 1/3] credential.c: fix credential reading with regards to CR/LF Jeff King 2020-10-02 11:37 ` Johannes Schindelin 2020-10-02 12:01 ` Jeff King 2020-10-02 12:27 ` Johannes Schindelin 2020-10-02 16:32 ` Junio C Hamano 2020-10-03 13:28 ` Johannes Schindelin 2020-09-28 11:40 ` [PATCH v2 2/3] credentials: make line reading Windows compatible Nikita Leonov via GitGitGadget 2020-09-28 20:58 ` Junio C Hamano 2020-09-29 0:35 ` Jeff King 2020-09-30 22:33 ` Junio C Hamano 2020-10-02 7:53 ` Johannes Schindelin 2020-09-28 23:26 ` Carlo Arenas 2020-09-28 23:41 ` Junio C Hamano 2020-09-29 0:30 ` Jeff King 2020-09-29 0:41 ` Junio C Hamano 2020-09-29 0:44 ` Jeff King 2020-09-29 0:54 ` Junio C Hamano 2020-09-29 3:00 ` Jeff King 2020-09-30 22:25 ` Junio C Hamano 2020-09-30 22:39 ` Jeff King 2020-09-30 22:56 ` Junio C Hamano 2020-10-01 13:54 ` Jeff King 2020-10-01 15:42 ` Junio C Hamano 2020-10-02 8:07 ` Johannes Schindelin 2020-09-28 11:40 ` [PATCH v2 3/3] docs: make notes regarding credential line reading Nikita Leonov via GitGitGadget 2020-09-28 20:31 ` [PATCH v2 0/3] Prepare git credential to read input with DOS line endings Junio C Hamano 2020-10-03 13:29 ` [PATCH v3] credential: treat CR/LF as line endings in the credential protocol Johannes Schindelin via GitGitGadget
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: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=27f6400a21412d762b290a34a78ebe7296d36bf3.1601293224.git.gitgitgadget@gmail.com \ --to=gitgitgadget@gmail.com \ --cc=git@vger.kernel.org \ --cc=johannes.schindelin@gmx.de \ --cc=nykyta.leonov@gmail.com \ --subject='Re: [PATCH v2 1/3] credential.c: fix credential reading with regards to CR/LF' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
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).