[asterisk-scf-commits] asterisk-scf/integration/gitall.git branch "master" updated.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Fri Apr 15 12:54:09 CDT 2011
branch "master" has been updated
via 89cd02fa3eac8a96546385f26635cb81457d34e1 (commit)
from d33a2d15a138916e68c04da9c636b0a7c0ff8731 (commit)
Summary of changes:
gitall-asterisk-scf.sh | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
- Log -----------------------------------------------------------------
commit 89cd02fa3eac8a96546385f26635cb81457d34e1
Author: David M. Lee <dlee at digium.com>
Date: Fri Apr 15 12:49:12 2011 -0500
Fixed gitall script for usage of pushinsteadof.
In git, there's a difference between the URL that's configured, and the
URL that's actually used. For example, url.<base>.pushInsteadOf can
change the default push URL for a remote, if one is not already set.
Now the script treats the configured URL's separately from the effective
URL's.
diff --git a/gitall-asterisk-scf.sh b/gitall-asterisk-scf.sh
index 4d7dc97..47c03f2 100755
--- a/gitall-asterisk-scf.sh
+++ b/gitall-asterisk-scf.sh
@@ -71,9 +71,13 @@ function git_in_dir()
popd > /dev/null
}
-gitdepot_pull=`git config --get remote.origin.url | sed "s at asterisk-scf/integration/gitall.*@@"`
-gitdepot_push=`git config --get remote.origin.pushurl | sed "s at asterisk-scf/integration/gitall.*@@"`
-gitdepot_push=${gitdepot_push:-${gitdepot_pull}}
+# Effective URL's for pushing and pulling
+gitdepot_pull=`git remote show origin | sed -n 's at asterisk-scf/integration/gitall.*@@; s/^ Fetch URL: //p'`
+gitdepot_push=`git remote show origin | sed -n 's at asterisk-scf/integration/gitall.*@@; s/^ Push URL: //p'`
+
+# Configured URL's for pushing and pulling
+config_gitdepot_pull=`git config --get remote.origin.url | sed "s at asterisk-scf/integration/gitall.*@@"`
+config_gitdepot_push=`git config --get remote.origin.pushurl | sed "s at asterisk-scf/integration/gitall.*@@"`
# tree should probably be set by menu prompts or command line args
# one day
@@ -183,12 +187,14 @@ EOF
repoDir=$(basename ${repo})
repoUri=${gitdepot_pull}${tree}/${repo}
repoPushUri=${gitdepot_push}${tree}/${repo}
+ configRepoUri=${config_gitdepot_pull}${tree}/${repo}
+ configRepoPushUri=${config_gitdepot_push}${tree}/${repo}
if [ -d ${repoDir}/.git ]; then
# update the origin to what is specified in repoUri
- git_in_dir ${repoDir} remote set-url origin ${repoUri}
- if test ${gitdepot_push}; then
- git_in_dir ${repoDir} remote set-url --push origin ${repoPushUri}
+ git_in_dir ${repoDir} remote set-url origin ${configRepoUri}
+ if test ${config_gitdepot_push}; then
+ git_in_dir ${repoDir} remote set-url --push origin ${configRepoPushUri}
else
# we really should use 'git remote set-url --delete' here, but coming up
# with the proper regex syntax for the URL to be match seems to be difficult
-----------------------------------------------------------------------
--
asterisk-scf/integration/gitall.git
More information about the asterisk-scf-commits
mailing list