linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: "Luis R. Rodriguez" <mcgrof@gmail.com>, linux-wireless@vger.kernel.org
Subject: [PATCH 4/4] compat-wireless: find the actual remote URL
Date: Wed, 07 Apr 2010 01:31:08 -0400	[thread overview]
Message-ID: <20100407053108.23575.92800.stgit@mj.roinet.com> (raw)
In-Reply-To: <20100407053051.23575.94594.stgit@mj.roinet.com>

Don't assume the remote to be called "origin".  Instead, find the
current branch first, defaulting to "master".  Then find the
corresponding remote, defaulting to "origin".  Then find the remote URL,
defaulting to "unknown".  Reuse the remote URL for TREE_NAME.

Signed-off-by: Pavel Roskin <proski@gnu.org>
---
 scripts/admin-update.sh |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh
index af4479a..5d8068d 100755
--- a/scripts/admin-update.sh
+++ b/scripts/admin-update.sh
@@ -295,15 +295,20 @@ done
 DIR="$PWD"
 cd $GIT_TREE
 GIT_DESCRIBE=$(git describe)
+GIT_BRANCH=$(git branch --no-color |sed -n 's/^\* //p')
+GIT_BRANCH=${GIT_BRANCH-master}
+GIT_REMOTE=$(git config branch.${GIT_BRANCH}.remote)
+GIT_REMOTE=${GIT_REMOTE-origin}
+GIT_REMOTE_URL=$(git config remote.${GIT_REMOTE}.url)
+GIT_REMOTE_URL=${GIT_REMOTE_URL-unknown}
 echo -e "${GREEN}Updated${NORMAL} from local tree: ${BLUE}${GIT_TREE}${NORMAL}"
-echo -e "Origin remote URL: ${CYAN}$(git config remote.origin.url)${NORMAL}"
+echo -e "Origin remote URL: ${CYAN}${GIT_REMOTE_URL}${NORMAL}"
 cd $DIR
 if [ -d ./.git ]; then
 	git describe > compat-release
 
 	cd $GIT_TREE
-	TREE_NAME=$(git config remote.origin.url)
-	TREE_NAME=${TREE_NAME##*/}
+	TREE_NAME=${GIT_REMOTE_URL##*/}
 
 	echo $TREE_NAME > $DIR/git-describe
 	echo $GIT_DESCRIBE >> $DIR/git-describe

  parent reply	other threads:[~2010-04-07  5:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-07  5:30 [PATCH 1/4] compat-wireless: remove patch part dealing with net/net_namespace.h Pavel Roskin
2010-04-07  5:30 ` [PATCH 2/4] compat-wireless: remove 13-trace.patch, it's handled in compat now Pavel Roskin
2010-04-07  5:31 ` [PATCH 3/4] compat-wireless: remove 25-device_create.patch, it's handled by compat Pavel Roskin
2010-04-07  5:31 ` Pavel Roskin [this message]
2010-04-07  7:12   ` [PATCH 4/4] compat-wireless: find the actual remote URL Luis R. Rodriguez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100407053108.23575.92800.stgit@mj.roinet.com \
    --to=proski@gnu.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mcgrof@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).