git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Use more strbufs series [on top of next]
@ 2007-09-09  0:04 Pierre Habouzit
  2007-09-09  0:04 ` [PATCH 1/6] Add strbuf_rtrim and strbuf_insert Pierre Habouzit
  2007-09-09  0:12 ` Use more strbufs series [on top of next] Pierre Habouzit
  0 siblings, 2 replies; 9+ messages in thread
From: Pierre Habouzit @ 2007-09-09  0:04 UTC (permalink / raw)
  To: git

  Here is a series of patches on top of next, which use strbufs in even
more places. Most notably, it uses it in the commit pretty printer (and
commit message formatter), and it supersedes definitely read_fd
(previously in sha1_file.c).

  The latter is not strictly speaking necessary, but strbuf_read and
read_fd do almost the same. The sole difference is that read_fd use
custom reallocation mechanisms (which is bad now that strbufs exists)
though had a different semantics when an error occurs. Though, like for
strbuf_read, read_fd callers either die() or discard the buffer, and
current strbuf_read semantics works with that.

  As a result we once again have a nice reduction of the code lines.

  $ git diff --shortstat origin/next strbuf.*
   2 files changed, 24 insertions(+), 0 deletions(-)

  $ git diff --shortstat origin/next ^strbuf.*
   16 files changed, 270 insertions(+), 466 deletions(-)

  I feel that with the current series commit.c can be simplified
further, but the patch was big enough as is already.

  If this series will be rewritten for this or this reason, please note
that I found a memory leak (not a severe one though) in
builtin-archive.c, where the "fmt" pointer is allocated and never freed.

Cheers,

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-09-27 22:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-09  0:04 Use more strbufs series [on top of next] Pierre Habouzit
2007-09-09  0:04 ` [PATCH 1/6] Add strbuf_rtrim and strbuf_insert Pierre Habouzit
2007-09-09  0:04   ` [PATCH 2/6] Change semantics of interpolate to work like snprintf Pierre Habouzit
2007-09-09  0:04     ` [PATCH 3/6] Rework pretty_print_commit to use strbufs instead of custom buffers Pierre Habouzit
2007-09-09  0:04       ` [PATCH 4/6] Use strbuf_read in builtin-fetch-tool.c Pierre Habouzit
2007-09-09  0:04         ` [PATCH 5/6] Use strbufs to in read_message (imap-send.c), custom buffer-- Pierre Habouzit
2007-09-09  0:04           ` [PATCH 6/6] Replace all read_fd use with strbuf_read, and get rid of it Pierre Habouzit
     [not found]       ` <7vsl5nflj2.fsf@gitster.siamese.dyndns.org>
     [not found]         ` <20070910090656.GC3417@artemis.corp>
     [not found]           ` <7vir6isvu1.fsf@gitster.siamese.dyndns.org>
     [not found]             ` <7v642iqumt.fsf@gitster.siamese.dyndns.org>
     [not found]               ` <20070910183256.GD32442@artemis.corp>
2007-09-27 22:56                 ` return void expressions in C (Was: [PATCH 3/6] Rework pretty_print_commit ...) Linus Torvalds
2007-09-09  0:12 ` Use more strbufs series [on top of next] Pierre Habouzit

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).