git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jonathan Tan <jonathantanmy@google.com>
To: peff@peff.net
Cc: jonathantanmy@google.com, gitster@pobox.com, git@vger.kernel.org
Subject: Re: [PATCH] diff: skip GITLINK when lazy fetching missing objs
Date: Thu, 22 Aug 2019 09:25:34 -0700	[thread overview]
Message-ID: <20190822162534.17365-1-jonathantanmy@google.com> (raw)
In-Reply-To: <20190822041529.GA4347@sigill.intra.peff.net>

> I wondered what would happen when it does not succeed. It looks like the
> whole diff process just dies.
> 
> The batch fetch is purely an optimization, because we'd eventually fetch
> the individual objects on demand. If the batch one fails, should we
> continue with the operation? That leaves any error-handling for the
> overall operation to the "real" code. And it would also mean that this
> bug became an annoying error message,

On the one hand, if the batch fetch fails, then the individual
prefetching would likely fail as well. But on the other hand, as you
said below, we sometimes extraneously fetch objects, so making the batch
fetch non-fatal might be a good idea too.

> But certainly your fix is the right thing to do regardless.
> 
> Tangential to your fix, but I also noticed while poking at this that
> we're pretty aggressive about fetching objects, even if they won't be
> needed. I know we touched on this briefly when discussing the original
> patch, and the logic can get pretty complicated, so we punted. But there
> are a few cases that I think might have a good cost/benefit ratio:
> 
>   1. a --raw diff without renames doesn't need the blobs (and even with
>      renames, it only needs added/deleted entries). I imagine that being
>      able to "git log --raw" on a full history without pulling in a
>      bunch of blobs might be worthwhile (and a fairly common operation).
> 
>   2. Files that exceed bigFileThreshold or are marked as binary via
>      gitattributes will generally be skipped during the file-level diff,
>      without even loading them. These are the minority of files, but
>      they also have an outsized cost to fetching them (and in fact may
>      be the very thing people are trying to avoid with a blob filter).
> 
> Again, not anything to hold up your patch, but just cataloging some
> future work for this area.

Good points. Thanks.

  reply	other threads:[~2019-08-22 16:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-20 20:53 [PATCH] diff: skip GITLINK when lazy fetching missing objs Jonathan Tan
2019-08-20 21:18 ` Junio C Hamano
2019-08-20 21:39   ` Jonathan Tan
2019-08-22  4:15     ` Jeff King
2019-08-22 16:25       ` Jonathan Tan [this message]
2019-08-22 17:10         ` 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

  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=20190822162534.17365-1-jonathantanmy@google.com \
    --to=jonathantanmy@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /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).