File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,26 +14,26 @@ HEAD=$2
1414echo " Analyzing commits between $UPSTREAM and $HEAD ..."
1515
1616# Get commits that are in HEAD but not in UPSTREAM (similar to git cherry)
17- UNIQUE_COMMITS=$( git rev-list $UPSTREAM .. $HEAD )
17+ UNIQUE_COMMITS=$( git rev-list " $UPSTREAM " .. " $HEAD " )
1818
1919if [ -z " $UNIQUE_COMMITS " ]; then
2020 echo " No unique commits found in $HEAD that aren't in $UPSTREAM ."
2121 exit 0
2222fi
2323
2424# Get all commit messages from upstream for comparison
25- UPSTREAM_MSGS=$( git log --format=" %s" $UPSTREAM )
25+ UPSTREAM_MSGS=$( git log --format=" %s" " $UPSTREAM " )
2626
2727echo " Commits in $HEAD that aren't in $UPSTREAM based on commit message:"
2828echo " --------------------------------------------------------------"
2929
3030while IFS= read -r commit; do
3131 # Get the commit message for this commit
32- COMMIT_MSG=$( git log -n 1 --format=" %s" $commit )
32+ COMMIT_MSG=$( git log -n 1 --format=" %s" " $commit " )
3333
3434 # Check if this commit message exists in upstream
3535 if ! echo " $UPSTREAM_MSGS " | grep -q " ^$COMMIT_MSG $" ; then
3636 # This commit message doesn't exist in upstream, so show it
37- git show --no-patch --format=" %C(yellow)%h%C(reset) - %s %C(green)(%cr) %C(bold blue)<%an>%C(reset)" $commit
37+ git show --no-patch --format=" %C(yellow)%h%C(reset) - %s %C(green)(%cr) %C(bold blue)<%an>%C(reset)" " $commit "
3838 fi
3939done <<< " $UNIQUE_COMMITS"
You can’t perform that action at this time.
0 commit comments