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

Re: [PATCH] mergetool: Provide an empty file when no base exists

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 20, 2012, 07:22 UTC
Message-ID
<7v7h0mhm8g.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1327043453-80965-1-git-send-email-davvid@gmail.com>
David Aguilar <davvid@gmail.com> writes:
> +    if base_present; then
> +	checkout_staged_file 1 "$MERGED" "$BASE"
> +    else
> +	:>"$BASE"
Just a style, but please write this as either one of the following:
	>"$BASE"
        : >"$BASE"

I tend to prefer the former, but if you have to write a command, we want to see a SP before the redirection (and no SP before the redirect target).

> +    fi
>      local_present  && checkout_staged_file 2 "$MERGED" "$LOCAL"
>      remote_present && checkout_staged_file 3 "$MERGED" "$REMOTE"

Sorry to be ping-pong-ing like this, but wouldn't we have a similar issue when LOCAL or REMOTE does not exist (e.g. "they modified, we removed")?

Previous: David AguilarNext: David Aguilar
Message 8 of 17 in “Interesting behavior in git mergetool with no BASE revision”
  1. Jason WengerJan 18, 2012
  2. David AguilarJan 20, 2012
  3. mergetool: Provide an empty file when no base existsDavid Aguilar, Jan 20, 2012
  4. David AguilarJan 20, 2012
  5. Junio C HamanoJan 20, 2012
  6. David AguilarJan 20, 2012
  7. mergetool: Provide an empty file when no base existsDavid Aguilar, Jan 20, 2012
  8. Junio C HamanoJan 20, 2012
  9. David AguilarJan 20, 2012
  10. Junio C HamanoJan 20, 2012
  11. Junio C HamanoJan 20, 2012
  12. mergetool: Provide an empty file when neededDavid Aguilar, Jan 20, 2012
  13. David AguilarJan 20, 2012
  14. Jason WengerJan 20, 2012
  15. Junio C HamanoJan 20, 2012
  16. mergetool: Provide an empty file when neededDavid Aguilar, Jan 20, 2012
  17. mergetool: Provide an empty file when no base existsDavid Aguilar, Jan 20, 2012

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.