* [PATCH] send-pack: don't send a thin pack when the server doesn't support it
@ 2013-10-08 8:44 Carlos Martín Nieto
2013-10-08 9:44 ` Duy Nguyen
0 siblings, 1 reply; 6+ messages in thread
From: Carlos Martín Nieto @ 2013-10-08 8:44 UTC (permalink / raw)
To: git
Not every server out there supports fixing thin packs, so let's send
them a full pack.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
---
It's not always possible to support thin packs (sometimes there isn't
even an object database to grab bases out of). And in any case git
shouldn't create thin packs if the server hasn't said it knows how to
fix them, as per the point of the extension.
send-pack.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/send-pack.c b/send-pack.c
index 7d172ef..7b88ac8 100644
--- a/send-pack.c
+++ b/send-pack.c
@@ -205,6 +205,8 @@ int send_pack(struct send_pack_args *args,
quiet_supported = 1;
if (server_supports("agent"))
agent_supported = 1;
+ if (!server_supports("thin-pack"))
+ args->use_thin_pack = 0;
if (!remote_refs) {
fprintf(stderr, "No refs in common and none specified; doing nothing.\n"
--
1.8.4.561.g1c3d45d
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] send-pack: don't send a thin pack when the server doesn't support it
2013-10-08 8:44 [PATCH] send-pack: don't send a thin pack when the server doesn't support it Carlos Martín Nieto
@ 2013-10-08 9:44 ` Duy Nguyen
2013-10-08 10:58 ` Carlos Martin Nieto
2013-10-08 11:29 ` Duy Nguyen
0 siblings, 2 replies; 6+ messages in thread
From: Duy Nguyen @ 2013-10-08 9:44 UTC (permalink / raw)
To: Carlos Martín Nieto; +Cc: Git Mailing List
On Tue, Oct 8, 2013 at 3:44 PM, Carlos Martín Nieto <cmn@elego.de> wrote:
> diff --git a/send-pack.c b/send-pack.c
> index 7d172ef..7b88ac8 100644
> --- a/send-pack.c
> +++ b/send-pack.c
> @@ -205,6 +205,8 @@ int send_pack(struct send_pack_args *args,
> quiet_supported = 1;
> if (server_supports("agent"))
> agent_supported = 1;
> + if (!server_supports("thin-pack"))
> + args->use_thin_pack = 0;
Hmm.. I think this introduces a regression in C Git because
receive-pack never advertises "thin-pack" and so "git push" from now
on will never send thin packs. It's too late now to add thin-pack to
receive-pack, perhaps a new extension "no-thin-pack" for those
servers? Alternatively, just run git push --no-thin (you'll need
f7c815c (push: respect --no-thin - 2013-08-12) though).
> if (!remote_refs) {
> fprintf(stderr, "No refs in common and none specified; doing nothing.\n"
--
Duy
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] send-pack: don't send a thin pack when the server doesn't support it
2013-10-08 9:44 ` Duy Nguyen
@ 2013-10-08 10:58 ` Carlos Martin Nieto
2013-10-08 11:29 ` Duy Nguyen
1 sibling, 0 replies; 6+ messages in thread
From: Carlos Martin Nieto @ 2013-10-08 10:58 UTC (permalink / raw)
To: Duy Nguyen; +Cc: Git Mailing List
Duy Nguyen <pclouds@gmail.com> writes:
On Tue, 2013-10-08 at 16:44 +0700, Duy Nguyen wrote:
>On Tue, Oct 8, 2013 at 3:44 PM, Carlos Martín Nieto <cmn@elego.de> wrote:
> > diff --git a/send-pack.c b/send-pack.c
> > index 7d172ef..7b88ac8 100644
> > --- a/send-pack.c
> > +++ b/send-pack.c
> > @@ -205,6 +205,8 @@ int send_pack(struct send_pack_args *args,
> > quiet_supported = 1;
> > if (server_supports("agent"))
> > agent_supported = 1;
> > + if (!server_supports("thin-pack"))
> > + args->use_thin_pack = 0;
>
> Hmm.. I think this introduces a regression in C Git because
> receive-pack never advertises "thin-pack" and so "git push" from now
> on will never send thin packs. It's too late now to add thin-pack to
>
Oh, I'd never noticed that when looking though the network traffic. This seems like something that breaks the compatibility that git otherwise tries so hard to maintain. How did it happen that it's fine for the client to assume that the server supports thin packs?
receive-pack, perhaps a new extension "no-thin-pack" for those
> servers? Alternatively, just run git push --no-thin (you'll need
> f7c815c (push: respect --no-thin - 2013-08-12) though).
>
Yeah, I had an older version in my PATH and was bitten by that when
testing. Having --no-thin and the server's index-pack fail with missing
bases is quite worrying when you're the one who wrote most of the
server-side code.
Having to remember to run 'git push --no-thin' when pushing to one
particular project is pretty bad experience as a user and I was hoping
to avoid this with newer gits. We could advertise a "no-thin-pack"
extension if a patch to support that would be accepted into mainline
git.
Cheers,
cmn
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] send-pack: don't send a thin pack when the server doesn't support it
2013-10-08 9:44 ` Duy Nguyen
2013-10-08 10:58 ` Carlos Martin Nieto
@ 2013-10-08 11:29 ` Duy Nguyen
2013-10-08 22:22 ` Jonathan Nieder
1 sibling, 1 reply; 6+ messages in thread
From: Duy Nguyen @ 2013-10-08 11:29 UTC (permalink / raw)
To: Carlos Martín Nieto; +Cc: Git Mailing List
On Tue, Oct 8, 2013 at 4:44 PM, Duy Nguyen <pclouds@gmail.com> wrote:
> On Tue, Oct 8, 2013 at 3:44 PM, Carlos Martín Nieto <cmn@elego.de> wrote:
>> diff --git a/send-pack.c b/send-pack.c
>> index 7d172ef..7b88ac8 100644
>> --- a/send-pack.c
>> +++ b/send-pack.c
>> @@ -205,6 +205,8 @@ int send_pack(struct send_pack_args *args,
>> quiet_supported = 1;
>> if (server_supports("agent"))
>> agent_supported = 1;
>> + if (!server_supports("thin-pack"))
>> + args->use_thin_pack = 0;
>
> Hmm.. I think this introduces a regression in C Git because
> receive-pack never advertises "thin-pack" and so "git push" from now
> on will never send thin packs. It's too late now to add thin-pack to
> receive-pack
Or maybe it's not that late. How about you go with your patch and add
thin-pack capability to receive-pack too?
When new "git push" is used against old server, thin pack is disabled.
But that's not a big deal (I hope). The difference is traffic
increases a bit more, but cpu consumption on the server side is also a
bit less. Pushes are usually small, unless you do initial push, which
is complete anyway. So a bit more or less does not really matter in
practice.
We could mitigate the regression a bit by checking agent string and
enable thin-pack for those versions even if thin-pack is not
advertises. That goes back to v1.7.12. We may do the same for some
other popular git servers. And this hack is maintained like 3-4 years,
enough time for new versions to be deployed, then removed.
Hmm?
--
Duy
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] send-pack: don't send a thin pack when the server doesn't support it
2013-10-08 11:29 ` Duy Nguyen
@ 2013-10-08 22:22 ` Jonathan Nieder
2013-10-19 15:19 ` Carlos Martín Nieto
0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Nieder @ 2013-10-08 22:22 UTC (permalink / raw)
To: Duy Nguyen; +Cc: Carlos Martín Nieto, Git Mailing List
Duy Nguyen wrote:
> Or maybe it's not that late. How about you go with your patch and add
> thin-pack capability to receive-pack too?
>
> When new "git push" is used against old server, thin pack is disabled.
> But that's not a big deal (I hope).
Could we have separate patches to introduce the server-side capability
and then to request it in the client? That way, people with old
servers can apply the patch introducing the capability if they want.
The new meaning of the "thin-pack" capability should also be
documented in Documentation/technical/protocol-capabilities.txt.
Done that way and with enough time between the server advertising the
capability and the client looking for it, it seems like a good idea.
My two cents,
Jonathan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] send-pack: don't send a thin pack when the server doesn't support it
2013-10-08 22:22 ` Jonathan Nieder
@ 2013-10-19 15:19 ` Carlos Martín Nieto
0 siblings, 0 replies; 6+ messages in thread
From: Carlos Martín Nieto @ 2013-10-19 15:19 UTC (permalink / raw)
To: Jonathan Nieder; +Cc: Duy Nguyen, Git Mailing List
On Tue, 2013-10-08 at 15:22 -0700, Jonathan Nieder wrote:
> Duy Nguyen wrote:
>
> > Or maybe it's not that late. How about you go with your patch and add
> > thin-pack capability to receive-pack too?
> >
> > When new "git push" is used against old server, thin pack is disabled.
> > But that's not a big deal (I hope).
>
> Could we have separate patches to introduce the server-side capability
> and then to request it in the client? That way, people with old
> servers can apply the patch introducing the capability if they want.
That could work.
>
> The new meaning of the "thin-pack" capability should also be
> documented in Documentation/technical/protocol-capabilities.txt.
Oh, right; the capability as described is only about the server being
able to generate a thin pack. Wouldn't his mean that git shouldn't
assume that *any* remote can fix thin packs, though? (other than most
servers you do talk to happen to).
Anyway, facts on the ground and all that. I'll prepare some
>
> Done that way and with enough time between the server advertising the
> capability and the client looking for it, it seems like a good idea.
If such patches would be accepted, that would be great. By the time this
all gets merged, we might have thin pack fixing merged into libgit2, but
there will still be uses where fixing them isn't an issue due to other
constraints.
Cheers,
cmn
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-10-19 15:28 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-08 8:44 [PATCH] send-pack: don't send a thin pack when the server doesn't support it Carlos Martín Nieto
2013-10-08 9:44 ` Duy Nguyen
2013-10-08 10:58 ` Carlos Martin Nieto
2013-10-08 11:29 ` Duy Nguyen
2013-10-08 22:22 ` Jonathan Nieder
2013-10-19 15:19 ` Carlos Martín Nieto
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).