File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -18,18 +18,22 @@ Analyze changes on the current branch to identify and fix technical debt, code d
1818
1919### Step 1: Get Branch Changes
2020
21- Find the upstream remote and compare against it:
21+ Find the merge-base (where this branch diverged from master) and compare against it:
2222
2323``` bash
24- # Find upstream (DataDog org repo) and show changes
24+ # Find upstream (DataDog org repo)
2525UPSTREAM=$( git remote -v | grep -E ' DataDog/[^/]+(.git)?\s' | head -1 | awk ' {print $1}' )
2626if [ -z " $UPSTREAM " ]; then
2727 echo " No DataDog upstream found, using origin"
2828 UPSTREAM=" origin"
2929fi
30- echo " Comparing against: $UPSTREAM /master"
31- git diff ${UPSTREAM} /master --stat
32- git diff ${UPSTREAM} /master --name-status
30+
31+ # Find the merge-base (commit where this branch diverged from master)
32+ MERGE_BASE=$( git merge-base HEAD ${UPSTREAM} /master)
33+ echo " Comparing changes introduced on this branch since diverging from master using base commit: $MERGE_BASE "
34+
35+ git diff $MERGE_BASE --stat
36+ git diff $MERGE_BASE --name-status
3337```
3438
3539If no changes exist, inform the user and stop.
You can’t perform that action at this time.
0 commit comments