From: Junio C Hamano <gitster@pobox.com>
To: "ZheNing Hu via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org,
Christian Couder <christian.couder@gmail.com>,
Hariom Verma <hariom18599@gmail.com>,
Karthik Nayak <karthik.188@gmail.com>,
ZheNing Hu <adlternative@gmail.com>
Subject: Re: [PATCH 2/3] [GSOC] ref-filter: support %(contents) for blob, tree
Date: Tue, 25 May 2021 14:47:54 +0900 [thread overview]
Message-ID: <xmqqa6ojgy9h.fsf@gitster.g> (raw)
In-Reply-To: <xmqqfsybh0bn.fsf@gitster.g> (Junio C. Hamano's message of "Tue, 25 May 2021 14:03:24 +0900")
Junio C Hamano <gitster@pobox.com> writes:
> As I already said, I do not think %(contents) mixes well with this
> use for trees and blobs where you give the raw bytes, since
> %(contents) for commit and tag objects was never about the full byte
> sequence of the object. It was to give the unstructured part meant
> for human consumption, stripping the structured "header" part of the
> object.
To extend on this point a bit (even though this is not all that
urgent during the prerelease freeze), conceptually, the %(content)
field is understood in the larger picture like this:
+--- (the whole thing) ----------------------------------------------+
| |
| +--- "header" ---------------------------------------------------+ |
| | tree 678c03dca0a26afd746e8c8bb9e4aadc8bf479b1 | |
| | parent 378c7c6ad48c4ccddf9b534616a0e86f28440bd3 | |
| | author Junio C Hamano <gitster@pobox.com> 1621675665 +0900 | |
| | committer Junio C Hamano <gitster@pobox.com> 1621675741 +0900 | |
| +----------------------------------------------------------------+ |
| |
| +--- "contents" -------------------------------------------------+ |
| | | |
| | +--- "subject" ----------------------------------------------+ | |
| | | Git 2.32-rc1 | | |
| | +------------------------------------------------------------+ | |
| | | |
| | +--- "body" -------------------------------------------------+ | |
| | | Signed-off-by: Junio C Hamano <gitster@pobox.com> | | |
| | +------------------------------------------------------------+ | |
| | | |
| +----------------------------------------------------------------+ |
| |
+--------------------------------------------------------------------+
Even though %(header), when it is invented, would make perfect sense
for commits and tags, it will never make sense for trees and blobs.
Which means "contents", which is "the whole thing except for the
header part", would not, either.
There is no %(placeholder) to ask for "the whole thing", and that is
what you want to use for cat-file --batch if I am not mistaken, and
adding one would be a good idea. There is no %(header) yet, either,
but if somebody needs it for their scripts, it is clear where it fits
in the picture.
next prev parent reply other threads:[~2021-05-25 5:48 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-23 9:53 [PATCH 0/3] [GSOC][RFC] ref-filter: add contents:raw atom ZheNing Hu via GitGitGadget
2021-05-23 9:53 ` [PATCH 1/3] [GSOC] quote: add *.quote_buf_with_size functions ZheNing Hu via GitGitGadget
2021-05-23 9:53 ` [PATCH 2/3] [GSOC] ref-filter: support %(contents) for blob, tree ZheNing Hu via GitGitGadget
2021-05-25 5:03 ` Junio C Hamano
2021-05-25 5:47 ` Junio C Hamano [this message]
2021-05-25 9:28 ` ZheNing Hu
2021-05-25 17:11 ` Junio C Hamano
2021-05-26 7:48 ` ZheNing Hu
2021-05-23 9:53 ` [PATCH 3/3] [GSOC] ref-filter: add contents:raw atom ZheNing Hu via GitGitGadget
2021-05-24 1:09 ` [PATCH 0/3] [GSOC][RFC] " Junio C Hamano
2021-05-24 2:41 ` Felipe Contreras
2021-05-24 5:22 ` Bagas Sanjaya
2021-05-24 15:21 ` Junio C Hamano
2021-05-24 13:09 ` ZheNing Hu
2021-05-26 0:56 ` Junio C Hamano
2021-05-26 6:45 ` ZheNing Hu
2021-05-26 7:06 ` Junio C Hamano
2021-05-26 9:17 ` ZheNing Hu
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqa6ojgy9h.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=adlternative@gmail.com \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=hariom18599@gmail.com \
--cc=karthik.188@gmail.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.
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 NNTP newsgroup(s).