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

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
Previous: Jan KrügerNext: Jonathan Nieder
Message 16 of 26 in “Unhelpful "branch.master.remote = <nickname>" advice?”
  1. Jan NieuwenhuizenNov 11, 2009
  2. Tomas CarneckyNov 11, 2009
  3. Makefile: add uninstall target. Fixes elementary good cleaning manners.Jan Nieuwenhuizen, Nov 18, 2009
  4. Matthieu MoyNov 18, 2009
  5. Jan KrügerNov 11, 2009
  6. Junio C HamanoNov 11, 2009
  7. Tomas CarneckyNov 11, 2009
  8. Jan NieuwenhuizenNov 11, 2009
  9. Tomas CarneckyNov 11, 2009
  10. Jan NieuwenhuizenNov 12, 2009
  11. git-pull.sh: overhaul error handling when no candidates are foundJan Krüger, Nov 12, 2009
  12. Jeff KingNov 12, 2009
  13. Jan KrügerNov 12, 2009
  14. Jeff KingNov 12, 2009
  15. git-pull.sh --rebase: overhaul error handling when no candidates are foundJan Krüger, Nov 12, 2009
  16. Jonathan NiederNov 13, 2009
  17. pull: clarify advice for the unconfigured error caseJonathan Nieder, Nov 27, 2009
  18. Junio C HamanoDec 2, 2009
  19. Jonathan NiederDec 3, 2009
  20. Jeff KingDec 3, 2009
  21. Jan NieuwenhuizenDec 3, 2009
  22. Jan KrügerDec 3, 2009
  23. Junio C HamanoDec 7, 2009
  24. Junio C HamanoNov 15, 2009
  25. Björn SteinbrinkNov 12, 2009
  26. Tomas CarneckyNov 12, 2009

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.