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

Re: [PATCH 1/2] merge: enable defaulttoupstream by default

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 22, 2014, 19:53 UTC
Message-ID
<xmqqmwfd3zu9.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1398039454-31193-2-git-send-email-felipe.contreras@gmail.com>
Felipe Contreras <felipe.contreras@gmail.com> writes:
Show 7 quoted lines
> There's no point in this:
>
> % git merge
> fatal: No commit specified and merge.defaultToUpstream not set.
>
> We know the most likely scenario is that the user wants to merge the
> upstream, and if not, he can set merge.defaultToUpstream to false.

And a new possible failure case is when there is no upstream defined for the current branch, which gets perfectly good new error message:

    $ git merge
    fatal: No remote for the current branch.

So I think this is good. We want to protect this with a new test, no?

Will queue as-is for now.
Show 35 quoted lines
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> ---
>  Documentation/git-merge.txt | 5 ++---
>  builtin/merge.c             | 2 +-
>  2 files changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt
> index a3c1fa3..cf2c374 100644
> --- a/Documentation/git-merge.txt
> +++ b/Documentation/git-merge.txt
> @@ -101,9 +101,8 @@ commit or stash your changes before running 'git merge'.
>  	Specifying more than one commit will create a merge with
>  	more than two parents (affectionately called an Octopus merge).
>  +
> -If no commit is given from the command line, and if `merge.defaultToUpstream`
> -configuration variable is set, merge the remote-tracking branches
> -that the current branch is configured to use as its upstream.
> +If no commit is given from the command line, merge the remote-tracking
> +branches that the current branch is configured to use as its upstream.
>  See also the configuration section of this manual page.
>  
>  
> diff --git a/builtin/merge.c b/builtin/merge.c
> index 66d8843..1fc9319 100644
> --- a/builtin/merge.c
> +++ b/builtin/merge.c
> @@ -63,7 +63,7 @@ static int verbosity;
>  static int allow_rerere_auto;
>  static int abort_current_merge;
>  static int show_progress = -1;
> -static int default_to_upstream;
> +static int default_to_upstream = 1;
>  static const char *sign_commit;
>  
>  static struct strategy all_strategy[] = {
Previous: Felipe ContrerasNext: Felipe Contreras
Message 3 of 19 in “Simple default fixes for v2.0”
  1. 0/2 Simple default fixes for v2.0Felipe Contreras, Apr 21, 2014
  2. 1/2 merge: enable defaulttoupstream by defaultFelipe Contreras, Apr 21, 2014
  3. Junio C HamanoApr 22, 2014
  4. 2/2 mergetool: run prompt only if guessed toolFelipe Contreras, Apr 21, 2014
  5. David AguilarApr 22, 2014
  6. Charles BaileyApr 22, 2014
  7. Felipe ContrerasApr 22, 2014
  8. Charles BaileyApr 22, 2014
  9. Felipe ContrerasApr 22, 2014
  10. Charles BaileyApr 22, 2014
  11. Felipe ContrerasApr 22, 2014
  12. Charles BaileyApr 23, 2014
  13. Junio C HamanoApr 23, 2014
  14. Junio C HamanoApr 24, 2014
  15. Junio C HamanoApr 22, 2014
  16. David AguilarApr 23, 2014
  17. Junio C HamanoApr 23, 2014
  18. Junio C HamanoApr 22, 2014
  19. Junio C HamanoApr 22, 2014

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.