How can we use go-git to generate a list of all the files that have changed between two commits similar to git diff --name-only commit1 commit2
?
For context, we have a git monorepo that contains a single root go.mod
file but multiple Go applications. When developers push commits to a branch, we would like to get a list of all files that changed between two git commits (git diff --name-only
), and filter it down into a list of application directories while excluding some directories. Our ultimate goal is so we can build, deploy, and test just the applications that have changed inside our monorepo. We have a bash script similar to this one from shippable that does this, but we'd like to use pure go and go-git.