git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] [WIP] removed fetch_if_missing global
@ 2020-04-20 19:54 Hariom Verma via GitGitGadget
  2020-04-20 19:54 ` [PATCH 1/2] fetch-pack: remove fetch_if_missing=0 Hariom Verma via GitGitGadget
                   ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: Hariom Verma via GitGitGadget @ 2020-04-20 19:54 UTC (permalink / raw)
  To: git; +Cc: Hariom Verma

We are not much happy with global variable fetch_if_missing. So, in commit
6462d5eb9a ("fetch: remove fetch_if_missing=0", 2019-11-08) Jonathan Tan 
jonathantanmy@google.com [jonathantanmy@google.com] attempted to remove the
need for fetch_if_missing=0 from the fetching mechanism. After that, 
fetch_if_missing is removed from clone and promisor-remote too.

I imitated the same logic to remove fetch_if_missing from fetch-pack & 
index-pack.

I'm looking forward to remove fetch_if_missing from other places too, but I
not sure about how to handle it.

In fsck, fetch_if_missing is set to 0 in the beginning of cmd_fsck().

In rev-list, fetch_if_missing is set to 0 in parse_missing_action_value(),
and in cmd_rev_list() while parsing the command-line parameters.(almost
similar case in pack-objects)

fixes #251

Hariom Verma (2):
  fetch-pack: remove fetch_if_missing=0
  index-pack: remove fetch_if_missing=0

 builtin/fetch-pack.c |  2 --
 builtin/index-pack.c | 11 ++---------
 fetch-pack.c         |  2 +-
 3 files changed, 3 insertions(+), 12 deletions(-)


base-commit: be8661a3286c67a5d4088f4226cbd7f8b76544b0
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-606%2Fharry-hov%2Ffetch-if-missing-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-606/harry-hov/fetch-if-missing-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/606
-- 
gitgitgadget

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 1/2] fetch-pack: remove fetch_if_missing=0
  2020-04-20 19:54 [PATCH 0/2] [WIP] removed fetch_if_missing global Hariom Verma via GitGitGadget
@ 2020-04-20 19:54 ` Hariom Verma via GitGitGadget
  2020-05-07 13:17   ` Christian Couder
  2020-05-07 19:43   ` Jonathan Tan
  2020-04-20 19:54 ` [PATCH 2/2] index-pack: " Hariom Verma via GitGitGadget
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 19+ messages in thread
From: Hariom Verma via GitGitGadget @ 2020-04-20 19:54 UTC (permalink / raw)
  To: git; +Cc: Hariom Verma, Hariom Verma

From: Hariom Verma <hariom18599@gmail.com>

Commit 6462d5e ("fetch: remove fetch_if_missing=0", 2019-11-08)
strove to remove the need for fetch_if_missing=0 from the fetching
mechanism, so it is plausible to attempt removing fetch_if_missing=0
from fetch-pack as well.

Signed-off-by: Hariom Verma <hariom18599@gmail.com>
---
 builtin/fetch-pack.c | 2 --
 fetch-pack.c         | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c
index dc1485c8aa1..38a45512918 100644
--- a/builtin/fetch-pack.c
+++ b/builtin/fetch-pack.c
@@ -57,8 +57,6 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix)
 	struct packet_reader reader;
 	enum protocol_version version;
 
-	fetch_if_missing = 0;
-
 	packet_trace_identity("fetch-pack");
 
 	memset(&args, 0, sizeof(args));
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,
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 2/2] index-pack: remove fetch_if_missing=0
  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-04-20 19:54 ` Hariom Verma via GitGitGadget
  2020-05-07 13:10 ` [PATCH 0/2] [WIP] removed fetch_if_missing global Christian Couder
  2023-02-17 17:20 ` Kousik Sanagavarapu
  3 siblings, 0 replies; 19+ messages in thread
From: Hariom Verma via GitGitGadget @ 2020-04-20 19:54 UTC (permalink / raw)
  To: git; +Cc: Hariom Verma, Hariom Verma

From: Hariom Verma <hariom18599@gmail.com>

Commit 6462d5e ("fetch: remove fetch_if_missing=0", 2019-11-08)
strove to remove the need for fetch_if_missing=0 from the fetching
mechanism, so it is plausible to attempt removing fetch_if_missing=0
from index-pack as well.

Signed-off-by: Hariom Verma <hariom18599@gmail.com>
---
 builtin/index-pack.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index d967d188a30..9847baaf3f4 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -782,7 +782,8 @@ static void sha1_object(const void *data, struct object_entry *obj_entry,
 	if (startup_info->have_repository) {
 		read_lock();
 		collision_test_needed =
-			has_object_file_with_flags(oid, OBJECT_INFO_QUICK);
+			has_object_file_with_flags(oid, OBJECT_INFO_QUICK | 
+									OBJECT_INFO_SKIP_FETCH_OBJECT);
 		read_unlock();
 	}
 
@@ -1673,14 +1674,6 @@ int cmd_index_pack(int argc, const char **argv, const char *prefix)
 	unsigned foreign_nr = 1;	/* zero is a "good" value, assume bad */
 	int report_end_of_input = 0;
 
-	/*
-	 * index-pack never needs to fetch missing objects except when
-	 * REF_DELTA bases are missing (which are explicitly handled). It only
-	 * accesses the repo to do hash collision checks and to check which
-	 * REF_DELTA bases need to be fetched.
-	 */
-	fetch_if_missing = 0;
-
 	if (argc == 2 && !strcmp(argv[1], "-h"))
 		usage(index_pack_usage);
 
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH 0/2] [WIP] removed fetch_if_missing global
  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-04-20 19:54 ` [PATCH 2/2] index-pack: " Hariom Verma via GitGitGadget
@ 2020-05-07 13:10 ` Christian Couder
  2020-05-09 17:35   ` Hariom verma
  2023-02-17 17:20 ` Kousik Sanagavarapu
  3 siblings, 1 reply; 19+ messages in thread
From: Christian Couder @ 2020-05-07 13:10 UTC (permalink / raw)
  To: Hariom Verma via GitGitGadget; +Cc: git, Hariom Verma, Jonathan Tan

On Mon, Apr 20, 2020 at 9:57 PM Hariom Verma via GitGitGadget
<gitgitgadget@gmail.com> wrote:
>
> We are not much happy with global variable fetch_if_missing. So, in commit
> 6462d5eb9a ("fetch: remove fetch_if_missing=0", 2019-11-08) Jonathan Tan
> jonathantanmy@google.com [jonathantanmy@google.com] attempted to remove the
> need for fetch_if_missing=0 from the fetching mechanism. After that,
> fetch_if_missing is removed from clone and promisor-remote too.

You might want to add Jonathan in Cc next time, as it could help your
patches move forward. I have added him to this email.

> I imitated the same logic to remove fetch_if_missing from fetch-pack &
> index-pack.

Maybe you could add a few tests as in 6462d5eb9a.

> I'm looking forward to remove fetch_if_missing from other places too, but I
> not sure about how to handle it.

It is ok to not take care of the other places for now. If that was the
only reason why this patch series is marked as WIP, then you might
want to remove WIP, especially if you add tests.

> In fsck, fetch_if_missing is set to 0 in the beginning of cmd_fsck().
>
> In rev-list, fetch_if_missing is set to 0 in parse_missing_action_value(),
> and in cmd_rev_list() while parsing the command-line parameters.(almost
> similar case in pack-objects)
>
> fixes #251

It would be nice if you could give the full URL of the bug, as there
have been different bug trackers used by different people.

Thanks,
Christian.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 1/2] fetch-pack: remove fetch_if_missing=0
  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:40     ` Hariom verma
  2020-05-07 19:43   ` Jonathan Tan
  1 sibling, 2 replies; 19+ messages in thread
From: Christian Couder @ 2020-05-07 13:17 UTC (permalink / raw)
  To: Hariom Verma via GitGitGadget; +Cc: git, Hariom Verma, Jonathan Tan

On Mon, Apr 20, 2020 at 9:57 PM Hariom Verma via GitGitGadget
<gitgitgadget@gmail.com> wrote:
>
> From: Hariom Verma <hariom18599@gmail.com>
>
> Commit 6462d5e ("fetch: remove fetch_if_missing=0", 2019-11-08)
> strove to remove the need for fetch_if_missing=0 from the fetching
> mechanism, so it is plausible to attempt removing fetch_if_missing=0
> from fetch-pack as well.

It's ok to refer to a previous commit, but I think it would be better
if you could repeat a bit the reasons why removing the
fetch_if_missing global is a good idea, and not just rely on the
previous commit.

"it is plausible" also doesn't make it very clear that it's what the
patch is actually doing.

Thanks,
Christian.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 1/2] fetch-pack: remove fetch_if_missing=0
  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
  1 sibling, 1 reply; 19+ messages in thread
From: Junio C Hamano @ 2020-05-07 15:02 UTC (permalink / raw)
  To: Christian Couder
  Cc: Hariom Verma via GitGitGadget, git, Hariom Verma, Jonathan Tan

Christian Couder <christian.couder@gmail.com> writes:

> On Mon, Apr 20, 2020 at 9:57 PM Hariom Verma via GitGitGadget
> <gitgitgadget@gmail.com> wrote:
>>
>> From: Hariom Verma <hariom18599@gmail.com>
>>
>> Commit 6462d5e ("fetch: remove fetch_if_missing=0", 2019-11-08)
>> strove to remove the need for fetch_if_missing=0 from the fetching
>> mechanism, so it is plausible to attempt removing fetch_if_missing=0
>> from fetch-pack as well.
>
> It's ok to refer to a previous commit, but I think it would be better
> if you could repeat a bit the reasons why removing the
> fetch_if_missing global is a good idea, and not just rely on the
> previous commit.
>
> "it is plausible" also doesn't make it very clear that it's what the
> patch is actually doing.

I had the same reaction.  You could even write a random gibberish in
your patch and write "it's plausible this set of random changes made
without understanding what is going on in the current code might
have some chance to work" in your log message, and we would not even
want to touch such a patch with 10-foot pole.

The proposed log message above unfortunately makes this patch
indistinguishable from such a trash, unless we follow the codepaths
that are *not* touched by this patch and think about ramifications
of the removal *ourselves*.  In other words, it does nothing to help
the readers to support the change.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 1/2] fetch-pack: remove fetch_if_missing=0
  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 19:43   ` Jonathan Tan
  2020-05-09 18:00     ` Hariom verma
                       ` (2 more replies)
  1 sibling, 3 replies; 19+ messages in thread
From: Jonathan Tan @ 2020-05-07 19:43 UTC (permalink / raw)
  To: gitgitgadget; +Cc: git, hariom18599, Jonathan Tan

> From: Hariom Verma <hariom18599@gmail.com>
> 
> Commit 6462d5e ("fetch: remove fetch_if_missing=0", 2019-11-08)
> strove to remove the need for fetch_if_missing=0 from the fetching
> mechanism, so it is plausible to attempt removing fetch_if_missing=0
> from fetch-pack as well.
> 
> Signed-off-by: Hariom Verma <hariom18599@gmail.com>

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.

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.

[1] https://lore.kernel.org/git/CAP8UFD2SNnpKWtYUztZ76OU7zBsrXyYhG_Zds1wi+NqBKCv+Qw@mail.gmail.com/

> 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.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 0/2] [WIP] removed fetch_if_missing global
  2020-05-07 13:10 ` [PATCH 0/2] [WIP] removed fetch_if_missing global Christian Couder
@ 2020-05-09 17:35   ` Hariom verma
  0 siblings, 0 replies; 19+ messages in thread
From: Hariom verma @ 2020-05-09 17:35 UTC (permalink / raw)
  To: Christian Couder; +Cc: git

On Thu, May 7, 2020 at 6:40 PM Christian Couder
<christian.couder@gmail.com> wrote:
>
> You might want to add Jonathan in Cc next time, as it could help your
> patches move forward. I have added him to this email.

Thanks, I'll remember next time.

> Maybe you could add a few tests as in 6462d5eb9a.

Sounds like a plan.

> It is ok to not take care of the other places for now. If that was the
> only reason why this patch series is marked as WIP, then you might
> want to remove WIP, especially if you add tests.

I'll remove it, after writing tests.

> It would be nice if you could give the full URL of the bug, as there
> have been different bug trackers used by different people.

I'll do this in future versions.

Thanks,
Hariom

On Thu, May 7, 2020 at 6:40 PM Christian Couder
<christian.couder@gmail.com> wrote:
>
> On Mon, Apr 20, 2020 at 9:57 PM Hariom Verma via GitGitGadget
> <gitgitgadget@gmail.com> wrote:
> >
> > We are not much happy with global variable fetch_if_missing. So, in commit
> > 6462d5eb9a ("fetch: remove fetch_if_missing=0", 2019-11-08) Jonathan Tan
> > jonathantanmy@google.com [jonathantanmy@google.com] attempted to remove the
> > need for fetch_if_missing=0 from the fetching mechanism. After that,
> > fetch_if_missing is removed from clone and promisor-remote too.
>
> You might want to add Jonathan in Cc next time, as it could help your
> patches move forward. I have added him to this email.
>
> > I imitated the same logic to remove fetch_if_missing from fetch-pack &
> > index-pack.
>
> Maybe you could add a few tests as in 6462d5eb9a.
>
> > I'm looking forward to remove fetch_if_missing from other places too, but I
> > not sure about how to handle it.
>
> It is ok to not take care of the other places for now. If that was the
> only reason why this patch series is marked as WIP, then you might
> want to remove WIP, especially if you add tests.
>
> > In fsck, fetch_if_missing is set to 0 in the beginning of cmd_fsck().
> >
> > In rev-list, fetch_if_missing is set to 0 in parse_missing_action_value(),
> > and in cmd_rev_list() while parsing the command-line parameters.(almost
> > similar case in pack-objects)
> >
> > fixes #251
>
> It would be nice if you could give the full URL of the bug, as there
> have been different bug trackers used by different people.
>
> Thanks,
> Christian.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 1/2] fetch-pack: remove fetch_if_missing=0
  2020-05-07 13:17   ` Christian Couder
  2020-05-07 15:02     ` Junio C Hamano
@ 2020-05-09 17:40     ` Hariom verma
  1 sibling, 0 replies; 19+ messages in thread
From: Hariom verma @ 2020-05-09 17:40 UTC (permalink / raw)
  To: Christian Couder; +Cc: git

On Thu, May 7, 2020 at 6:47 PM Christian Couder
<christian.couder@gmail.com> wrote:
>
> It's ok to refer to a previous commit, but I think it would be better
> if you could repeat a bit the reasons why removing the
> fetch_if_missing global is a good idea, and not just rely on the
> previous commit.

I agree with that.

> "it is plausible" also doesn't make it very clear that it's what the
> patch is actually doing.

Thanks for pointing it out. Will improve.

Regards,
Hariom

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 1/2] fetch-pack: remove fetch_if_missing=0
  2020-05-07 15:02     ` Junio C Hamano
@ 2020-05-09 17:48       ` Hariom verma
  0 siblings, 0 replies; 19+ messages in thread
From: Hariom verma @ 2020-05-09 17:48 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On Thu, May 7, 2020 at 8:32 PM Junio C Hamano <gitster@pobox.com> wrote:
>
> Christian Couder <christian.couder@gmail.com> writes:
>
> > It's ok to refer to a previous commit, but I think it would be better
> > if you could repeat a bit the reasons why removing the
> > fetch_if_missing global is a good idea, and not just rely on the
> > previous commit.
> >
> > "it is plausible" also doesn't make it very clear that it's what the
> > patch is actually doing.
>
> I had the same reaction.  You could even write a random gibberish in
> your patch and write "it's plausible this set of random changes made
> without understanding what is going on in the current code might
> have some chance to work" in your log message, and we would not even
> want to touch such a patch with 10-foot pole.
>
> The proposed log message above unfortunately makes this patch
> indistinguishable from such a trash, unless we follow the codepaths
> that are *not* touched by this patch and think about ramifications
> of the removal *ourselves*.  In other words, it does nothing to help
> the readers to support the change.
>

I understand it must be too hard for you to deal with such [trash]patches.
My apologies. Will improve in next revision

Thanks,
Hariom

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 1/2] fetch-pack: remove fetch_if_missing=0
  2020-05-07 19:43   ` Jonathan Tan
@ 2020-05-09 18:00     ` Hariom verma
  2023-02-20 18:13     ` Kousik Sanagavarapu
  2023-02-22 17:45     ` Kousik Sanagavarapu
  2 siblings, 0 replies; 19+ messages in thread
From: Hariom verma @ 2020-05-09 18:00 UTC (permalink / raw)
  To: Jonathan Tan; +Cc: git

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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 0/2] [WIP] removed fetch_if_missing global
  2020-04-20 19:54 [PATCH 0/2] [WIP] removed fetch_if_missing global Hariom Verma via GitGitGadget
                   ` (2 preceding siblings ...)
  2020-05-07 13:10 ` [PATCH 0/2] [WIP] removed fetch_if_missing global Christian Couder
@ 2023-02-17 17:20 ` Kousik Sanagavarapu
  2023-02-18 17:00   ` Christian Couder
  2023-02-19 10:40   ` Hariom verma
  3 siblings, 2 replies; 19+ messages in thread
From: Kousik Sanagavarapu @ 2023-02-17 17:20 UTC (permalink / raw)
  To: gitgitgadget; +Cc: git, hariom18599

Hi,

Are you still working on this? If not, then I would like to take this up
and write the tests, if it is worth doing. I think it would be a better
exposure of the codebase and would be helpful for GSoC.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 0/2] [WIP] removed fetch_if_missing global
  2023-02-17 17:20 ` Kousik Sanagavarapu
@ 2023-02-18 17:00   ` Christian Couder
  2023-02-19  3:57     ` Kousik Sanagavarapu
  2023-02-19 10:40   ` Hariom verma
  1 sibling, 1 reply; 19+ messages in thread
From: Christian Couder @ 2023-02-18 17:00 UTC (permalink / raw)
  To: Kousik Sanagavarapu; +Cc: gitgitgadget, git, hariom18599

Hi Kousik,

On Fri, Feb 17, 2023 at 7:22 PM Kousik Sanagavarapu
<five231003@gmail.com> wrote:

> Are you still working on this? If not, then I would like to take this up
> and write the tests, if it is worth doing. I think it would be a better
> exposure of the codebase and would be helpful for GSoC.

I don't know what's the state of this. I think only Hariom could answer.

I am not so sure it will be helpful for any of the GSoC project ideas
we propose, but feel free to work on it if you want.

Thanks,
Christian.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 0/2] [WIP] removed fetch_if_missing global
  2023-02-18 17:00   ` Christian Couder
@ 2023-02-19  3:57     ` Kousik Sanagavarapu
  2023-02-19  7:37       ` Christian Couder
  0 siblings, 1 reply; 19+ messages in thread
From: Kousik Sanagavarapu @ 2023-02-19  3:57 UTC (permalink / raw)
  To: christian.couder; +Cc: git, gitgitgadget, hariom18599

On Sat, 18 Feb 2023 at 22:30, Christian Couder
<christian.couder@gmail.com> wrote:

>
> I am not so sure it will be helpful for any of the GSoC project ideas
> we propose, but feel free to work on it if you want.

Well, I wanted to work on something before I started working on my application
and found this to be fun. So even if it would not really be
helpful for the project ideas proposed, I would still like to work on it as
something that could go into my application.

Thanks,
Kousik

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 0/2] [WIP] removed fetch_if_missing global
  2023-02-19  3:57     ` Kousik Sanagavarapu
@ 2023-02-19  7:37       ` Christian Couder
  0 siblings, 0 replies; 19+ messages in thread
From: Christian Couder @ 2023-02-19  7:37 UTC (permalink / raw)
  To: Kousik Sanagavarapu; +Cc: git, gitgitgadget, hariom18599

On Sun, Feb 19, 2023 at 4:57 AM Kousik Sanagavarapu
<five231003@gmail.com> wrote:
>
> On Sat, 18 Feb 2023 at 22:30, Christian Couder
> <christian.couder@gmail.com> wrote:
>
> > I am not so sure it will be helpful for any of the GSoC project ideas
> > we propose, but feel free to work on it if you want.
>
> Well, I wanted to work on something before I started working on my application
> and found this to be fun. So even if it would not really be
> helpful for the project ideas proposed, I would still like to work on it as
> something that could go into my application.

Sure, you can mention anything you did related to the project in your
application and we will take it into account.

Thanks,
Christian.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 0/2] [WIP] removed fetch_if_missing global
  2023-02-17 17:20 ` Kousik Sanagavarapu
  2023-02-18 17:00   ` Christian Couder
@ 2023-02-19 10:40   ` Hariom verma
  1 sibling, 0 replies; 19+ messages in thread
From: Hariom verma @ 2023-02-19 10:40 UTC (permalink / raw)
  To: Kousik Sanagavarapu; +Cc: gitgitgadget, git

HI,

On Fri, Feb 17, 2023 at 10:50 PM Kousik Sanagavarapu
<five231003@gmail.com> wrote:
>
> Are you still working on this? If not, then I would like to take this up
> and write the tests, if it is worth doing. I think it would be a better
> exposure of the codebase and would be helpful for GSoC.

I'm not working on it. Feel free to take it forward.

Thanks,
Hariom

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 1/2] fetch-pack: remove fetch_if_missing=0
  2020-05-07 19:43   ` Jonathan Tan
  2020-05-09 18:00     ` Hariom verma
@ 2023-02-20 18:13     ` Kousik Sanagavarapu
  2023-02-22 18:19       ` Jonathan Tan
  2023-02-22 17:45     ` Kousik Sanagavarapu
  2 siblings, 1 reply; 19+ messages in thread
From: Kousik Sanagavarapu @ 2023-02-20 18:13 UTC (permalink / raw)
  To: jonathantanmy; +Cc: git, gitgitgadget

So here, we are partial-cloning from a shallow remote and some
objects are not sent due to our clone filters. Let's say that
the shallow remote has a 5-commit history and we are cloning it
into another repository with a blob:none filter. The expected
behavior is cloning the 5 commits, with no blobs, except
for the HEAD.

When executing the above process, it leads to errors:

	fatal: the remote end hung up unexpectedly
	fatal: protocol error: bad pack header
	warning: Clone succeeded, but checkout failed
	You can inspect what was checked out with 'git status'
	and retry with 'git restore --source=HEAD :/'

I looked into it a bit and it seems that packet_read() is not
successful. I'm not really sure how packet reading fits into
the big picture but it looks like the buffer is not read
completely.

It is a similar case with "bad pack header" too. The function
read_pack_header() fails because the pack header was not fully read.

Also, is the shallow object not sent when cloning due to the partial
clone filter and hence a subsequent fetching is done to ask for this
object? If so, then will such a fetch counted as an args->update_shallow?

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 1/2] fetch-pack: remove fetch_if_missing=0
  2020-05-07 19:43   ` Jonathan Tan
  2020-05-09 18:00     ` Hariom verma
  2023-02-20 18:13     ` Kousik Sanagavarapu
@ 2023-02-22 17:45     ` Kousik Sanagavarapu
  2 siblings, 0 replies; 19+ messages in thread
From: Kousik Sanagavarapu @ 2023-02-22 17:45 UTC (permalink / raw)
  To: jonathantanmy; +Cc: git, five231003

Sorry, it seems that I misunderstood the whole situation here. I didn't
realize that the problem was on my end and not something to do with the
code. Please ignore the above email except for the last question, which
I still don't seem to understand. So, I would be grateful if you could
clarify.

Thanks,
Kousik

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 1/2] fetch-pack: remove fetch_if_missing=0
  2023-02-20 18:13     ` Kousik Sanagavarapu
@ 2023-02-22 18:19       ` Jonathan Tan
  0 siblings, 0 replies; 19+ messages in thread
From: Jonathan Tan @ 2023-02-22 18:19 UTC (permalink / raw)
  To: Kousik Sanagavarapu; +Cc: Jonathan Tan, jonathantanmy, git, gitgitgadget

Kousik Sanagavarapu <five231003@gmail.com> writes:
> Also, is the shallow object not sent when cloning due to the partial
> clone filter and hence a subsequent fetching is done to ask for this
> object? If so, then will such a fetch counted as an args->update_shallow?

What do you mean by the shallow object? If you mean the last commit that
is sent (that is, without its parents), then that is a commit and is not
excluded by the filter.

As for args->update_shallow, that's a good question. Just glancing at
the code, even if it is set, I don't think there would be any difference
in operation since the lazy fetch does not fetch any refs (and in fact,
in protocol v2, we skip the ref advertisement in this case, as far as I
can remember).

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2023-02-22 18:19 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).