From: Junio C Hamano <gitster@pobox.com>
To: Jeff Hostetler <git@jeffhostetler.com>
Cc: git@vger.kernel.org, peff@peff.net, jonathantanmy@google.com,
jrnieder@gmail.com, Jeff Hostetler <jeffhost@microsoft.com>
Subject: Re: [PATCH 1/3] list-objects: add filter_blob to traverse_commit_list
Date: Wed, 28 Jun 2017 10:54:45 -0700 [thread overview]
Message-ID: <xmqqa84svvyy.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <e2216ab8-5af7-4edd-16aa-f84a45e0cbd7@jeffhostetler.com> (Jeff Hostetler's message of "Wed, 28 Jun 2017 13:13:22 -0400")
Jeff Hostetler <git@jeffhostetler.com> writes:
> Yes, my logic was a little confusing there. Jonathan Tan said
> something similar the other day. I have a new version that I'm
> working on now that looks like this:
>
> list_objects_filter_result r = LOFR_MARK_SEEN | LOFR_SHOW;
> ...
> if (filter)
> r = filter(obj, path->buf, ...
> if (r & LOFR_MARK_SEEN)
> obj->flags |= SEEN;
> if (r & LOFR_SHOW)
> show(obj, path->buf, cb_data);
>
> I'm generalizing it a little to let the filter return 2 flags:
> () SEEN to indicate that the filter doesn't want to see it again
> () SHOW to include the object in the result.
> These let filters do "hard" and "provisional" omits. (This will
> make more sense later when I get my patch cleaned up.)
It is not immediately obvious to me, especially without seeing the
actual patch, why MARK_SEEN is needed. Especially given that I
think a call to show() must set obj->flags |= SEEN anyway to avoid
duplicate output, with or without the objects-filter mechanism.
But that question can and should wait.
> Yes, I'm including similar logic inside process_tree() to allow that
> and let the filter know about entering and leaving each tree. So we
> only need one filter-proc to handle a particular strategy and it will
> handle both tree and blob objects.
>
> I want to be able to use this mechanism to do narrow clone/fetch
> using such a filter-proc and a sparse-checkout-like spec.
Good to know ;-).
next prev parent reply other threads:[~2017-06-28 17:55 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-22 20:36 [PATCH 0/3] WIP list-objects and pack-objects for partial clone Jeff Hostetler
2017-06-22 20:36 ` [PATCH 1/3] list-objects: add filter_blob to traverse_commit_list Jeff Hostetler
2017-06-22 21:45 ` Jonathan Tan
2017-06-22 22:10 ` Jonathan Tan
2017-06-23 17:16 ` Jeff Hostetler
2017-06-28 16:23 ` Junio C Hamano
2017-06-28 17:13 ` Jeff Hostetler
2017-06-28 17:54 ` Junio C Hamano [this message]
2017-06-22 20:36 ` [PATCH 2/3] pack-objects: WIP add max-blob-size filtering Jeff Hostetler
2017-06-22 21:54 ` Jonathan Tan
2017-06-22 22:14 ` Junio C Hamano
2017-06-22 20:36 ` [PATCH 3/3] pack-objects: add t5317 to test max-blob-size Jeff Hostetler
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=xmqqa84svvyy.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=git@jeffhostetler.com \
--cc=git@vger.kernel.org \
--cc=jeffhost@microsoft.com \
--cc=jonathantanmy@google.com \
--cc=jrnieder@gmail.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).