Git development
 help / color / mirror / Atom feed
From: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>,
	Sverre Rabbelier <srabbelier@gmail.com>,
	git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
	Yann Dirson <ydirson@altern.org>
Subject: Re: [PATCH] rebase: use @{upstream} if no upstream specified
Date: Tue, 8 Feb 2011 19:28:41 -0500 (EST)	[thread overview]
Message-ID: <alpine.DEB.2.00.1102081916330.9042@debian> (raw)
In-Reply-To: <20110208220505.GA17981@elie>

On Tue, 8 Feb 2011, Jonathan Nieder wrote:

> Martin von Zweigbergk wrote:
> > On Tue, 8 Feb 2011, Sverre Rabbelier wrote:
> 
> >> I particularly like that you explain to the user clearly what they
> >> have to do to make this work (e.g., configure the upstream). Nice.
> >
> > Thanks, but that was stolen from git-pull.sh ;-)
> 
> Doesn't that suggest it might belong in some common git-upstream--lib.sh
> (or git-sh-setup.sh)?

Maybe it does... For comparison, I pasted the two sections below.

git-rebase.sh (after my patch):

	if test -z "$branch_name"
	then
		die "You are not currently on a branch, so I cannot use any
'branch.<branchname>.merge' in your configuration file.
Please specify which upstream branch you want to use on the command
line and try again (e.g. 'git rebase <upstream branch>').
See git-rebase(1) for details."
	else
		die "You asked me to rebase without telling me which branch you
want to rebase against, and 'branch.${branch_name#refs/heads/}.merge' in
your configuration file does not tell me, either. Please
specify which branch you want to use on the command line and
try again (e.g. 'git rebase <upstream branch>').
See git-rebase(1) for details."
	fi

git-pull.sh:

	elif [ -z "$curr_branch" ]; then
		echo "You are not currently on a branch, so I cannot use any"
		echo "'branch.<branchname>.merge' in your configuration file."
		echo "Please specify which remote branch you want to use on the command"
		echo "line and try again (e.g. 'git pull <repository> <refspec>')."
		echo "See git-pull(1) for details."
	elif [ -z "$upstream" ]; then
		echo "You asked me to pull without telling me which branch you"
		echo "want to $op_type $op_prep, and 'branch.${curr_branch}.merge' in"
		echo "your configuration file does not tell me, either. Please"
		echo "specify which branch you want to use on the command line and"
		echo "try again (e.g. 'git pull <repository> <refspec>')."
		echo "See git-pull(1) for details."
		echo
		echo "If you often $op_type $op_prep the same branch, you may want to"
		echo "use something like the following in your configuration file:"
		echo
		echo "    [branch \"${curr_branch}\"]"
		echo "    remote = <nickname>"
		echo "    merge = <remote-ref>"
		test rebase = "$op_type" &&
			echo "    rebase = true"
		echo
		echo "    [remote \"<nickname>\"]"
		echo "    url = <url>"
		echo "    fetch = <refspec>"
		echo
		echo "See git-config(1) for details."


I had forgotten that I trimmed the last part of it. Maybe I should
have also included that? Then it would make even more sense to extract
this piece of code.


/Martin

  reply	other threads:[~2011-02-09  0:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-08  0:37 [PATCH] rebase: use @{upstream} if no upstream specified Martin von Zweigbergk
2011-02-08 17:46 ` Sverre Rabbelier
2011-02-08 18:23   ` Martin von Zweigbergk
2011-02-08 18:27     ` Sverre Rabbelier
2011-02-08 22:05     ` Jonathan Nieder
2011-02-09  0:28       ` Martin von Zweigbergk [this message]
2011-02-09  1:50         ` Martin von Zweigbergk
2011-02-09  4:17           ` Jonathan Nieder
2011-02-10  1:15             ` Martin von Zweigbergk
2011-02-10  1:54 ` Martin von Zweigbergk
2011-02-10  2:25   ` Junio C Hamano
2011-02-10  2:46     ` Martin von Zweigbergk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.00.1102081916330.9042@debian \
    --to=martin.von.zweigbergk@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=srabbelier@gmail.com \
    --cc=ydirson@altern.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox