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: Jonathan Tan <jonathantanmy@google.com>,
	matvore@google.com, git@vger.kernel.org
Subject: Re: [PATCH] rev-list: allow cached objects in existence check
Date: Tue, 5 Mar 2019 14:27:30 -0500	[thread overview]
Message-ID: <20190305192729.GA13409@sigill.intra.peff.net> (raw)
In-Reply-To: <xmqqzhq9tpie.fsf@gitster-ct.c.googlers.com>

On Tue, Mar 05, 2019 at 10:33:13PM +0900, Junio C Hamano wrote:

> Jeff King <peff@peff.net> writes:
> 
> >> Or teach git-blame to have its own pretend mechanism, and remove the
> >> pretend mechanism from sha1-file.c.
> >
> > I think that would be ideal, but I'm not sure if it's feasible due to
> > the layering of the various modules.
> 
> Sorry, but I do not get why we want command-line specific pretend
> mechanism.  When one part of the system wants to behave as if object
> X exists, doesn't that part want other parts of the system to share
> that same world view to be consistent?
> 
> I am mostly reacting to "would be _ideal_"; if it were "if we have
> per-system ad-hoc pretend mechanism, things like this and that would
> become easier to implement, even though that is an ugly hack", I may
> agree when I see examples of things that get easier, though.

The problem is that it's not clear how each of those other parts of the
system should react to these pretend objects. E.g., they probably should
_not_ be used in any operation that might write, since we would not want
to create a permanent object that points to an ephemeral one.

By sticking this in sha1-file.c, it becomes hard to know who will access
them, or with what expectations. Things work right now because we use
the feature sparingly (and only from a process that's purely read-only).
But we're at risk of somebody later misusing it, especially if we spread
its use to more functions like has_object_file().  If this were local to
git-blame, then that risk goes away.

So that's what I meant by "ideal".

I don't think it makes anything easier (in fact, after looking, I think
it makes things in git-blame much harder, to the point that I am not
planning to work on it anytime soon).

-Peff

  reply	other threads:[~2019-03-05 19:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-04 17:40 [PATCH] rev-list: allow cached objects in existence check Jeff King
2019-03-04 19:19 ` Jonathan Tan
2019-03-04 21:17   ` Jeff King
2019-03-05 13:33     ` Junio C Hamano
2019-03-05 19:27       ` Jeff King [this message]
2019-03-05 13:28 ` Junio C Hamano

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=20190305192729.GA13409@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jonathantanmy@google.com \
    --cc=matvore@google.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.
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).