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

[RFC/PATCH] Make git-{pull,rebase} no-tracking message friendlier

From
Carlos Martín Nieto <cmn@elego.de>
Date
Feb 23, 2012, 16:05 UTC
Message-ID
<1330013115-26355-1-git-send-email-cmn@elego.de>

The current message is too long and at too low a level for anybody to understand it if they don't know about the configuration format already.

Reformat it to show the commands a user would be expected to use, instead of the contents of the configuration file. ---

As annoying as it is when people simply paste the output of 'git pull' and ask "what does it mean" without even reading it, I have to admit that as a new user, I'd also be scared off by this message. Using git-remote and git-branch should make it less scary and more relatable for the user. I'm not aware of a way to set branch.$branch.rebase with porcelain, so I put in a config command there. Better solutions/wordings welcome; I'd really like to get rid of the old message.

 git-parse-remote.sh |   23 ++++++++---------------
 1 files changed, 8 insertions(+), 15 deletions(-)
diff --git a/git-parse-remote.sh b/git-parse-remote.sh
index b24119d..96e76a9 100644
--- a/git-parse-remote.sh
+++ b/git-parse-remote.sh
@@ -65,26 +65,19 @@ Please specify which branch you want to $op_type $op_prep on the command
 line and try again (e.g. '$example').
 See git-${cmd}(1) for details."
 	else
-		echo "You asked me to $cmd without telling me which branch you
-want to $op_type $op_prep, 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
+		echo "You asked me to $cmd without telling me which branch you want to
+$op_type $op_prep, and there is no tracking information for the current branch.
+Please specify which branch you want to use on the command line and
 try again (e.g. '$example').
 See git-${cmd}(1) for details.
 
 If you often $op_type $op_prep the same branch, you may want to
-use something like the following in your configuration file:
-    [branch \"${branch_name#refs/heads/}\"]
-    remote = <nickname>
-    merge = <remote-ref>"
-		test rebase = "$op_type" &&
-		echo "    rebase = true"
-		echo "
-    [remote \"<nickname>\"]
-    url = <url>
-    fetch = <refspec>
+run something like:
 
-See git-config(1) for details."
+    git remote add <remote> <url>
+    git branch --set-upstream ${branch_name#refs/heads/} <remote>/<remote-branch>"
+		test rebase = "$op_type" &&
+		echo "    git config branch.${branch_name#refs/heads/}.rebase true"
 	fi
 	exit 1
 }
-- 
1.7.8.352.g876a6f
Next: Junio C Hamano
Message 1 of 11 in “Make git-{pull,rebase} no-tracking message friendlier”
  1. Make git-{pull,rebase} no-tracking message friendlierCarlos Martín Nieto, Feb 23, 2012
  2. Junio C HamanoFeb 23, 2012
  3. Carlos Martín NietoFeb 27, 2012
  4. Matthieu MoyFeb 27, 2012
  5. Carlos Martín NietoFeb 29, 2012
  6. Matthieu MoyFeb 29, 2012
  7. Carlos Martín NietoFeb 29, 2012
  8. Make git-{pull,rebase} message without tracking information friendlierCarlos Martín Nieto, Feb 29, 2012
  9. Junio C HamanoFeb 29, 2012
  10. Carlos Martín NietoMar 4, 2012
  11. Junio C HamanoMar 5, 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.