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

Re: [PATCH (take 3)] gitweb: Use git-show-ref instead of git-peek-remote

From
Junio C Hamano <junkio@cox.net>
Date
Nov 25, 2006, 10:42 UTC
Message-ID
<7v7ixj3izw.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<11644507284105-git-send-email-jnareb@gmail.com>
Jakub Narebski <jnareb@gmail.com> writes:
> While at it make git_get_references return hash in list context,
> and reference to hash (as it used to do) in scalar and void contexts.

Why did you have to add this? Generally, context sensitive returns make the program much harder to maintain, because it forces the call sites to be extremely careful to choose between "my ($foo) = func()" vs "my $foo = func()", and people who later call the function inevitably make mistakes.

So unless there is a compelling reason, I'd rather not see more "wantarray" in the program.

Previous: Jakub NarebskiNext: Jakub Narebski
Message 7 of 8 in “gitweb: Use git-show-ref instead of git-peek-remote”
  1. gitweb: Use git-show-ref instead of git-peek-remoteJakub Narebski, Nov 24, 2006
  2. Junio C HamanoNov 24, 2006
  3. Jakub NarebskiNov 24, 2006
  4. gitweb: Use git-show-ref instead of git-peek-remoteJakub Narebski, Nov 25, 2006
  5. Jakub NarebskiNov 25, 2006
  6. gitweb: Use git-show-ref instead of git-peek-remoteJakub Narebski, Nov 25, 2006
  7. Junio C HamanoNov 25, 2006
  8. Jakub NarebskiNov 25, 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.