From: Junio C Hamano <gitster@pobox•com>
To: Jeff King <peff@peff•net>
Cc: Jonathan Nieder <jrnieder@gmail•com>, git@vger•kernel.org
Subject: Re: [PATCHv2] write_index: optionally allow broken null sha1s
Date: Mon, 26 Aug 2013 09:02:46 -0700 [thread overview]
Message-ID: <xmqq38pwjv89.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20130826143135.GB14858@sigill.intra.peff.net> (Jeff King's message of "Mon, 26 Aug 2013 10:31:35 -0400")
Jeff King <peff@peff•net> writes:
>> I found this version more readable than Peff's (albeit slightly).
>
> OK. Do you want to apply with Jonathan's wording, then?
I can do that, as it seems all of us are in agreement.
> There's one subtle thing I didn't mention in the "it is already on stack
> overflow". If you have a version of git which complains about the null
> sha1, then the SO advice is already broken. But if the SO works, then
> you do not have a version of git which complains. So why do you care?
>
> And the answer is: you may be pushing to a remote with a version of git
> that complains, and which has receive.fsckObjects set (and in many
> cases, that remote is GitHub, since we have had that check on for a
> while).
>
> I don't know if it is worth spelling that out or not.
Probably not.
You could aim to correct each and every wrong suggestions on a site
where misguided leads other misguided, but it is a hopeless task.
>> > After this patch, do you think (in a separate change) it would make
>> > sense for cache-tree.c::update_one() to check for null sha1 and error
>> > out unless GIT_ALLOW_NULL_SHA1 is true? That would let us get rid of
>> > the caveat from the last paragraph.
>>
>> Hmm, interesting thought.
>
> I think it is worth doing. The main reason I put the original check on
> writing to the index is that it more clearly pinpoints the source of the
> error. If we just died during git-write-tree, then you know somebody
> broke your index, but you don't know which command.
>
> But checking in both places would add extra protection, and would make
> possible the "relax on read, strict on write" policy that filter-branch
> wants to do.
Yeah, I agree with all of the above.
next prev parent reply other threads:[~2013-08-26 16:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-24 1:33 [PATCH] write_index: optionally allow broken null sha1s Jeff King
2013-08-25 6:15 ` Jonathan Nieder
2013-08-25 9:58 ` [PATCHv2] " Jeff King
2013-08-25 19:54 ` Jonathan Nieder
2013-08-26 6:03 ` Junio C Hamano
2013-08-26 14:31 ` Jeff King
2013-08-26 16:02 ` Junio C Hamano [this message]
2013-08-26 21:36 ` Jeff King
2013-08-26 14:27 ` Jeff King
2013-08-26 17:35 ` Jonathan Nieder
2013-08-26 21:20 ` Jeff King
2013-08-27 3:46 ` Junio C Hamano
2013-08-27 20:41 ` [PATCHv3] " 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=xmqq38pwjv89.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=jrnieder@gmail$(echo .)com \
--cc=peff@peff$(echo .)net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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