Re: [PATCH v2] git-pull.sh --rebase: overhaul error handling when no candidates are found
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Nov 13, 2009, 04:07 UTC
- Message-ID
- <20091113040754.GA3255@progeny.tock>
- In-Reply-To
- <20091112170814.1858aba4@perceptron>
Jan Krüger wrote:
> Subject: [PATCH v2] git-pull.sh --rebase: overhaul error handling when no candidates are found
s/error handling/error message/. :)
> --- a/git-pull.sh
> +++ b/git-pull.sh
> @@ -91,45 +91,56 @@ error_on_no_merge_candidates () {[...]
Show 5 quoted lines
> if [ $# -gt 1 ]; then > - echo "There are no candidates for merging in the refs that you just fetched." > + echo "There are no candidates for using the refs that you just fetched." > echo "Generally this means that you provided a wildcard refspec which had no" > echo "matches on the remote end."
This sounds a little awkward to me, maybe because all the remote refs are being used to populate the remotes/<remote>/* hierarchy.
I’m trying to come up with an alternative wording, but it is hard:
* Merging and rebasing are about incorporating the remote history into our own, so how about something like "... no candidates for incorporating from the refs ..."?
* Maybe one is using 'git pull' to update. "There are no candidates to use for an update among the refs that you just fetched."
* Or: "There are no upstreams to local branches among the refs that you just fetched."
I like the third of these best, but I hope you can do better.
> elif [ $# -gt 0 ] && [ "$1" != "$remote" ]; then > echo "You asked to pull from the remote '$1', but did not specify" > - echo "a branch to merge. Because this is not the default configured remote" > + echo "a branch to use. Because this is not the default configured remote"
Maybe just "... did not specify a branch."?
Show 6 quoted lines
> echo "for your current branch, you must specify a branch on the command line." > 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 branch you want to merge on the command" > + echo "Please specify which branch you want to use on the command"
s/branch/remote branch/? The reader might worry that the command is going to try to re-attach his HEAD.
The rest of your patch looks good to me. Thanks for working on this.
Jonathan