Skip to content
This repository was archived by the owner on Dec 21, 2019. It is now read-only.

Commit c51718b

Browse files
committed
simplified incoming and outgoing
1 parent 6031afe commit c51718b

File tree

4 files changed

+12
-50
lines changed

4 files changed

+12
-50
lines changed

git-incoming

+6-23
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,22 @@
33
CURRENT_BRANCH=$(git branch &>/dev/null; if [ $? -eq 0 ]; then echo "$(git branch | grep '^*' |sed s/\*\ //)"; fi)
44
55
if [ "${CURRENT_BRANCH}" != "" ]; then
6-
REMOTE_REPOSITORY="$(echo ${1} | cut -d"/" -f1 -s)"
7-
REMOTE_BRANCH="$(echo ${1} | cut -d"/" -f2 -s)"
86
9-
if [ "${REMOTE_REPOSITORY}" == "" ]; then
10-
REMOTE_REPOSITORY="${1}"
11-
fi
7+
TARGET="${1}"
128
13-
# if no remote repository was specified, attempt to get it from the
14-
# "tracked" branch of this branch
15-
if [ "${REMOTE_REPOSITORY}" == "" ]; then
9+
if [ "${TARGET}" == "" ]; then
1610
TRACKING_REPOSITORY="$(git config branch.${CURRENT_BRANCH}.remote)"
1711
1812
# there is a tracking repository
1913
if [ "${TRACKING_REPOSITORY}" != "" ]; then
2014
REMOTE_REPOSITORY="${TRACKING_REPOSITORY}"
2115
REMOTE_BRANCH="$(git config branch.${CURRENT_BRANCH}.merge | cut -d"/" -f3)"
16+
TARGET="${REMOTE_REPOSITORY}/${REMOTE_BRANCH}"
2217
fi
2318
fi
2419
25-
# if there is no tracking repository, default to origin
26-
if [ "${REMOTE_REPOSITORY}" == "" ]; then
27-
REMOTE_REPOSITORY="origin"
28-
fi
29-
30-
if [ "${REMOTE_BRANCH}" == "" ]; then
31-
REMOTE_BRANCH="${CURRENT_BRANCH}"
32-
fi
33-
34-
if [ "${SILENCE}" != "yes" ]; then
35-
echo "From: ${REMOTE_REPOSITORY}/${REMOTE_BRANCH}"
36-
echo ""
37-
fi
20+
echo "From: ${TARGET}"
21+
echo ""
3822
39-
#git remote update &>/dev/null
40-
git log ..${REMOTE_REPOSITORY}/${REMOTE_BRANCH} ${GIT_LOG_ARGUMENTS}
23+
git log ..${TARGET}
4124
fi

git-incoming-short

-2
This file was deleted.

git-outgoing

+6-23
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,22 @@
33
CURRENT_BRANCH=$(git branch &>/dev/null; if [ $? -eq 0 ]; then echo "$(git branch | grep '^*' |sed s/\*\ //)"; fi)
44
55
if [ "${CURRENT_BRANCH}" != "" ]; then
6-
REMOTE_REPOSITORY="$(echo ${1} | cut -d"/" -f1 -s)"
7-
REMOTE_BRANCH="$(echo ${1} | cut -d"/" -f2 -s)"
86
9-
if [ "${REMOTE_REPOSITORY}" == "" ]; then
10-
REMOTE_REPOSITORY="${1}"
11-
fi
7+
TARGET="${1}"
128
13-
# if no remote repository was specified, attempt to get it from the
14-
# "tracked" branch of this branch
15-
if [ "${REMOTE_REPOSITORY}" == "" ]; then
9+
if [ "${TARGET}" == "" ]; then
1610
TRACKING_REPOSITORY="$(git config branch.${CURRENT_BRANCH}.remote)"
1711
1812
# there is a tracking repository
1913
if [ "${TRACKING_REPOSITORY}" != "" ]; then
2014
REMOTE_REPOSITORY="${TRACKING_REPOSITORY}"
2115
REMOTE_BRANCH="$(git config branch.${CURRENT_BRANCH}.merge | cut -d"/" -f3)"
16+
TARGET="${REMOTE_REPOSITORY}/${REMOTE_BRANCH}"
2217
fi
2318
fi
2419
25-
# if there is no tracking repository, default to origin
26-
if [ "${REMOTE_REPOSITORY}" == "" ]; then
27-
REMOTE_REPOSITORY="origin"
28-
fi
29-
30-
if [ "${REMOTE_BRANCH}" == "" ]; then
31-
REMOTE_BRANCH="${CURRENT_BRANCH}"
32-
fi
33-
34-
if [ "${SILENCE}" != "yes" ]; then
35-
echo "To: ${REMOTE_REPOSITORY}/${REMOTE_BRANCH}"
36-
echo ""
37-
fi
20+
echo "To: ${TARGET}"
21+
echo ""
3822
39-
#git remote update &>/dev/null
40-
git log ${REMOTE_REPOSITORY}/${REMOTE_BRANCH}.. ${GIT_LOG_ARGUMENTS}
23+
git log ${TARGET}..
4124
fi

git-outgoing-short

-2
This file was deleted.

0 commit comments

Comments
 (0)