Skip to content

Commit 1f3f8c0

Browse files
Jason AntmanJason Antman
Jason Antman
authored and
Jason Antman
committed
add ismerged shell script
1 parent 8c91d67 commit 1f3f8c0

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ file.
2020
* __git_repo_diff.py__ - uses GitPython to compare 2 git repo clones and report on branches that only exist in one, or have different head commits in the two repos
2121
* __htmldata.py__ - Perl library to manipulate HTML or XHTML documents, required by mw2html-auth
2222
* __increment_zone_serial__ - This script updates/increments the bind zone file serial number in a file specified as the first argument
23+
* __ismerged__ - shell script that takes a git branch name, and tells if it is merged into master or not
2324
* __js2phpdoc.php__ - script to take comments and function prototypes from JS files and make them PHP-ish to be parsed by phpdoc
2425
* __kickRsyslog.php__ - script to restart rsyslog if it appears to have stopped logging
2526
* __libvirt_csv.py__ - Use libvirt python bindings to print CSV lists of dom0_host,domU_name,ID,state,UUID for all qemu+kvm VMs running on libvirt hosts passed in as arguments

ismerged

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
BRANCH=$1
4+
5+
current_branch=$(git symbolic-ref -q HEAD)
6+
current_branch=${current_branch##refs/heads/}
7+
current_branch=${current_branch:-HEAD}
8+
9+
git fetch &>/dev/null
10+
git checkout $BRANCH &>/dev/null
11+
git pull &>/dev/null
12+
BRANCH_COMMIT=$(git rev-parse $BRANCH)
13+
git checkout master &>/dev/null
14+
if `git log | grep $BRANCH_COMMIT &>/dev/null`
15+
then
16+
echo "$BRANCH is merged into master ($BRANCH_COMMIT)"
17+
echo "Branches containing HEAD of AUTO-274:"
18+
git branch -a --contains $BRANCH_COMMIT
19+
else
20+
echo "$BRANCH NOT in master, merge-base is $(git merge-base master $BRANCH)"
21+
fi

0 commit comments

Comments
 (0)