[pan2] Tweak GIT_REMOTE var
- From: Petr Kovář <pmkovar src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pan2] Tweak GIT_REMOTE var
- Date: Fri, 30 Dec 2016 00:18:14 +0000 (UTC)
commit d0f945fe9ac3278309d1868530594246f90e52f3
Author: Petr Kovar <pknbe volny cz>
Date: Fri Dec 30 01:15:47 2016 +0100
Tweak GIT_REMOTE var
configure.ac | 23 ++++++++++-------------
1 files changed, 10 insertions(+), 13 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index e2e7c08..3f30592 100644
--- a/configure.ac
+++ b/configure.ac
@@ -14,21 +14,18 @@ else
GIT_HASH=`git --git-dir=$srcdir/.git log -1 --pretty=format:%h 2> /dev/null`
if test ! -z $GIT_HASH; then
GIT_REMOTE=`git config --get remote.origin.url 2> /dev/null`
- dnl Do not include protocol & user name in GIT_REMOTE
- case "$GIT_REMOTE" in
- *ssh://* )
- case "$GIT_REMOTE" in
- *@* )
- GIT_REMOTE=`echo $GIT_REMOTE | sed -e 's/ssh:\/\/.*@//g'`;;
- esac
- GIT_REMOTE=`echo $GIT_REMOTE | sed 's/ssh:\/\///g'`;;
- *git://* )
- GIT_REMOTE=`echo $GIT_REMOTE | sed 's/git:\/\///g'`;;
- *https://* )
- GIT_REMOTE=`echo $GIT_REMOTE | sed 's/https:\/\///g'`;;
- esac
fi
fi
+dnl Do not include protocol & user name in GIT_REMOTE
+case $GIT_REMOTE in
+ *://* )
+ GIT_REMOTE=`echo $GIT_REMOTE | cut -d '/' -f3- 2> /dev/null`
+ case $GIT_REMOTE in
+ *@* )
+ GIT_REMOTE=`echo $GIT_REMOTE | cut -d '@' -f2- | sed 's/\/git\//\//g' 2> /dev/null` ;;
+ esac
+ ;;
+esac
if test ! -z $GIT_HASH; then
if test -z $GIT_REMOTE; then
GIT_REV="GIT $GIT_HASH"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]