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

[RFC 1/2] Use remote information in .git/config

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Nov 21, 2005, 13:54 UTC
Message-ID
<Pine.LNX.4.63.0511211452470.13775@wbgn013.biozentrum.uni-wuerzburg.de>
This patch allows to store shortcuts for fetch/pull into the config:
	[remote.junio]
		url = http://www.kernel.org/pub/scm/git/git.git
		pull = master:junio
		pull = todo:todo
		pull = +pu:pu

Note that there is only one pair per "pull" line, to allow for spaces (urgh!) in the branch names.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
	The different pull/push lines are identified by their branch name. 
	So, to update the pull line for "todo" to force fast forward, do
		git-config-set remote.junio.pull +todo:todo '^todo:'
 git-parse-remote.sh |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

applies-to: 25c461c5c50b9d8c6cd836ca6a9df12f03f29621 b0542d077b7bf6ee8b45854e47dcba73170c1e9a

diff --git a/git-parse-remote.sh b/git-parse-remote.sh
index aea7b0e..cd976da 100755
--- a/git-parse-remote.sh
+++ b/git-parse-remote.sh
@@ -22,6 +22,9 @@ get_data_source () {
 		elif test -f "$GIT_DIR/branches/$1"
 		then
 			echo branches
+		elif test "$(git-config-set --get remote.$1.url)"
+		then
+			echo config
 		else
 			echo ''
 		fi ;;
@@ -46,6 +49,9 @@ get_remote_url () {
 		url=$(sed -e 's/#.*//' "$GIT_DIR/branches/$token")
 		echo "$url/$remainder"
 		;;
+	config)
+		git-config-set --get remote.$1.url
+		;;
 	*)
 		die "internal error: get-remote-url $1" ;;
 	esac
@@ -60,6 +66,8 @@ get_remote_default_refs_for_push () {
 		sed -ne '/^Push: */{
 			s///p
 		}' "$GIT_DIR/remotes/$1" ;;
+	config)
+		git-config-set --get-all remote.$1.push ;;
 	*)
 		die "internal error: get-remote-default-ref-for-push $1" ;;
 	esac
@@ -124,6 +132,8 @@ get_remote_default_refs_for_fetch () {
 						s///p
 					}' "$GIT_DIR/remotes/$1")
 		;;
+	config)
+		git-config-set --get-all remote.$1.pull ;;
 	*)
 		die "internal error: get-remote-default-ref-for-push $1" ;;
 	esac
---
0.99.9.GIT
Next: Junio C Hamano
Message 1 of 8 in “[RFC 1/2] Use remote information in .git/config”
  1. Johannes SchindelinNov 21, 2005
  2. Junio C HamanoNov 21, 2005
  3. Johannes SchindelinNov 21, 2005
  4. Junio C HamanoNov 22, 2005
  5. Johannes SchindelinNov 22, 2005
  6. Ben CliffordNov 24, 2005
  7. Johannes SchindelinNov 25, 2005
  8. Petr BaudisNov 27, 2005

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.