From: Jeff King <peff@peff.net>
To: Christian Couder <christian.couder@gmail.com>
Cc: git <git@vger.kernel.org>, Junio C Hamano <gitster@pobox.com>,
Christian Couder <chriscool@tuxfamily.org>
Subject: Re: [PATCH v2 0/2] Add support for %(contents:size) in ref-filter
Date: Wed, 8 Jul 2020 00:43:47 -0400 [thread overview]
Message-ID: <20200708044347.GB2303891@coredump.intra.peff.net> (raw)
In-Reply-To: <CAP8UFD0gUK4TGUA7JZ_V7hFe4LSDAP7DfPyz4gqy1RjLXJPF2w@mail.gmail.com>
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
prev parent reply other threads:[~2020-07-08 4:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-02 14:08 [PATCH v2 0/2] Add support for %(contents:size) in ref-filter Christian Couder
2020-07-02 14:08 ` [PATCH v2 1/2] Documentation: clarify %(contents:XXXX) doc Christian Couder
2020-07-06 21:34 ` Junio C Hamano
2020-07-02 14:08 ` [PATCH v2 2/2] ref-filter: add support for %(contents:size) Christian Couder
2020-07-06 21:44 ` Junio C Hamano
2020-07-07 8:40 ` Christian Couder
2020-07-07 15:28 ` Junio C Hamano
2020-07-07 5:02 ` [PATCH v2 0/2] Add support for %(contents:size) in ref-filter Jeff King
2020-07-07 6:19 ` Christian Couder
2020-07-08 4:43 ` Jeff King [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200708044347.GB2303891@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=chriscool@tuxfamily.org \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).