git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Carlo Marcelo Arenas Belón" <carenas@gmail.com>,
	git@vger.kernel.org, dirk@ed4u.de, sunshine@sunshineco.com
Subject: Re: [PATCH v3] git-credential-store: skip empty lines and comments from store
Date: Mon, 27 Apr 2020 17:10:13 -0400	[thread overview]
Message-ID: <20200427211013.GB1732530@coredump.intra.peff.net> (raw)
In-Reply-To: <xmqqv9lk7j7p.fsf@gitster.c.googlers.com>

On Mon, Apr 27, 2020 at 01:43:38PM -0700, Junio C Hamano wrote:

> >> These files are not supposed to be viewed or edited without the help
> >> of the credential helpers.  Do these blank lines and comments even
> >> survive when a new credential is approved, or do we just overwrite
> >> and lose them?
> >
> > That's a good question. In the older code we do save them, because
> > credential-store passes through lines which don't match the credential
> > we're operating on.
> >
> > But in Carlo's patch, the immediate "continue" means we wouldn't ever
> > call "other_cb", which is what does that pass-through.
> 
> So, does that mean the patch that started this thread will still help
> users who wrote custom comments and blank lines in their credential
> store by letting git-credential-store start up, but leaves a ticking
> bomb for them to lose these precious comments and blanks once they
> add a new site, change password, etc., at which point the user realizes
> that comments and blanks are not supported after all?

Yes, exactly. If I start with:

  cat >creds <<\EOF
  # this is a comment
  https://user:pass@example.com/
  EOF

then:

  echo url=https://other:pass@other.example.com |
  git credential-store --file=creds store

with v2.26.0 results in:

  https://other:pass@other.example.com
  # this is a comment
  https://user:pass@example.com

but applying the patch on top:

  https://other:pass@other.example.com
  https://user:pass@example.com/

That raises another issue about comments, too: we make no promises about
where we write new entries. They could be inserted between a comment
line and one it is meant to annotate (that line could even be moved if
we reject and then re-approve a credential).

> I think the first patch we need is a (belated) documentation patch,
> that adds to the existing "STORAGE FORMAT".  We already say "Each
> credential is stored on its own line as a URL", but we do not say
> anything about allowing other cruft in the file.  We probably
> should.  Adding a "comment" feature, if anybody feels like it, is OK
> and we can loosen the paragraph when that happens.

The more I look into it, the more negative I am on adding such a comment
feature.

> -- >8 --
> Subject: credential-store: document the file format a bit more

Yeah, this certainly clarifies things. I suppose one could ask why we'd
bother documenting the format at all, then, though I do think it could
be helpful for debugging.

> Reading a malformed credential URL line and silently ignoring it
> does not mean that we promise to torelate and/or keep empty lines
> and "# commented" lines forever.

s/torelate/tolerate/

-Peff

  reply	other threads:[~2020-04-27 21:10 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-26 23:47 [PATCH] git-credential-store: skip empty lines and comments from store Carlo Marcelo Arenas Belón
2020-04-27  0:19 ` Eric Sunshine
2020-04-27  0:46   ` Carlo Marcelo Arenas Belón
2020-04-27  8:42 ` [PATCH v2] " Carlo Marcelo Arenas Belón
2020-04-27 11:52   ` Jeff King
2020-04-27 12:25     ` Carlo Marcelo Arenas Belón
2020-04-27 14:43       ` Eric Sunshine
2020-04-27 17:47     ` Junio C Hamano
2020-04-27 19:09       ` Jeff King
2020-04-27 12:59   ` [PATCH v3] " Carlo Marcelo Arenas Belón
2020-04-27 13:48     ` Philip Oakley
2020-04-28  1:49       ` Carlo Marcelo Arenas Belón
2020-04-29 10:09         ` Philip Oakley
2020-04-27 15:39     ` Dirk
2020-04-27 18:09     ` Junio C Hamano
2020-04-27 19:18       ` Jeff King
2020-04-27 20:43         ` Junio C Hamano
2020-04-27 21:10           ` Jeff King [this message]
2020-04-28  1:37             ` Carlo Marcelo Arenas Belón
2020-04-27 23:49           ` Carlo Marcelo Arenas Belón
2020-04-28  5:25           ` Jonathan Nieder
2020-04-28  5:41             ` Jeff King
2020-04-28  7:18               ` Carlo Marcelo Arenas Belón
2020-04-28  8:16                 ` Jeff King
2020-04-28 11:25                   ` Carlo Marcelo Arenas Belón
2020-04-28 10:58             ` Stefan Tauner
2020-04-28 16:03             ` Junio C Hamano
2020-04-28 21:14               ` Carlo Marcelo Arenas Belón
2020-04-28 21:17                 ` Junio C Hamano
2020-04-28 10:48     ` [PATCH v4 0/4] credential-store: prevent fatal errors Carlo Marcelo Arenas Belón
2020-04-28 10:52       ` [PATCH v4 1/4] credential-store: document the file format a bit more Carlo Marcelo Arenas Belón
2020-04-28 10:52         ` [PATCH v4 2/4] git-credential-store: skip empty lines and comments from store Carlo Marcelo Arenas Belón
2020-04-28 16:09           ` Eric Sunshine
2020-04-28 16:42             ` Carlo Marcelo Arenas Belón
2020-04-28 10:52         ` [PATCH v4 3/4] git-credential-store: fix (WIP) Carlo Marcelo Arenas Belón
2020-04-28 16:11           ` Eric Sunshine
2020-04-28 17:14             ` Carlo Marcelo Arenas Belón
2020-04-28 10:52         ` [PATCH v4 4/4] credential-store: make sure there is no regression with missing scheme Carlo Marcelo Arenas Belón
2020-04-28 16:06         ` [PATCH v4 1/4] credential-store: document the file format a bit more Eric Sunshine
2020-04-28 18:18           ` Junio C Hamano
2020-04-28 18:15         ` Junio C Hamano
2020-04-29  0:33       ` [PATCH v5] credential-store: warn instead of fatal for bogus lines from store Carlo Marcelo Arenas Belón
2020-04-29  4:36         ` Junio C Hamano
2020-04-29  7:31           ` Carlo Marcelo Arenas Belón
2020-04-29 16:46             ` Junio C Hamano
2020-04-29 20:35         ` [RFC PATCH v6 0/2] credential-store: prevent fatal errors Carlo Marcelo Arenas Belón
2020-04-29 20:35           ` [RFC PATCH v6 1/2] credential-store: warn instead of fatal for bogus lines from store Carlo Marcelo Arenas Belón
2020-04-29 21:05             ` Junio C Hamano
2020-04-29 21:17               ` Junio C Hamano
2020-04-29 20:35           ` [RFC PATCH v6 2/2] credential-store: warn for any incomplete credentials instead of using Carlo Marcelo Arenas Belón
2020-04-29 21:12             ` Junio C Hamano
2020-04-29 21:49               ` [RFC PATCH v6 2/2] credential-store: warn for any incomplete credentials instead of usingy Carlo Marcelo Arenas Belón
2020-04-29 22:04                 ` Junio C Hamano
2020-04-29 23:23           ` [PATCH v6] credential-store: warn instead of fatal for bogus lines from store Carlo Marcelo Arenas Belón
2020-04-29 23:47             ` Junio C Hamano
2020-04-29 23:57               ` Junio C Hamano
2020-04-30  1:00               ` Carlo Marcelo Arenas Belón
2020-04-30  1:19             ` [PATCH v7] " Carlo Marcelo Arenas Belón
2020-04-30  9:29               ` [PATCH v8] " Carlo Marcelo Arenas Belón
2020-04-30 16:06               ` [PATCH v9] " Carlo Marcelo Arenas Belón
2020-04-30 20:21                 ` Junio C Hamano
2020-04-30 21:14                   ` Junio C Hamano
2020-05-01  0:30                   ` Carlo Marcelo Arenas Belón
2020-05-01  1:40                     ` Junio C Hamano
2020-05-01  2:24                       ` Carlo Arenas
2020-05-01  5:27                         ` Junio C Hamano
2020-05-01 13:57                           ` Carlo Marcelo Arenas Belón
2020-05-01 18:59                             ` Junio C Hamano
2020-05-01  3:21                 ` [RFC PATCH v10] credential-store: warn/ignore for bogus lines from store file Carlo Marcelo Arenas Belón
2020-05-01  5:18                   ` [RFC PATCH v10 2/1] credential-store: warn also for store and erase Carlo Marcelo Arenas Belón
2020-05-01  5:35                     ` Junio C Hamano
2020-05-02 18:16                 ` [PATCH v10] credential-store: ignore bogus lines from store file Carlo Marcelo Arenas Belón
2020-05-02 20:47                   ` Junio C Hamano
2020-05-02 21:23                     ` Carlo Marcelo Arenas Belón
2020-05-02 21:53                     ` Carlo Marcelo Arenas Belón
2020-05-03  0:44                       ` Junio C Hamano
2020-05-03 10:06                     ` Jeff King
2020-05-02 21:05                   ` Carlo Marcelo Arenas Belón
2020-05-02 22:34                   ` [PATCH v11] " Carlo Marcelo Arenas Belón

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20200427211013.GB1732530@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=carenas@gmail.com \
    --cc=dirk@ed4u.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=sunshine@sunshineco.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).