From: Junio C Hamano <gitster@pobox•com>
To: Jonathan Tan <jonathantanmy@google•com>
Cc: git@vger•kernel.org, hanyang.tony@bytedance•com
Subject: Re: [PATCH 3/3] index-pack: commit tree during outgoing link check
Date: Tue, 03 Dec 2024 12:10:20 +0900 [thread overview]
Message-ID: <xmqqa5ddfomb.fsf@gitster.g> (raw)
In-Reply-To: <2f2f0db78bf85c14ef132e1924ab5021298aace3.1733170252.git.jonathantanmy@google.com> (Jonathan Tan's message of "Mon, 2 Dec 2024 12:18:40 -0800")
Jonathan Tan <jonathantanmy@google•com> writes:
> Subject: Re: [PATCH 3/3] index-pack: commit tree during outgoing link check
> Commit c08589efdc (index-pack: repack local links into promisor packs,
> 2024-11-01) seems to contain an oversight in that the tree of a commit
> is not checked.
I am having a hard time linking the subject with the statement. The
verb "commit" should probably be something else, as you are not
creating a tree object while checking, but I am not sure?
> The fix slows down a fetch from a certain repo at
> $DAYJOB from 2m2.127s to 2m45.052s, but in order to make the fetch
> correct, it seems worth it.
And "the fix" is not described so a reader is left wondering. Is
the fix for an oversight of not checking merely to check it? IOW,
is
c08589efdc made outgoing links to be checked for commits, but
failed to do so for trees. Make sure we check both
what is happening?
> In order to test this, we could create server and client repos as
> follows...
>
> C S
> \ /
> O
>
> (O and C are commits both on the client and server. S is a commit
> only on the server. C and S have the same tree but different commit
> messages.)
>
> ...and then, from the client, fetch S from the server.
>
> In theory, the client declares "have C" and the server can use this
> information to exclude S's tree (since it knows that the client has C's
> tree, which is the same as S's tree).
OK.
> However, it is also possible for
> the server to compute that it needs to send S and not O, and proceed
> from there;
If O, C, and S have all identical trees, then wouldn't such a test
work well? At that point it does not matter which between O and C
the server bases its decision to send S but not S's tree on, no?
In any case, will queue. Thanks.
> therefore the objects of C are not considered at all when
> determining what to send in the packfile. In order to prevent a test of
> client functionality from having such a dependence on server behavior, I
> have not included such a test.
>
> Signed-off-by: Jonathan Tan <jonathantanmy@google•com>
> ---
> builtin/index-pack.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/builtin/index-pack.c b/builtin/index-pack.c
> index 58d24540dc..338aeeadc8 100644
> --- a/builtin/index-pack.c
> +++ b/builtin/index-pack.c
> @@ -838,6 +838,7 @@ static void do_record_outgoing_links(struct object *obj)
> struct commit *commit = (struct commit *) obj;
> struct commit_list *parents = commit->parents;
>
> + record_outgoing_link(get_commit_tree_oid(commit));
> for (; parents; parents = parents->next)
> record_outgoing_link(&parents->item->object.oid);
> } else if (obj->type == OBJ_TAG) {
next prev parent reply other threads:[~2024-12-03 3:10 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-02 20:18 [PATCH 0/3] Performance improvements for repacking non-promisor objects Jonathan Tan
2024-12-02 20:18 ` [PATCH 1/3] index-pack: dedup first during outgoing link check Jonathan Tan
2024-12-02 21:24 ` Josh Steadmon
2024-12-02 20:18 ` [PATCH 2/3] index-pack: no blobs " Jonathan Tan
2024-12-03 6:00 ` Patrick Steinhardt
2024-12-03 21:40 ` Jonathan Tan
2024-12-03 22:16 ` Junio C Hamano
2024-12-02 20:18 ` [PATCH 3/3] index-pack: commit tree " Jonathan Tan
2024-12-03 3:10 ` Junio C Hamano [this message]
2024-12-03 21:42 ` Jonathan Tan
2024-12-04 0:21 ` Junio C Hamano
2024-12-09 20:29 ` Jonathan Tan
2024-12-09 23:51 ` Junio C Hamano
2024-12-02 21:25 ` [PATCH 0/3] Performance improvements for repacking non-promisor objects Josh Steadmon
2024-12-03 4:09 ` Junio C Hamano
2024-12-03 4:18 ` Junio C Hamano
2024-12-03 4:20 ` Junio C Hamano
2024-12-03 4:39 ` Junio C Hamano
2024-12-03 21:43 ` [PATCH v2 " Jonathan Tan
2024-12-03 21:43 ` [PATCH v2 1/3] index-pack --promisor: dedup before checking links Jonathan Tan
2024-12-03 21:43 ` [PATCH v2 2/3] index-pack --promisor: don't check blobs Jonathan Tan
2024-12-03 21:43 ` [PATCH v2 3/3] index-pack --promisor: also check commits' trees Jonathan Tan
2024-12-03 21:52 ` [PATCH v3 0/3] Performance improvements for repacking non-promisor objects Jonathan Tan
2024-12-03 21:52 ` [PATCH v3 1/3] index-pack --promisor: dedup before checking links Jonathan Tan
2024-12-04 4:36 ` Junio C Hamano
2024-12-03 21:52 ` [PATCH v3 2/3] index-pack --promisor: don't check blobs Jonathan Tan
2024-12-03 21:52 ` [PATCH v3 3/3] index-pack --promisor: also check commits' trees Jonathan Tan
2024-12-04 2:22 ` [PATCH v3 0/3] Performance improvements for repacking non-promisor objects Junio C Hamano
2024-12-04 4:46 ` [PATCH 4/3] index-pack: work around false positive use of uninitialized variable 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=xmqqa5ddfomb.fsf@gitster.g \
--to=gitster@pobox$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=hanyang.tony@bytedance$(echo .)com \
--cc=jonathantanmy@google$(echo .)com \
/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