-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfindeligible
More file actions
executable file
·49 lines (37 loc) · 1.84 KB
/
findeligible
File metadata and controls
executable file
·49 lines (37 loc) · 1.84 KB
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
#!/usr/bin/env bash
set -e
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
SVNFIXES="origin/svn/fixes_3_2"
FIXES="origin/fixes_3_2"
MAIN="origin/main"
SVNFIXES_HASH=`git log -n 1 "$SVNFIXES" --pretty=format:"%h"`
MAIN_HASH=`git log -n 1 "$MAIN" --pretty=format:"%h"`
FIXES_HASH=`git log -n 1 "$FIXES" --pretty=format:"%h"`
GIT_START_HASH=`git log -n 1 git_start --pretty=format:"%h"`
MERGE_BASE=`git merge-base $SVNFIXES_HASH $MAIN_HASH`
# get all hashes of merged commits created in git
git log $SVNFIXES_HASH..$FIXES_HASH --grep="cherry picked from commit" | grep -oh "cherry picked from commit [0-9a-f]*" | sed 's/cherry picked from commit \([0-9a-f]*\)/\1/' > mergedhashes
# get all hashes of commits created to main in git
git log $GIT_START_HASH..$MAIN_HASH --pretty=format:"%H" > mainhashes
# find all commits being only updates of the submodules
git log $GIT_START_HASH..$MAIN_HASH --grep="^\* updated$" --pretty=format:"%H" > submoduleupdatehashes
# find all hashes not in fixes but in main
# exclude commits being blocked
grep -Fxv -f mergedhashes -f .gitfpcblockedhashes -f submoduleupdatehashes mainhashes > eligiblehashes
# find all hashes not in fixes but in eligiblesvnhash, so filter out commits
# commited to trunk in svn but cherry-picked in git
# exclude also commits being blocked
# exclude commits being identified as submodule updates
grep -Fxv -f mergedhashes -f .gitfpcblockedhashes .gitfpceligiblesvnhashes > eligiblehashesfromsvn
# get eligible hashes from git times
{
xargs git show --name-status --no-merges <eligiblehashes
echo
xargs git show --name-status <eligiblehashesfromsvn
} | sed 's/^commit /******************************************************************************\ncommit /g'
# cleanup
rm mergedhashes
rm mainhashes
rm eligiblehashes
rm eligiblehashesfromsvn
rm submoduleupdatehashes