git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Ramkumar Ramachandra <artagnon@gmail.com>
Cc: "Git List" <git@vger.kernel.org>,
	"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: Re: [PATCH 0/3] Remove sq_quote_print() in favor of *_buf
Date: Tue, 30 Jul 2013 08:00:34 -0700	[thread overview]
Message-ID: <7viozsxfcd.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1375173087-2164-1-git-send-email-artagnon@gmail.com> (Ramkumar Ramachandra's message of "Tue, 30 Jul 2013 14:01:24 +0530")

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.

> Nguyễn Thái Ngọc Duy (1):
>   for-each-ref, quote: convert *_quote_print -> *_quote_buf

The log message for this one explains it very well.  This change by
itself is not useful, but it will become necessary once you start
needing to access an in-memory result.

  parent reply	other threads:[~2013-07-30 15:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-30  8:31 [PATCH 0/3] Remove sq_quote_print() in favor of *_buf Ramkumar Ramachandra
2013-07-30  8:31 ` [PATCH 1/3] for-each-ref, quote: convert *_quote_print -> *_quote_buf Ramkumar Ramachandra
2013-07-30  8:31 ` [PATCH 2/3] tar-tree: remove dependency on sq_quote_print() Ramkumar Ramachandra
2013-07-30  8:31 ` [PATCH 3/3] quote: remove sq_quote_print() Ramkumar Ramachandra
2013-07-30 15:00 ` Junio C Hamano [this message]
2013-07-30 15:27   ` [PATCH 0/3] Remove sq_quote_print() in favor of *_buf Junio C Hamano
2013-07-30 23:20     ` Ramkumar Ramachandra

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=7viozsxfcd.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=artagnon@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=pclouds@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.
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).