git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Michael Haggerty <mhagger@alum.mit.edu>
Subject: Re: [PATCH 2/5] refs: introduce a "ref paranoia" flag
Date: Thu, 19 Mar 2015 17:00:19 -0400	[thread overview]
Message-ID: <20150319210019.GB7775@peff.net> (raw)
In-Reply-To: <xmqqbnjoiw4m.fsf@gitster.dls.corp.google.com>

On Thu, Mar 19, 2015 at 01:13:13PM -0700, Junio C Hamano wrote:

> Jeff King <peff@peff.net> writes:
> 
> > diff --git a/refs.c b/refs.c
> > index e23542b..7f0e7be 100644
> > --- a/refs.c
> > +++ b/refs.c
> > @@ -1934,6 +1934,11 @@ static int do_for_each_ref(struct ref_cache *refs, const char *base,
> >  	data.fn = fn;
> >  	data.cb_data = cb_data;
> >  
> > +	if (ref_paranoia < 0)
> > +		ref_paranoia = git_env_bool("GIT_REF_PARANOIA", 0);
> > +	if (ref_paranoia)
> > +		data.flags |= DO_FOR_EACH_INCLUDE_BROKEN;
> 
> I am not a big fan of proliferation of interfaces based on
> environment variables, but hopefully this is isolated enough to
> become an issue in the future.

I'm not sure which part you don't like.

We do have to have this variable cross some process boundaries. Only
"repack" knows whether to turn on paranoia, but "pack-objects" is the
one that must act on it. For that case, we could add a "--ref-paranoia"
flag to pack-objects.

But there are also other cases where the _user_ might want to tell us to
be paranoid (e.g., the upload-pack example I gave earlier). Adding
--paranoia options to every command that might iterate, along with
support for other programs that call them to pass the option through,
seems like a large amount of maintenance burden for little benefit.

We could add a git-global "git --ref-paranoia <cmd>" option and leave
the environment variable as an implementation detail. That makes it hard
to turn on for server-side operations, though. git-daemon runs
git-upload-pack without room for options, though I suppose you could run
"git --ref-paranoia daemon". Smart-http is harder. I'm not sure Apache
lets you add random arguments to CGI programs.

Or is there something else I'm missing?

-Peff

  reply	other threads:[~2015-03-19 21:00 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-17  7:27 [PATCH 0/5] not making corruption worse Jeff King
2015-03-17  7:28 ` [PATCH 1/5] t5312: test object deletion code paths in a corrupted repository Jeff King
2015-03-17 18:34   ` Johannes Sixt
2015-03-17 18:55     ` Jeff King
2015-03-18 20:42       ` Johannes Sixt
2015-03-19 20:04   ` Junio C Hamano
2015-03-19 20:51     ` Jeff King
2015-03-19 21:23       ` Junio C Hamano
2015-03-19 21:47         ` Jeff King
2015-03-19 21:49           ` Junio C Hamano
2015-03-19 21:52             ` Jeff King
2015-03-20  1:16   ` Eric Sunshine
2015-03-20  1:32     ` Jeff King
2015-03-20  1:37       ` Eric Sunshine
2015-03-20  2:08         ` test &&-chain lint (was: [PATCH 1/5] t5312: test object deletion code paths in a corrupted repository) Jeff King
2015-03-20  2:25           ` Jeff King
2015-03-20  5:10             ` Jeff King
2015-03-20  7:18               ` Eric Sunshine
2015-03-20  6:51             ` test &&-chain lint Junio C Hamano
2015-03-20 17:04               ` Junio C Hamano
2015-03-20 17:24                 ` Jeff King
2015-03-20 17:34                   ` Junio C Hamano
2015-03-20 17:59                     ` Jeff King
2015-03-17  7:29 ` [PATCH 2/5] refs: introduce a "ref paranoia" flag Jeff King
2015-03-19 20:13   ` Junio C Hamano
2015-03-19 21:00     ` Jeff King [this message]
2015-03-19 21:31       ` Junio C Hamano
2015-03-19 21:51         ` Jeff King
2015-03-17  7:30 ` [PATCH 3/5] prune: turn on ref_paranoia flag Jeff King
2015-03-17  7:31 ` [PATCH 4/5] repack: turn on "ref paranoia" when doing a destructive repack Jeff King
2015-03-17  7:31 ` [PATCH 5/5] refs.c: drop curate_packed_refs Jeff King
2015-03-20  1:27   ` Eric Sunshine
2015-03-17  7:37 ` [PATCH 0/5] not making corruption worse Jeff King
2015-03-17 22:54   ` Junio C Hamano
2015-03-18 10:21     ` Jeff King
2015-03-20 18:42 ` [PATCH v2 " Jeff King
2015-03-20 18:43   ` [PATCH v2 1/5] t5312: test object deletion code paths in a corrupted repository Jeff King
2015-03-20 18:43   ` [PATCH v2 2/5] refs: introduce a "ref paranoia" flag Jeff King
2015-03-20 18:43   ` [PATCH v2 3/5] prune: turn on ref_paranoia flag Jeff King
2015-03-20 18:43   ` [PATCH v2 4/5] repack: turn on "ref paranoia" when doing a destructive repack Jeff King
2015-03-20 18:43   ` [PATCH v2 5/5] refs.c: drop curate_packed_refs 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:
  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=20150319210019.GB7775@peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=mhagger@alum.mit.edu \
    /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.
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).