Skip to content

Commit 2337094

Browse files
author
mmi
committed
Add new file to list some git logs
1 parent 996f431 commit 2337094

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

list.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
# echo "Your script args ($#) are: $@"
3+
4+
# get required functions and vars
5+
source ./.dbFlow/lib.sh
6+
7+
if [ $# -eq 0 ]; then
8+
printf "${BWHITE}USAGE${NC}\n"
9+
printf " ${0} -t | --target_branch ${BORANGE}branch${NC} > List commits until last merge on targe branch\n"
10+
printf "\n"
11+
printf "${PURPLE}Examle${NC}\n"
12+
printf " ${0} --target_branch ${BORANGE}origin/master${NC}"
13+
printf "\n"
14+
exit 1
15+
fi
16+
17+
while [[ "$#" -gt 0 ]]; do
18+
case $1 in
19+
--target_branch|-t) TARGET_BRANCH="$2"; shift ;;
20+
*) echo "Unknown parameter passed: $1"; exit 1 ;;
21+
esac
22+
shift
23+
done
24+
25+
echo "Using target branch: $TARGET_BRANCH"
26+
27+
git log --graph --decorate --oneline $(git log --merges --pretty=format:"%H" -n 1 $TARGET_BRANCH)..HEAD

0 commit comments

Comments
 (0)