# [PATCH RFC 0/20] cat-file: start using formatting logic from ref-filter

8 messages from 2019-02-22 to 2019-03-03. Participants: Olga Telezhnaya, Eric Sunshine, Jeff King, Junio C Hamano.
Thread: https://gitlist.dev/t/50564

## Olga Telezhnaya, 2019-02-22 15:50

Subject: [PATCH RFC 0/20] cat-file: start using formatting logic from ref-filter
Message-ID: <CAL21BmnVkKtYWa1cRL1EJAwtchGcVUzhu0136AuV8uXAi5Kuew@mail.gmail.com>
URL: https://gitlist.dev/e/CAL21BmnVkKtYWa1cRL1EJAwtchGcVUzhu0136AuV8uXAi5Kuew%40mail.gmail.com

```
Hi everyone,
It was a long way for me, I got older (by 1 year) and smarter
(hopefully), and maybe I will finish my Outreachy Internship task for
now. (I am doing it just for one year and a half, that's OK)

If serious:
In this patch we remove cat-file formatting logic and reuse ref-filter
logic there. As a positive side effect, cat-file now has many new
formatting tokens (all from ref-filter formatting), including deref
(like %(*objectsize:disk)). I have already tried to do this task one
year ago, and it was bad attempt. I feel that today's patch is much
better.

In my opinion, it still has some issues. I mentioned all of them in
TODOs in comments. All of them considered to be separate tasks for
other patches. Some of them sound easy and could be great tasks for
newbies.

I also have a question about site https://git-scm.com/docs/
I thought it is updated automatically based on Documentation folder in
the project, but it is not true. I edited docs for for-each-ref in
December, I still see my patch in master, but for-each-ref docs in
git-csm is outdated. Is it OK?

Thank you!
Olga

```

## Eric Sunshine, 2019-02-22 16:09

Subject: Re: [PATCH RFC 0/20] cat-file: start using formatting logic from ref-filter
Message-ID: <CAPig+cSDtU1pbuzCvNPf+nmwS5LLKPm5RSY7wYxWg=s1e53enw@mail.gmail.com>
URL: https://gitlist.dev/e/CAPig%2BcSDtU1pbuzCvNPf%2BnmwS5LLKPm5RSY7wYxWg%3Ds1e53enw%40mail.gmail.com
In-Reply-To: <CAL21BmnVkKtYWa1cRL1EJAwtchGcVUzhu0136AuV8uXAi5Kuew@mail.gmail.com>

```
On Fri, Feb 22, 2019 at 10:58 AM Olga Telezhnaya
<olyatelezhnaya@gmail.com> wrote:
> I also have a question about site https://git-scm.com/docs/
> I thought it is updated automatically based on Documentation folder in
> the project, but it is not true. I edited docs for for-each-ref in
> December, I still see my patch in master, but for-each-ref docs in
> git-csm is outdated. Is it OK?

If you look at https://git-scm.com/docs/git-for-each-ref, you'll find
a pop-up control at the top of the page which allows you to select
documentation for a particular release of Git (say, 2.19.1). Your
change to git-for-each-ref.txt may be in "master" but is not yet in
any official final release. It will be in 2.21.0, but that release is
still in the RC stage, thus doesn't appear at
https://git-scm.com/docs/git-for-each-ref.

```

## Olga Telezhnaya, 2019-02-22 16:19

Subject: Re: [PATCH RFC 0/20] cat-file: start using formatting logic from ref-filter
Message-ID: <CAL21Bmmwr=F+-sTNFcHxk3kdCE3ahV2eQzTNCDteb=7vZVB2aw@mail.gmail.com>
URL: https://gitlist.dev/e/CAL21Bmmwr%3DF%2B-sTNFcHxk3kdCE3ahV2eQzTNCDteb%3D7vZVB2aw%40mail.gmail.com
In-Reply-To: <CAPig+cSDtU1pbuzCvNPf+nmwS5LLKPm5RSY7wYxWg=s1e53enw@mail.gmail.com>

```
пт, 22 февр. 2019 г. в 19:09, Eric Sunshine <sunshine@sunshineco.com>:
>
> On Fri, Feb 22, 2019 at 10:58 AM Olga Telezhnaya
> <olyatelezhnaya@gmail.com> wrote:
> > I also have a question about site https://git-scm.com/docs/
> > I thought it is updated automatically based on Documentation folder in
> > the project, but it is not true. I edited docs for for-each-ref in
> > December, I still see my patch in master, but for-each-ref docs in
> > git-csm is outdated. Is it OK?
>
> If you look at https://git-scm.com/docs/git-for-each-ref, you'll find
> a pop-up control at the top of the page which allows you to select
> documentation for a particular release of Git (say, 2.19.1). Your
> change to git-for-each-ref.txt may be in "master" but is not yet in
> any official final release. It will be in 2.21.0, but that release is
> still in the RC stage, thus doesn't appear at
> https://git-scm.com/docs/git-for-each-ref.

Oh, thank you, I missed that.

```

## Jeff King, 2019-02-28 21:41

Subject: Re: [PATCH RFC 0/20] cat-file: start using formatting logic from ref-filter
Message-ID: <20190228214112.GK12723@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20190228214112.GK12723%40sigill.intra.peff.net
In-Reply-To: <CAL21BmnVkKtYWa1cRL1EJAwtchGcVUzhu0136AuV8uXAi5Kuew@mail.gmail.com>

```
On Fri, Feb 22, 2019 at 06:50:06PM +0300, Olga Telezhnaya wrote:

> It was a long way for me, I got older (by 1 year) and smarter
> (hopefully), and maybe I will finish my Outreachy Internship task for
> now. (I am doing it just for one year and a half, that's OK)

Welcome back!

Sorry to be a bit slow on the review. I've read through and commented on
patch 10. Some of my comments were "I'll have to see how this plays out
later in the series", so you may want to hold off on responding until I
read the rest. :)

> If serious:
> In this patch we remove cat-file formatting logic and reuse ref-filter
> logic there. As a positive side effect, cat-file now has many new
> formatting tokens (all from ref-filter formatting), including deref
> (like %(*objectsize:disk)). I have already tried to do this task one
> year ago, and it was bad attempt. I feel that today's patch is much
> better.

I'm still concerned that this is going to regress the performance of
cat-file noticeably without some big cleanups in ref-filter. Here are
timings on linux.git before and after your patches:

  [before]
  $ time git cat-file --unordered --batch-all-objects --batch-check >/dev/null
  real	0m16.602s
  user	0m15.545s
  sys	0m0.495s

  [after]
  $ time git cat-file --unordered --batch-all-objects --batch-check >/dev/null
  real	0m27.301s
  user	0m24.549s
  sys	0m2.752s

I don't think that's anything particularly wrong with your patches. It's
the existing strategy of ref-filter (in particular how it is very eager
to allocate lots of separate strings). And it may be too early to switch
cat-file over to it.

> I also have a question about site https://git-scm.com/docs/
> I thought it is updated automatically based on Documentation folder in
> the project, but it is not true. I edited docs for for-each-ref in
> December, I still see my patch in master, but for-each-ref docs in
> git-csm is outdated. Is it OK?

Yeah, as Eric noted, we only build docs for the tagged releases. In
theory it would be easy to just build the tip of master nightly, but the
data model for the site would need quite a bit of adjustment.

-Peff

```

## Jeff King, 2019-02-28 21:43

Subject: Re: [PATCH RFC 0/20] cat-file: start using formatting logic from ref-filter
Message-ID: <20190228214314.GL12723@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20190228214314.GL12723%40sigill.intra.peff.net
In-Reply-To: <CAL21BmnVkKtYWa1cRL1EJAwtchGcVUzhu0136AuV8uXAi5Kuew@mail.gmail.com>

```
On Fri, Feb 22, 2019 at 06:50:06PM +0300, Olga Telezhnaya wrote:

> In my opinion, it still has some issues. I mentioned all of them in
> TODOs in comments. All of them considered to be separate tasks for
> other patches. Some of them sound easy and could be great tasks for
> newbies.

One other thing I forgot to mention: your patches ended up on the list
in jumbled order. How do you send them? Usually `send-email` would add 1
second to the timestamp of each, so that threading mail readers sort
them as you'd expect (even if they arrive out of order due to the
vagaries of SMTP servers).

-Peff

```

## Olga Telezhnaya, 2019-03-01 06:16

Subject: Re: [PATCH RFC 0/20] cat-file: start using formatting logic from ref-filter
Message-ID: <CAL21BmkPL1RDiz6v+=etJhFn3kmTMJKpnQa-qFFR224wFo8ubw@mail.gmail.com>
URL: https://gitlist.dev/e/CAL21BmkPL1RDiz6v%2B%3DetJhFn3kmTMJKpnQa-qFFR224wFo8ubw%40mail.gmail.com
In-Reply-To: <20190228214112.GK12723@sigill.intra.peff.net>

```
пт, 1 мар. 2019 г. в 00:41, Jeff King <peff@peff.net>:
>
> On Fri, Feb 22, 2019 at 06:50:06PM +0300, Olga Telezhnaya wrote:
>
> > It was a long way for me, I got older (by 1 year) and smarter
> > (hopefully), and maybe I will finish my Outreachy Internship task for
> > now. (I am doing it just for one year and a half, that's OK)
>
> Welcome back!
>
> Sorry to be a bit slow on the review. I've read through and commented on
> patch 10. Some of my comments were "I'll have to see how this plays out
> later in the series", so you may want to hold off on responding until I
> read the rest. :)
>
> > If serious:
> > In this patch we remove cat-file formatting logic and reuse ref-filter
> > logic there. As a positive side effect, cat-file now has many new
> > formatting tokens (all from ref-filter formatting), including deref
> > (like %(*objectsize:disk)). I have already tried to do this task one
> > year ago, and it was bad attempt. I feel that today's patch is much
> > better.
>
> I'm still concerned that this is going to regress the performance of
> cat-file noticeably without some big cleanups in ref-filter. Here are
> timings on linux.git before and after your patches:
>
>   [before]
>   $ time git cat-file --unordered --batch-all-objects --batch-check >/dev/null
>   real  0m16.602s
>   user  0m15.545s
>   sys   0m0.495s
>
>   [after]
>   $ time git cat-file --unordered --batch-all-objects --batch-check >/dev/null
>   real  0m27.301s
>   user  0m24.549s
>   sys   0m2.752s
>
> I don't think that's anything particularly wrong with your patches. It's
> the existing strategy of ref-filter (in particular how it is very eager
> to allocate lots of separate strings). And it may be too early to switch
> cat-file over to it.

I have a guess that we need to add batch printing argument to our
general printing functions, that could make my version faster.

>
> > I also have a question about site https://git-scm.com/docs/
> > I thought it is updated automatically based on Documentation folder in
> > the project, but it is not true. I edited docs for for-each-ref in
> > December, I still see my patch in master, but for-each-ref docs in
> > git-csm is outdated. Is it OK?
>
> Yeah, as Eric noted, we only build docs for the tagged releases. In
> theory it would be easy to just build the tip of master nightly, but the
> data model for the site would need quite a bit of adjustment.
>
> -Peff

```

## Olga Telezhnaya, 2019-03-01 06:17

Subject: Re: [PATCH RFC 0/20] cat-file: start using formatting logic from ref-filter
Message-ID: <CAL21Bm=_Ybj+HPU7dq7vpQkev31krapXe=HVN3zXKtY_gU2yJA@mail.gmail.com>
URL: https://gitlist.dev/e/CAL21Bm%3D_Ybj%2BHPU7dq7vpQkev31krapXe%3DHVN3zXKtY_gU2yJA%40mail.gmail.com
In-Reply-To: <20190228214314.GL12723@sigill.intra.peff.net>

```
пт, 1 мар. 2019 г. в 00:43, Jeff King <peff@peff.net>:
>
> On Fri, Feb 22, 2019 at 06:50:06PM +0300, Olga Telezhnaya wrote:
>
> > In my opinion, it still has some issues. I mentioned all of them in
> > TODOs in comments. All of them considered to be separate tasks for
> > other patches. Some of them sound easy and could be great tasks for
> > newbies.
>
> One other thing I forgot to mention: your patches ended up on the list
> in jumbled order. How do you send them? Usually `send-email` would add 1
> second to the timestamp of each, so that threading mail readers sort
> them as you'd expect (even if they arrive out of order due to the
> vagaries of SMTP servers).

Oh, that's one more bug in submitgit, I guess. I will not use it
anymore, OK, it's time to change the habits.

>
> -Peff

```

## Junio C Hamano, 2019-03-03 01:21

Subject: Re: [PATCH RFC 0/20] cat-file: start using formatting logic from ref-filter
Message-ID: <xmqqtvgk4urv.fsf@gitster-ct.c.googlers.com>
URL: https://gitlist.dev/e/xmqqtvgk4urv.fsf%40gitster-ct.c.googlers.com
In-Reply-To: <20190228214314.GL12723@sigill.intra.peff.net>

```
Jeff King <peff@peff.net> writes:

> On Fri, Feb 22, 2019 at 06:50:06PM +0300, Olga Telezhnaya wrote:
>
>> In my opinion, it still has some issues. I mentioned all of them in
>> TODOs in comments. All of them considered to be separate tasks for
>> other patches. Some of them sound easy and could be great tasks for
>> newbies.
>
> One other thing I forgot to mention: your patches ended up on the list
> in jumbled order. How do you send them? Usually `send-email` would add 1
> second to the timestamp of each, so that threading mail readers sort
> them as you'd expect (even if they arrive out of order due to the
> vagaries of SMTP servers).

Yes, the 1 second increment has served us so well in the entire life
of this project, and I am finding a bit irritating that we seem to
be seeing topics that are shown in jumbled order more often.  I'd love
to see why and get them fixed at the source eventually.


```
