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

Re: [PATCH] Change "refs/" references to symbolic constants

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Oct 3, 2007, 04:05 UTC
Message-ID
<Pine.LNX.4.64.0710030503520.28395@racer.site>
In-Reply-To
<20071003025853.GA11440@coredump.intra.peff.net>
Hi,
On Tue, 2 Oct 2007, Jeff King wrote:
Show 11 quoted lines
> On Tue, Oct 02, 2007 at 05:22:23PM -0700, Junio C Hamano wrote:
> 
> > >   strbuf_init(&url);
> > >   strbuf_addf(&url, "%s/objects/pack/pack-%s.idx", repo->base, hex);
> > 
> > Ugh, this typically calls snprintf() twice doesn't it?
> 
> Yes, it probably does. However, I think it is considerably easier to
> read and more maintainable. Are you "ugh"ing because of the performance
> impact (which should be negligible unless this is in a tight loop) or
> because of the portability problems associated with va_copy?
I wonder, I wonder, if
	strbuf_addstr(&url, repo->base);
	strbuf_addstr(&url, "/objects/pack/pack-");
	strbuf_addstr(&url, hex);
	strbuf_addstr(&url, ".idx");
would make anybody else but me happy...

Ciao, Dscho

Previous: Jeff KingNext: Jeff King
Message 12 of 19 in “Change "refs/" references to symbolic constants”
  1. 1/2 Change "refs/" references to symbolic constantsAndy Parkins, Sep 29, 2007
  2. Andy ParkinsOct 1, 2007
  3. Jeff KingOct 2, 2007
  4. Andy ParkinsOct 2, 2007
  5. Jeff KingOct 2, 2007
  6. Change "refs/" references to symbolic constantsAndy Parkins, Oct 2, 2007
  7. Jeff KingOct 2, 2007
  8. Junio C HamanoOct 2, 2007
  9. Jeff KingOct 2, 2007
  10. Junio C HamanoOct 3, 2007
  11. Jeff KingOct 3, 2007
  12. Johannes SchindelinOct 3, 2007
  13. Jeff KingOct 3, 2007
  14. Andreas EricssonOct 3, 2007
  15. Andy ParkinsOct 3, 2007
  16. Andy ParkinsOct 3, 2007
  17. Andy ParkinsOct 3, 2007
  18. Junio C HamanoOct 2, 2007
  19. Andy ParkinsOct 3, 2007

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.