Re: [PATCH 2/5] refs: introduce a "ref paranoia" flag

2015-03-19 Thread Jeff King
On Thu, Mar 19, 2015 at 02:31:39PM -0700, Junio C Hamano wrote: > > 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. > > > > Or is there something else I'm missing? > > In ge

Re: [PATCH 2/5] refs: introduce a "ref paranoia" flag

2015-03-19 Thread Junio C Hamano
Jeff King writes: >> > + 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 h

Re: [PATCH 2/5] refs: introduce a "ref paranoia" flag

2015-03-19 Thread Jeff King
On Thu, Mar 19, 2015 at 01:13:13PM -0700, Junio C Hamano wrote: > Jeff King 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, > >

Re: [PATCH 2/5] refs: introduce a "ref paranoia" flag

2015-03-19 Thread Junio C Hamano
Jeff King 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) >

[PATCH 2/5] refs: introduce a "ref paranoia" flag

2015-03-17 Thread Jeff King
Most operations that iterate over refs are happy to ignore broken cruft. However, some operations should be performed with knowledge of these broken refs, because it is better for the operation to choke on a missing object than it is to silently pretend that the ref did not exist (e.g., if we are c