From: Hariom verma <hariom18599@gmail.com>
To: Jonathan Tan <jonathantanmy@google.com>
Cc: git <git@vger.kernel.org>
Subject: Re: [PATCH 1/2] fetch-pack: remove fetch_if_missing=0
Date: Sat, 9 May 2020 23:30:28 +0530 [thread overview]
Message-ID: <CA+CkUQ8fa=osCunE2Nj1ezzci_qEkv7mRwX=9Cg-kkMYcDHx=w@mail.gmail.com> (raw)
In-Reply-To: <20200507194354.33347-1-jonathantanmy@google.com>
On Fri, May 8, 2020 at 1:13 AM Jonathan Tan <jonathantanmy@google.com> wrote:
>
> As Christian said [1], please include tests like in the commit you
> mentioned. For a change like this, I think that the test is the most
> important part.
>
I will definitely add tests.
> Also include a justification for why it's safe to remove
> fetch_if_missing=0. You can probably cite the aforementioned commit to
> say that it covers the fetch_pack() method, and then go through the rest
> of the code to see if any may inadvertently fetch an object.
>
> Also, the fetch-pack and index-pack parts can be sent in separate patch
> sets, so you might want to concentrate on one command first.
>
Thanks, Will split and concentrate on one at a time.
>
> > diff --git a/fetch-pack.c b/fetch-pack.c
> > index 1734a573b01..1ca643f6491 100644
> > --- a/fetch-pack.c
> > +++ b/fetch-pack.c
> > @@ -1649,7 +1649,7 @@ static void update_shallow(struct fetch_pack_args *args,
> > struct oid_array extra = OID_ARRAY_INIT;
> > struct object_id *oid = si->shallow->oid;
> > for (i = 0; i < si->shallow->nr; i++)
> > - if (has_object_file(&oid[i]))
> > + if (has_object_file_with_flags(&oid[i], OBJECT_INFO_SKIP_FETCH_OBJECT))
> > oid_array_append(&extra, &oid[i]);
> > if (extra.nr) {
> > setup_alternate_shallow(&shallow_lock,
>
> Hmm...this triggers when the user requests a clone that is both partial
> and shallow, and the server reports a shallow object that it didn't send
> back as a packfile; and it causes another fetch to be sent. This is a
> separate issue, but Hariom, if you'd like to take a look at this, that
> would work out too. You'll need to figure out how to make the server
> send back shallow lines referencing objects that are not in the packfile
> - one way to do it is to use one-time-perl. (Search the codebase to see
> how it is used.) This is probably more complex, though.
I'm clueless about "one-time-perl" thing(till now!). Will surely going
to learn about that.
Thanks for the nice explanation.
Regards,
Hariom
next prev parent reply other threads:[~2020-05-09 18:00 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-20 19:54 [PATCH 0/2] [WIP] removed fetch_if_missing global Hariom Verma via GitGitGadget
2020-04-20 19:54 ` [PATCH 1/2] fetch-pack: remove fetch_if_missing=0 Hariom Verma via GitGitGadget
2020-05-07 13:17 ` Christian Couder
2020-05-07 15:02 ` Junio C Hamano
2020-05-09 17:48 ` Hariom verma
2020-05-09 17:40 ` Hariom verma
2020-05-07 19:43 ` Jonathan Tan
2020-05-09 18:00 ` Hariom verma [this message]
2023-02-20 18:13 ` Kousik Sanagavarapu
2023-02-22 18:19 ` Jonathan Tan
2023-02-22 17:45 ` Kousik Sanagavarapu
2020-04-20 19:54 ` [PATCH 2/2] index-pack: " Hariom Verma via GitGitGadget
2020-05-07 13:10 ` [PATCH 0/2] [WIP] removed fetch_if_missing global Christian Couder
2020-05-09 17:35 ` Hariom verma
2023-02-17 17:20 ` Kousik Sanagavarapu
2023-02-18 17:00 ` Christian Couder
2023-02-19 3:57 ` Kousik Sanagavarapu
2023-02-19 7:37 ` Christian Couder
2023-02-19 10:40 ` Hariom verma
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='CA+CkUQ8fa=osCunE2Nj1ezzci_qEkv7mRwX=9Cg-kkMYcDHx=w@mail.gmail.com' \
--to=hariom18599@gmail.com \
--cc=git@vger.kernel.org \
--cc=jonathantanmy@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).