Re: [PATCH] negotiator/skipping: skip commits during fetch

2018-08-03 Thread Johannes Schindelin
Hi Jonathan,

On Fri, 27 Jul 2018, Johannes Schindelin wrote:

> On Thu, 26 Jul 2018, Jonathan Tan wrote:
> 
> > > On Mon, 16 Jul 2018, Jonathan Tan wrote:
> > > 
> > > >  t/t5552-skipping-fetch-negotiator.sh | 179 +++
> > > 
> > > This test seems to be failing consistently in the recent `pu` builds:
> > > 
> > > https://git-for-windows.visualstudio.com/git/_build/results?buildId=14337=logs
> > > 
> > > Could you have a look, please?
> > 
> > Hmm...on my Linux computer, this test passes on both pu (as of the time
> > of writing) and 838143aa5c ("Merge branch 'ab/newhash-is-sha256' into
> > pu", 2018-07-25) (pu at the time of that build, according to the website
> > you linked above). If you could rerun that test with additional code,
> > could you add a "cat trace" and show me what the client sends?
> 
> I can give you something even better: a playground. Just open a PR at
> https://github.com/gitgitgadget/git (all of the branches on gitster/git ar
> mirrored, including yours, I am sure, so you can target that branch
> specifically).
> 
> Once you open a Pull Request, it will automatically build and run the test
> suite on Windows, macOS and Linux. You will see it in the "checks" section
> on the bottom. Example for my range-diff series:
> 
> https://git-for-windows.visualstudio.com/git/_build/results?buildId=14279
> 
> For a quicker turnaround, you could add a commit that forces the `all`
> target in `t/Makefile` to run only your test.
> 
> > When I do that, the relevant parts are:
> > 
> >   packet:fetch> have 9ab46928dc282aa09f4dbf96893a252e058e7e8e
> >   packet:fetch> have dc824fafb05f3229aedf1f320bbe572e35364dfe
> >   packet:fetch> have caef059de69917b9119176a11b88afcef769331d
> >   packet:fetch> have 41bd8dc092ee110ba80e350a346ec507ab2e42a0
> >   packet:fetch> have e9a2c092a8e911567a377c881a7f6031e7f892ea
> >   packet:fetch> done
> > 
> > which is exactly as I (and the test) expect.
> > 
> > Two possible reasons for the discrepancy that I can think of offhand are
> > that (1) my computer generates different commits from your test system,
> > and (2) the priority queue pops commits in a different order. For (1),
> > that's not possible because the SHA-1s are the same (as can be seen by
> > comparing your link and the "have" lines I quoted above), and for (2),
> > the code seems OK:
> > 
> >   static int compare(const void *a_, const void *b_, void *unused)
> >   {
> > const struct entry *a = a_;
> > const struct entry *b = b_;
> > return compare_commits_by_commit_date(a->commit, b->commit, NULL);
> >   }
> > 
> > Let me know if you can observe the output of "cat trace" or if you have
> > any other ideas.
> 
> Like I said, you can use those "CI" builds, I think that would be more
> effective than if you waited for me to react, I am quite overwhelmed these
> days.

Hopefully you have a chance to do so. I got the impression that it is
actually more of a flakey test than a consistent test failure:

https://git-for-windows.visualstudio.com/git/_build/results?buildId=15015=logs

Ciao,
Dscho


Re: [PATCH] negotiator/skipping: skip commits during fetch

2018-07-31 Thread Jonathan Tan
> > +fetch.negotiationAlgorithm::
> > +   Control how information about the commits in the local repository is
> > +   sent when negotiating the contents of the packfile to be sent by the
> > +   server. Set to "skipping" to use an algorithm that skips commits in an
> > +   effort to converge faster, but may result in a larger-than-necessary
> > +   packfile; any other value instructs Git to use the default algorithm
> > +   that never skips commits (unless the server has acknowledged it or one
> > +   of its descendants).
> > +
> 
> ...let's instead document that there's just the values "skipping" and
> "default", and say "default" is provided by default, and perhaps change
> the code to warn about anything that isn't those two.
> 
> Then we're not painting ourselves into a corner by needing to break a
> promise in the docs ("any other value instructs Git to use the default")
> if we add a new one of these, and aren't silently falling back on the
> default if we add new-fancy-algo the user's version doesn't know about.

My intention was to allow future versions of Git to introduce more
algorithms, but have older versions of Git still work even if a
repository is configured to use a newer algorithm. But your suggestion
is reasonable too.

> Now, running that "git fetch --all" takes ages, and I know why. It's
> because the in the negotiation for "git fetch some/small-repo" I'm
> emitting hundreds of thousands of "have" lines for SHA1s found in other
> unrelated repos, only to get a NAK for all of them.
> 
> One way to fix that with this facility would be to have some way to pass
> in arguments, similar to what we have for merge drivers, so I can say
> "just emit 'have' lines for stuff found in this branch". The most
> pathological cases are when I'm fetching a remote that has one commit,
> and I'm desperately trying to find something in common by asking if the
> remote has hundreds of K of commits it has no chance of having.
> 
> Or there may be some smarter way to do this, what do you think?

Well, there is already a commit in "next" that does this :-)

3390e42adb ("fetch-pack: support negotiation tip whitelist", 2018-07-03)


Re: [PATCH] negotiator/skipping: skip commits during fetch

2018-07-31 Thread Ævar Arnfjörð Bjarmason


On Mon, Jul 16 2018, Jonathan Tan wrote:

Didn't catch this until this was in next, sorry.

Re-arranged the diff a bit:

> -void fetch_negotiator_init(struct fetch_negotiator *negotiator)
> +void fetch_negotiator_init(struct fetch_negotiator *negotiator,
> +const char *algorithm)
>  {
> + if (algorithm && !strcmp(algorithm, "skipping")) {
> + skipping_negotiator_init(negotiator);
> + return;
> + }
>   default_negotiator_init(negotiator);
>  }

Okey, I understand that's how it works now, but

> +fetch.negotiationAlgorithm::
> + Control how information about the commits in the local repository is
> + sent when negotiating the contents of the packfile to be sent by the
> + server. Set to "skipping" to use an algorithm that skips commits in an
> + effort to converge faster, but may result in a larger-than-necessary
> + packfile; any other value instructs Git to use the default algorithm
> + that never skips commits (unless the server has acknowledged it or one
> + of its descendants).
> +

...let's instead document that there's just the values "skipping" and
"default", and say "default" is provided by default, and perhaps change
the code to warn about anything that isn't those two.

Then we're not painting ourselves into a corner by needing to break a
promise in the docs ("any other value instructs Git to use the default")
if we add a new one of these, and aren't silently falling back on the
default if we add new-fancy-algo the user's version doesn't know about.

Also, switching gears entirely, I'm very excited about this whole thing
because it allows me to address something I've been meaning to get to
for a while.

At work I sometimes want to see what commits I've made to all our git
repos, for remembering what I was doing last February or whatever (this
is for filling in quarterly reports).

So I have this script that basically does this:

for repo in $(get-list-of-all-the-things)
do
git config "remote.$repo.url" g...@git-server.example.com:$repo.git
git config "remote.$repo.fetch" "+HEAD:$repo/HEAD"
git config "remote.$repo.tagOpt" "--no-tags"
done &&
git fetch --all

I.e. for every repo like git/git I'll fetch its upstream HEAD as the
branch git/git/HEAD. Then I can do stuff like:

git shortlog --author=Ævar --since=2018-02-01 --until=2018-03-01

Now, running that "git fetch --all" takes ages, and I know why. It's
because the in the negotiation for "git fetch some/small-repo" I'm
emitting hundreds of thousands of "have" lines for SHA1s found in other
unrelated repos, only to get a NAK for all of them.

One way to fix that with this facility would be to have some way to pass
in arguments, similar to what we have for merge drivers, so I can say
"just emit 'have' lines for stuff found in this branch". The most
pathological cases are when I'm fetching a remote that has one commit,
and I'm desperately trying to find something in common by asking if the
remote has hundreds of K of commits it has no chance of having.

Or there may be some smarter way to do this, what do you think?


Re: [PATCH] negotiator/skipping: skip commits during fetch

2018-07-27 Thread Johannes Schindelin
Hi Jonathan,

On Thu, 26 Jul 2018, Jonathan Tan wrote:

> > On Mon, 16 Jul 2018, Jonathan Tan wrote:
> > 
> > >  t/t5552-skipping-fetch-negotiator.sh | 179 +++
> > 
> > This test seems to be failing consistently in the recent `pu` builds:
> > 
> > https://git-for-windows.visualstudio.com/git/_build/results?buildId=14337=logs
> > 
> > Could you have a look, please?
> 
> Hmm...on my Linux computer, this test passes on both pu (as of the time
> of writing) and 838143aa5c ("Merge branch 'ab/newhash-is-sha256' into
> pu", 2018-07-25) (pu at the time of that build, according to the website
> you linked above). If you could rerun that test with additional code,
> could you add a "cat trace" and show me what the client sends?

I can give you something even better: a playground. Just open a PR at
https://github.com/gitgitgadget/git (all of the branches on gitster/git ar
mirrored, including yours, I am sure, so you can target that branch
specifically).

Once you open a Pull Request, it will automatically build and run the test
suite on Windows, macOS and Linux. You will see it in the "checks" section
on the bottom. Example for my range-diff series:

https://git-for-windows.visualstudio.com/git/_build/results?buildId=14279

For a quicker turnaround, you could add a commit that forces the `all`
target in `t/Makefile` to run only your test.

> When I do that, the relevant parts are:
> 
>   packet:fetch> have 9ab46928dc282aa09f4dbf96893a252e058e7e8e
>   packet:fetch> have dc824fafb05f3229aedf1f320bbe572e35364dfe
>   packet:fetch> have caef059de69917b9119176a11b88afcef769331d
>   packet:fetch> have 41bd8dc092ee110ba80e350a346ec507ab2e42a0
>   packet:fetch> have e9a2c092a8e911567a377c881a7f6031e7f892ea
>   packet:fetch> done
> 
> which is exactly as I (and the test) expect.
> 
> Two possible reasons for the discrepancy that I can think of offhand are
> that (1) my computer generates different commits from your test system,
> and (2) the priority queue pops commits in a different order. For (1),
> that's not possible because the SHA-1s are the same (as can be seen by
> comparing your link and the "have" lines I quoted above), and for (2),
> the code seems OK:
> 
>   static int compare(const void *a_, const void *b_, void *unused)
>   {
>   const struct entry *a = a_;
>   const struct entry *b = b_;
>   return compare_commits_by_commit_date(a->commit, b->commit, NULL);
>   }
> 
> Let me know if you can observe the output of "cat trace" or if you have
> any other ideas.

Like I said, you can use those "CI" builds, I think that would be more
effective than if you waited for me to react, I am quite overwhelmed these
days.

Ciao,
Dscho


Re: [PATCH] negotiator/skipping: skip commits during fetch

2018-07-26 Thread Jonathan Tan
> Hi Jonathan,
> 
> On Mon, 16 Jul 2018, Jonathan Tan wrote:
> 
> >  t/t5552-skipping-fetch-negotiator.sh | 179 +++
> 
> This test seems to be failing consistently in the recent `pu` builds:
> 
> https://git-for-windows.visualstudio.com/git/_build/results?buildId=14337=logs
> 
> Could you have a look, please?

Hmm...on my Linux computer, this test passes on both pu (as of the time
of writing) and 838143aa5c ("Merge branch 'ab/newhash-is-sha256' into
pu", 2018-07-25) (pu at the time of that build, according to the website
you linked above). If you could rerun that test with additional code,
could you add a "cat trace" and show me what the client sends? When I do
that, the relevant parts are:

  packet:fetch> have 9ab46928dc282aa09f4dbf96893a252e058e7e8e
  packet:fetch> have dc824fafb05f3229aedf1f320bbe572e35364dfe
  packet:fetch> have caef059de69917b9119176a11b88afcef769331d
  packet:fetch> have 41bd8dc092ee110ba80e350a346ec507ab2e42a0
  packet:fetch> have e9a2c092a8e911567a377c881a7f6031e7f892ea
  packet:fetch> done

which is exactly as I (and the test) expect.

Two possible reasons for the discrepancy that I can think of offhand are
that (1) my computer generates different commits from your test system,
and (2) the priority queue pops commits in a different order. For (1),
that's not possible because the SHA-1s are the same (as can be seen by
comparing your link and the "have" lines I quoted above), and for (2),
the code seems OK:

  static int compare(const void *a_, const void *b_, void *unused)
  {
const struct entry *a = a_;
const struct entry *b = b_;
return compare_commits_by_commit_date(a->commit, b->commit, NULL);
  }

Let me know if you can observe the output of "cat trace" or if you have
any other ideas.


Re: [PATCH] negotiator/skipping: skip commits during fetch

2018-07-26 Thread Johannes Schindelin
Hi Jonathan,

On Thu, 26 Jul 2018, Johannes Schindelin wrote:

> On Mon, 16 Jul 2018, Jonathan Tan wrote:
> 
> >  t/t5552-skipping-fetch-negotiator.sh | 179 +++
> 
> This test seems to be failing consistently in the recent `pu` builds:
> 
> https://git-for-windows.visualstudio.com/git/_build/results?buildId=14337=logs

It now also causes `next` builds to fail:

https://git-for-windows.visualstudio.com/git/_build/results?buildId=14345=logs

Please have a look,
Dscho

> Could you have a look, please?
> 
> Ciao,
> Dscho
> 
> P.S.: For your convenience, I will paste the last part of the output with
> `-i -v -x` here:
> 
> -- snipsnap --
> 2018-07-26T08:18:39.7864833Z expecting success: 
> 2018-07-26T08:18:39.7868553Z  rm -rf server client trace &&
> 2018-07-26T08:18:39.7869403Z  git init server &&
> 2018-07-26T08:18:39.7869606Z  test_commit -C server to_fetch &&
> 2018-07-26T08:18:39.7870066Z 
> 2018-07-26T08:18:39.7870281Z  git init client &&
> 2018-07-26T08:18:39.7870403Z 
> 2018-07-26T08:18:39.7870579Z  # 2 regular commits
> 2018-07-26T08:18:39.7870779Z  test_tick=20 &&
> 2018-07-26T08:18:39.7870943Z  test_commit -C client c1 &&
> 2018-07-26T08:18:39.7871103Z  test_commit -C client c2 &&
> 2018-07-26T08:18:39.7871228Z 
> 2018-07-26T08:18:39.7871419Z  # 4 old commits
> 2018-07-26T08:18:39.7871575Z  test_tick=10 &&
> 2018-07-26T08:18:39.7871734Z  git -C client checkout c1 &&
> 2018-07-26T08:18:39.7871916Z  test_commit -C client old1 &&
> 2018-07-26T08:18:39.7872081Z  test_commit -C client old2 &&
> 2018-07-26T08:18:39.7872396Z  test_commit -C client old3 &&
> 2018-07-26T08:18:39.7872598Z  test_commit -C client old4 &&
> 2018-07-26T08:18:39.7872743Z 
> 2018-07-26T08:18:39.7872918Z  # "c2" and "c1" are popped first, then "old4" 
> to "old1". "old1" would
> 2018-07-26T08:18:39.7873114Z  # normally be skipped, but is treated as a 
> commit without a parent here
> 2018-07-26T08:18:39.7873329Z  # and sent, because (due to clock skew) its 
> only parent has already been
> 2018-07-26T08:18:39.7873524Z  # popped off the priority queue.
> 2018-07-26T08:18:39.7873700Z  test_config -C client 
> fetch.negotiationalgorithm skipping &&
> 2018-07-26T08:18:39.7873908Z  GIT_TRACE_PACKET="$(pwd)/trace" git -C client 
> fetch "$(pwd)/server" &&
> 2018-07-26T08:18:39.7874091Z  have_sent c2 c1 old4 old2 old1 &&
> 2018-07-26T08:18:39.7874262Z  have_not_sent old3
> 2018-07-26T08:18:39.7874383Z 
> 2018-07-26T08:18:39.8353323Z ++ rm -rf server client trace
> 2018-07-26T08:18:40.3404166Z ++ git init server
> 2018-07-26T08:18:40.3756394Z Initialized empty Git repository in 
> D:/a/1/s/t/trash directory.t5552-skipping-fetch-negotiator/server/.git/
> 2018-07-26T08:18:40.3769512Z ++ test_commit -C server to_fetch
> 2018-07-26T08:18:40.3776271Z ++ notick=
> 2018-07-26T08:18:40.3777103Z ++ signoff=
> 2018-07-26T08:18:40.3777282Z ++ indir=
> 2018-07-26T08:18:40.3777465Z ++ test 3 '!=' 0
> 2018-07-26T08:18:40.3777648Z ++ case "$1" in
> 2018-07-26T08:18:40.3777801Z ++ indir=server
> 2018-07-26T08:18:40.3777948Z ++ shift
> 2018-07-26T08:18:40.3778093Z ++ shift
> 2018-07-26T08:18:40.3778493Z ++ test 1 '!=' 0
> 2018-07-26T08:18:40.3778921Z ++ case "$1" in
> 2018-07-26T08:18:40.3779072Z ++ break
> 2018-07-26T08:18:40.3779241Z ++ indir=server/
> 2018-07-26T08:18:40.3779431Z ++ file=to_fetch.t
> 2018-07-26T08:18:40.3779603Z ++ echo to_fetch
> 2018-07-26T08:18:40.3779923Z ++ git -C server/ add to_fetch.t
> 2018-07-26T08:18:40.4072248Z ++ test -z ''
> 2018-07-26T08:18:40.4072727Z ++ test_tick
> 2018-07-26T08:18:40.4072948Z ++ test -z set
> 2018-07-26T08:18:40.4073113Z ++ test_tick=1112913673
> 2018-07-26T08:18:40.4073758Z ++ GIT_COMMITTER_DATE='1112913673 -0700'
> 2018-07-26T08:18:40.4074001Z ++ GIT_AUTHOR_DATE='1112913673 -0700'
> 2018-07-26T08:18:40.4074178Z ++ export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
> 2018-07-26T08:18:40.4074357Z ++ git -C server/ commit -m to_fetch
> 2018-07-26T08:18:40.4485364Z [master (root-commit) ff85695] to_fetch
> 2018-07-26T08:18:40.4485997Z  Author: A U Thor 
> 2018-07-26T08:18:40.4486201Z  1 file changed, 1 insertion(+)
> 2018-07-26T08:18:40.4486414Z  create mode 100644 to_fetch.t
> 2018-07-26T08:18:40.4499970Z ++ git -C server/ tag to_fetch
> 2018-07-26T08:18:40.4809208Z ++ git init client
> 2018-07-26T08:18:40.5139949Z Initialized empty Git repository in 
> D:/a/1/s/t/trash directory.t5552-skipping-fetch-negotiator/client/.git/
> 2018-07-26T08:18:40.5158270Z ++ test_tick=20
> 2018-07-26T08:18:40.5158466Z ++ test_commit -C client c1
> 2018-07-26T08:18:40.5159077Z ++ notick=
> 2018-07-26T08:18:40.5159492Z ++ signoff=
> 2018-07-26T08:18:40.5159697Z ++ indir=
> 2018-07-26T08:18:40.5159855Z ++ test 3 '!=' 0
> 2018-07-26T08:18:40.5160010Z ++ case "$1" in
> 2018-07-26T08:18:40.5160209Z ++ indir=client
> 2018-07-26T08:18:40.5160362Z ++ shift
> 2018-07-26T08:18:40.5160507Z ++ shift
> 2018-07-26T08:18:40.5160657Z ++ test 1 '!=' 0
> 2018-07-26T08:18:40.5160831Z ++ case "$1" in
> 

Re: [PATCH] negotiator/skipping: skip commits during fetch

2018-07-26 Thread Johannes Schindelin
Hi Jonathan,

On Mon, 16 Jul 2018, Jonathan Tan wrote:

>  t/t5552-skipping-fetch-negotiator.sh | 179 +++

This test seems to be failing consistently in the recent `pu` builds:

https://git-for-windows.visualstudio.com/git/_build/results?buildId=14337=logs

Could you have a look, please?

Ciao,
Dscho

P.S.: For your convenience, I will paste the last part of the output with
`-i -v -x` here:

-- snipsnap --
2018-07-26T08:18:39.7864833Z expecting success: 
2018-07-26T08:18:39.7868553Zrm -rf server client trace &&
2018-07-26T08:18:39.7869403Zgit init server &&
2018-07-26T08:18:39.7869606Ztest_commit -C server to_fetch &&
2018-07-26T08:18:39.7870066Z 
2018-07-26T08:18:39.7870281Zgit init client &&
2018-07-26T08:18:39.7870403Z 
2018-07-26T08:18:39.7870579Z# 2 regular commits
2018-07-26T08:18:39.7870779Ztest_tick=20 &&
2018-07-26T08:18:39.7870943Ztest_commit -C client c1 &&
2018-07-26T08:18:39.7871103Ztest_commit -C client c2 &&
2018-07-26T08:18:39.7871228Z 
2018-07-26T08:18:39.7871419Z# 4 old commits
2018-07-26T08:18:39.7871575Ztest_tick=10 &&
2018-07-26T08:18:39.7871734Zgit -C client checkout c1 &&
2018-07-26T08:18:39.7871916Ztest_commit -C client old1 &&
2018-07-26T08:18:39.7872081Ztest_commit -C client old2 &&
2018-07-26T08:18:39.7872396Ztest_commit -C client old3 &&
2018-07-26T08:18:39.7872598Ztest_commit -C client old4 &&
2018-07-26T08:18:39.7872743Z 
2018-07-26T08:18:39.7872918Z# "c2" and "c1" are popped first, then "old4" 
to "old1". "old1" would
2018-07-26T08:18:39.7873114Z# normally be skipped, but is treated as a 
commit without a parent here
2018-07-26T08:18:39.7873329Z# and sent, because (due to clock skew) its 
only parent has already been
2018-07-26T08:18:39.7873524Z# popped off the priority queue.
2018-07-26T08:18:39.7873700Ztest_config -C client 
fetch.negotiationalgorithm skipping &&
2018-07-26T08:18:39.7873908ZGIT_TRACE_PACKET="$(pwd)/trace" git -C client 
fetch "$(pwd)/server" &&
2018-07-26T08:18:39.7874091Zhave_sent c2 c1 old4 old2 old1 &&
2018-07-26T08:18:39.7874262Zhave_not_sent old3
2018-07-26T08:18:39.7874383Z 
2018-07-26T08:18:39.8353323Z ++ rm -rf server client trace
2018-07-26T08:18:40.3404166Z ++ git init server
2018-07-26T08:18:40.3756394Z Initialized empty Git repository in 
D:/a/1/s/t/trash directory.t5552-skipping-fetch-negotiator/server/.git/
2018-07-26T08:18:40.3769512Z ++ test_commit -C server to_fetch
2018-07-26T08:18:40.3776271Z ++ notick=
2018-07-26T08:18:40.3777103Z ++ signoff=
2018-07-26T08:18:40.3777282Z ++ indir=
2018-07-26T08:18:40.3777465Z ++ test 3 '!=' 0
2018-07-26T08:18:40.3777648Z ++ case "$1" in
2018-07-26T08:18:40.3777801Z ++ indir=server
2018-07-26T08:18:40.3777948Z ++ shift
2018-07-26T08:18:40.3778093Z ++ shift
2018-07-26T08:18:40.3778493Z ++ test 1 '!=' 0
2018-07-26T08:18:40.3778921Z ++ case "$1" in
2018-07-26T08:18:40.3779072Z ++ break
2018-07-26T08:18:40.3779241Z ++ indir=server/
2018-07-26T08:18:40.3779431Z ++ file=to_fetch.t
2018-07-26T08:18:40.3779603Z ++ echo to_fetch
2018-07-26T08:18:40.3779923Z ++ git -C server/ add to_fetch.t
2018-07-26T08:18:40.4072248Z ++ test -z ''
2018-07-26T08:18:40.4072727Z ++ test_tick
2018-07-26T08:18:40.4072948Z ++ test -z set
2018-07-26T08:18:40.4073113Z ++ test_tick=1112913673
2018-07-26T08:18:40.4073758Z ++ GIT_COMMITTER_DATE='1112913673 -0700'
2018-07-26T08:18:40.4074001Z ++ GIT_AUTHOR_DATE='1112913673 -0700'
2018-07-26T08:18:40.4074178Z ++ export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
2018-07-26T08:18:40.4074357Z ++ git -C server/ commit -m to_fetch
2018-07-26T08:18:40.4485364Z [master (root-commit) ff85695] to_fetch
2018-07-26T08:18:40.4485997Z  Author: A U Thor 
2018-07-26T08:18:40.4486201Z  1 file changed, 1 insertion(+)
2018-07-26T08:18:40.4486414Z  create mode 100644 to_fetch.t
2018-07-26T08:18:40.4499970Z ++ git -C server/ tag to_fetch
2018-07-26T08:18:40.4809208Z ++ git init client
2018-07-26T08:18:40.5139949Z Initialized empty Git repository in 
D:/a/1/s/t/trash directory.t5552-skipping-fetch-negotiator/client/.git/
2018-07-26T08:18:40.5158270Z ++ test_tick=20
2018-07-26T08:18:40.5158466Z ++ test_commit -C client c1
2018-07-26T08:18:40.5159077Z ++ notick=
2018-07-26T08:18:40.5159492Z ++ signoff=
2018-07-26T08:18:40.5159697Z ++ indir=
2018-07-26T08:18:40.5159855Z ++ test 3 '!=' 0
2018-07-26T08:18:40.5160010Z ++ case "$1" in
2018-07-26T08:18:40.5160209Z ++ indir=client
2018-07-26T08:18:40.5160362Z ++ shift
2018-07-26T08:18:40.5160507Z ++ shift
2018-07-26T08:18:40.5160657Z ++ test 1 '!=' 0
2018-07-26T08:18:40.5160831Z ++ case "$1" in
2018-07-26T08:18:40.5161289Z ++ break
2018-07-26T08:18:40.5161582Z ++ indir=client/
2018-07-26T08:18:40.5161764Z ++ file=c1.t
2018-07-26T08:18:40.5161916Z ++ echo c1
2018-07-26T08:18:40.5162231Z ++ git -C client/ add c1.t
2018-07-26T08:18:40.5456318Z ++ test -z ''
2018-07-26T08:18:40.5460548Z ++ test_tick
2018-07-26T08:18:40.5461417Z ++ test -z set

Re: [PATCH] negotiator/skipping: skip commits during fetch

2018-07-16 Thread Junio C Hamano
Jonathan Tan  writes:

> Introduce a new negotiation algorithm used during fetch that skips
> commits in an effort to find common ancestors faster. The skips grow
> similarly to the Fibonacci sequence as the commit walk proceeds further
> away from the tips. The skips may cause unnecessary commits to be
> included in the packfile, but the negotiation step typically ends more
> quickly.
>
> Usage of this algorithm is guarded behind the configuration flag
> fetch.negotiationAlgorithm.
>
> Signed-off-by: Jonathan Tan 
> ---
> This is on jt/fetch-pack-negotiator, but also applies cleanly on
> jt/fetch-nego-tip.

Sounds sensible.

Unfortunately, this one is among many others that get hurt by
needless semantic conflicts caused by reusing the old function name
and changing the function signature to pass the_repository thru some
codepaths, without adding transition macros.  I am running out of
time today as I need some post-office-move clean-ups before getting
organized enough, so I expect I won't be able to clean it up and
push it out on 'pu' by the end of day today.

Thanks.