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

Re: [PATCH] merge: default to @{upstream}

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Jan 28, 2011, 18:46 UTC
Message-ID
<AANLkTi=iMJv+Jtj8YdYhQ_sxu+jBht5YqvSnkS2LUerz@mail.gmail.com>
In-Reply-To
<20110128175609.GA27118@burratino>
On Fri, Jan 28, 2011 at 7:56 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
> Other nits: documentation?  tests?  The rest of cmd_merge does not
> rely on argv[argc] being NULL, but it might make sense to set argv[1]
> to NULL anyway for futureproofing.

Sure, I need to add documentation and tests. I should probably have sent this as 'RFC'.

Anyway, I don't think we can set argv[1] to NULL, because it's possible that this is "char *argv[1]", so that would crash. The only thing the standard ensures, is that the last one would be NULL, so argv[argc] = NULL, and therefore we can override it, as long as the rest of the code checks for argc instead of NULL, which AFAIK in the whole git code it is the case, and certainly in builtin_merge.c AFAICS.

Cheers.
-- 
Felipe Contreras
Previous: Jonathan NiederNext: Jonathan Nieder
Message 5 of 9 in “merge: default to @{upstream}”
  1. merge: default to @{upstream}Felipe Contreras, Jan 28, 2011
  2. Drew NorthupJan 28, 2011
  3. Felipe ContrerasJan 28, 2011
  4. Jonathan NiederJan 28, 2011
  5. Felipe ContrerasJan 28, 2011
  6. Jonathan NiederJan 30, 2011
  7. Bert WesargJan 28, 2011
  8. Martin von ZweigbergkJan 28, 2011
  9. Miles BaderJan 31, 2011

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.