From: Junio C Hamano Date: Wed, 05 Jan 2022 20:07:06 GMT Subject: Re: [PATCH v5 1/2] name-rev: deprecate --stdin in favor of --annotate-stdin Message-ID: In-Reply-To: <7c5fb10d87c4b807567db0ed83f987487532c7c1.1641356439.git.gitgitgadget@gmail.com> "John Cai via GitGitGadget" writes: > + 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 + > + 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 + > + 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
formatted  block, but
this one ends up in a series of one-
-per-paragraph. > - if (transform_stdin) { > - char buffer[2048]; > + if (annotate_stdin) { > + struct strbuf sb = STRBUF_INIT; This will break the compilation at this step.