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

Re: [PATCH] gitweb: Make git_get_refs_list do work of git_get_references

From
Junio C Hamano <junkio@cox.net>
Date
Sep 17, 2006, 02:29 UTC
Message-ID
<7v4pv78btt.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<7vejub8cms.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> writes:
Show 12 quoted lines
> The code I was complaining about tries to do something like
> this:
>
> 	sub that_sub {
>         	...
>                 return wantarray ? (\@bar, \%foo) : \@bar;
> 	}
>
> and it is not done for optimization purposes (i.e. "if the
> caller only wants one and we are returning \@bar then we do not
> have to compute \%foo which is a big win" is not why it does
> this wantarray business).

Note. I did not mean to imply conditional return should be done for performance reasons.

And I do not think the way this conditional return is done serves better DWIMmery, which was my primary complaint. So I should probably have said "It's not for better DWIM, it is not even for better performance, and I do not see a point".

Previous: Randal L. SchwartzNext: Jakub Narebski
Message 7 of 10 in “gitweb: Make git_get_refs_list do work of git_get_references”
  1. gitweb: Make git_get_refs_list do work of git_get_referencesJakub Narebski, Sep 17, 2006
  2. 1/2 gitweb: Always use git-peek-remote in git_get_referencesJakub Narebski, Sep 17, 2006
  3. Junio C HamanoSep 17, 2006
  4. Randal L. SchwartzSep 17, 2006
  5. Junio C HamanoSep 17, 2006
  6. Randal L. SchwartzSep 17, 2006
  7. Junio C HamanoSep 17, 2006
  8. Jakub NarebskiSep 17, 2006
  9. Jakub NarebskiSep 17, 2006
  10. Jakub NarebskiSep 17, 2006

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.