From: Johannes Schindelin Date: Mon, 21 Nov 2005 13:54:52 GMT Subject: [RFC 1/2] Use remote information in .git/config Message-ID: 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 --- 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