Re: [PATCH v2 0/2] Add support for %(contents:size) in ref-filter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 07, 2020 at 08:19:06AM +0200, Christian Couder wrote:

> > I'm still not sure why %(objectsize) isn't sufficient here. Is there
> > some use case that's served by %(contents:size) that it wouldn't work
> > for? Or are we just trying to make it more discoverable when you're
> > looking at the contents already?
> 
> %(objectsize) is the size of the whole commit or tag object, while
> %(contents:size) is the size of the complete message (the whole commit
> message or tag message, including trailers and signatures).

Ah, right, that makes sense.

I'd probably use "git log --no-walk --format=%B" or similar for this,
but there is nothing wrong with using for-each-ref (and it is better if
you really do care about properties of the refs themselves, and not just
the commit they point to).

I do think in the long run it might be nice to have a generic
placeholder for "expand this thing and give me the number of bytes", so
we could do:

  %(sizeof:%(contents))

or even:

  %(sizeof:%(authorname) <%(authoremail)>)

but that is definitely outside the scope. If we end up eventually with
a generic mechanism and have to support contents:size forever for
compatibility, I don't think it is that big a problem.

-Peff



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux