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

Re: [PATCH] Documentation/githooks: Explain pre-rebase parameters

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 20, 2013, 17:23 UTC
Message-ID
<7vwqu2yk42.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20130220163621.GI14102@odin.tremily.us>
"W. Trevor King" <wking@tremily.us> writes:
> Since $upstream_arg will always be set, would it make sense to change
> the `${1+"$@"}` syntax in run_pre_rebase_hook() to a plain "$@"?

I suspect that there no longer is a need for ${1+"$@"} in today's world even when you do not have arguments, and it certainly is fine if you want to update that particular instance in the function with a single caller that calls it with 1 or 2 arguments, especially if you are updating the code in the vicinity.

I however do not think it is worth blindly replacing them tree-wide just for the sake of changing them. The upside of helping beginning shell programers by possibly better readability does not look great, compared to the downside of possibly breaking somebody who is still on a broken shell that the old idiom is still helping.

Previous: W. Trevor KingNext: W. Trevor King
Message 7 of 11 in “Documentation/githooks: Explain pre-rebase parameters”
  1. Documentation/githooks: Explain pre-rebase parametersW. Trevor King, Feb 19, 2013
  2. Thomas RastFeb 19, 2013
  3. W. Trevor KingFeb 19, 2013
  4. Junio C HamanoFeb 19, 2013
  5. Junio C HamanoFeb 19, 2013
  6. W. Trevor KingFeb 20, 2013
  7. Junio C HamanoFeb 20, 2013
  8. Documentation/githooks: Explain pre-rebase parametersW. Trevor King, Feb 23, 2013
  9. Junio C HamanoFeb 23, 2013
  10. W. Trevor KingFeb 23, 2013
  11. Junio C HamanoFeb 24, 2013

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.