-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgit_diff_gemfiles_n_kickstarts.bash
executable file
·65 lines (49 loc) · 2 KB
/
git_diff_gemfiles_n_kickstarts.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/env bash
function ask {
read -p "$@: " choice;
echo "${choice}";
}
FILES="vmdb/Gemfile* lib/Gemfile host/Gemfile build/kickstarts/base.ks.erb"
BUILD_DIR_BASE="/home/jvlcek"
BUILD_DIR="CFME_IMAGE_BUILDING_2"
cd ${BUILD_DIR_BASE}
if ! [[ -d ./${BUILD_DIR} ]]; then
mkdir ${BUILD_DIR}
fi
cd ${BUILD_DIR}
if ! [[ -d ./cfme ]]; then
git clone -o production git+ssh://code.engineering.redhat.com/cfme.git # gerrit
cd cfme
git remote add upstream [email protected]:ManageIQ/manageiq.git
fi
cd cfme
# git remote -v
# Should look like this:
# production git+ssh://code.engineering.redhat.com/cfme.git (fetch)
# production git+ssh://code.engineering.redhat.com/cfme.git (push)
# upstream [email protected]:ManageIQ/manageiq.git (fetch)
# upstream [email protected]:ManageIQ/manageiq.git (push)
git fetch --all
echo " * * * Branches * * *"
git branch -r # show remote branches
diff_branch=$(ask "which branch")
echo "diff_branch ->${diff_branch}<-"
echo " * * * tags * * *"
git tag -l | grep ^5\.3\.1
diff_tag=$(ask "which tag")
echo "diff_tag ->${diff_tag}<-"
# +-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=
# Before we cut a branch and rebasing against upstream master
# +-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=
# git diff 5.3.0.0.alpha2 upstream/master ${FILES}
# +-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=
# After we have a production branch
# +-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=
# +-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=
# Find the last tag that has all gems already built into RPMs
# +-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=
echo "git diff ${diff_tag} ${diff_branch} ${FILES}"
git diff ${diff_tag} ${diff_branch} ${FILES}
# git diff 5.3.1.4 production/5.3.z ${FILES}
# Or diffing between 2 gerrit tags, once the new tag has been cut.
# git diff 5.2.4.2 production/5.2.4.x ${FILES}