threads / rfc / 50564

RFC patch, 20 partscat-file: start using formatting logic from ref-filter

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

## tl;dr

8 messages between Feb 22, 2019 and Mar 3, 2019. Diffs are folded; open one to read it.

replies: 7people: 4as markdown or json

Olga Telezhnaya· Feb 22, 2019, 15:50 UTC · lore

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· Feb 22, 2019, 16:09 UTC · re: Olga Telezhnaya · lore

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

On Fri, Feb 22, 2019 at 10:58 AM Olga Telezhnaya <olyatelezhnaya@gmail.com> wrote:

Show 5 quoted lines
> 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· Feb 22, 2019, 16:19 UTC · re: Eric Sunshine · lore

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

пт, 22 февр. 2019 г. в 19:09, Eric Sunshine <sunshine@sunshineco.com>:
Show 16 quoted lines
>
> 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· Feb 28, 2019, 21:41 UTC · re: Olga Telezhnaya · lore

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

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

Show 7 quoted lines
> 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.

Show 5 quoted lines
> 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· Mar 1, 2019, 06:16 UTC · re: Jeff King · lore

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

пт, 1 мар. 2019 г. в 00:41, Jeff King <peff@peff.net>:
Show 42 quoted lines
>
> 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.

Show 12 quoted lines
>
> > 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· Feb 28, 2019, 21:43 UTC · re: Olga Telezhnaya · lore

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

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· Mar 1, 2019, 06:17 UTC · re: Jeff King · lore

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

пт, 1 мар. 2019 г. в 00:43, Jeff King <peff@peff.net>:
Show 13 quoted lines
>
> 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· Mar 3, 2019, 01:21 UTC · re: Jeff King · lore

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

Jeff King <peff@peff.net> writes:
Show 12 quoted lines
> 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.

← back to recent threads