Re: [PATCH v5 1/2] name-rev: deprecate --stdin in favor of --annotate-stdin
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 5, 2022, 20:07 UTC
- Message-ID
- <xmqqh7aihrpx.fsf@gitster.g>
- In-Reply-To
- <7c5fb10d87c4b807567db0ed83f987487532c7c1.1641356439.git.gitgitgadget@gmail.com>
"John Cai via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 23 quoted lines
> + altogether. > ++ > +For example: > ++ > +-- > + $ cat sample.txt > + > + An abbreviated revision 2ae0a9cb82 will not be substituted. > + The full name after substitution is 2ae0a9cb8298185a94e5998086f380a355dd8907, > + while its tree object is 70d105cc79e63b81cfdcb08a15297c23e60b07ad > + > + $ git name-rev --annotate-stdin <sample.txt > + > + An abbreviated revision 2ae0a9cb82 will not be substituted. > + The full name after substitution is 2ae0a9cb8298185a94e5998086f380a355dd8907 (master), > + while its tree object is 70d105cc79e63b81cfdcb08a15297c23e60b07ad > + > + $ git name-rev --name-only --annotate-stdin <sample.txt > + > + An abbreviated revision 2ae0a9cb82 will not be substituted. > + The full name after substitution is master, > + while its tree object is 70d105cc79e63b81cfdcb08a15297c23e60b07ad > +--
I compared the output from the earlier ones with this one; the way the displayed sample was shown in the previous rounds looked better, at least in HTML pages. The earlier ones used "listingblock" in which the sample is contained in a <pre>formatted <code> block, but this one ends up in a series of one-<div>-per-paragraph.
> - if (transform_stdin) {
> - char buffer[2048];
> + if (annotate_stdin) {
> + struct strbuf sb = STRBUF_INIT;This will break the compilation at this step.