git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 0/3] Remove sq_quote_print() in favor of *_buf

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 30, 2013, 15:27 UTC
Message-ID
<7va9l4xe3k.fsf@alter.siamese.dyndns.org>
In-Reply-To
<7viozsxfcd.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 18 quoted lines
> Ramkumar Ramachandra <artagnon@gmail.com> writes:
>
>> While going through the for-each-ref-pretty series that Duy and I were
>> developing, I noticed that this cleanup was independent and good
>> as-it-is.
>>
>> So here it is.
>
> You always can first allocate a piece of memory and write into it
> instead of writing things out directly.  The patch shows it _can_ be
> done, but that is not a news.
>
> And such a change is hardly a "clean-up".  It just wastes more
> memory you do not have to waste, in order to do what you are doing.
>
> When there is a reason why you need an in-memory representation,
> this change starts to become the first step refactoring for an
> enhancement.

Having said all that, the patch texts all look OK, so I'll queue them with updated log messages. It was the usual me reacting to unjustified value judgement made in log messages and cover letters.

It would save me a lot of work if people stopped doing that and instead stuck to facts. For example, between print_to_buf() and print_to_stdout(), the former is *not* necessarily "nicer". It is more flexible but that flexibility comes with a price, and the caller needs a demonstrative need for that flexibility to justify the cost.

Thanks.
Previous: Junio C HamanoNext: Ramkumar Ramachandra
Message 6 of 7 in “Remove sq_quote_print() in favor of *_buf”
  1. 0/3 Remove sq_quote_print() in favor of *_bufRamkumar Ramachandra, Jul 30, 2013
  2. 1/3 for-each-ref, quote: convert *_quote_print -> *_quote_bufRamkumar Ramachandra, Jul 30, 2013
  3. 2/3 tar-tree: remove dependency on sq_quote_print()Ramkumar Ramachandra, Jul 30, 2013
  4. 3/3 quote: remove sq_quote_print()Ramkumar Ramachandra, Jul 30, 2013
  5. Junio C HamanoJul 30, 2013
  6. Junio C HamanoJul 30, 2013
  7. Ramkumar RamachandraJul 30, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.