Hello,

I have a build set up to use git plugin.
The build is paramatized to take any git revision (commit, branch, ..etc).

During the build, I need to get a list of changed files since last build.
I could do this if the current build is on the same branch of git by
looking at GIT_COMMIT and GIT_PREVIOUS_COMMIT environment variables in my
script.

But, if the current build is not on the same branch, GIT_PREVIOUS_COMMIT
isn't set.
So, I can't do  git diff --name-only $GIT_PREVIOUS_COMMIT $GIT_COMMIT  to
get the list of changed files  if I'm building a new branch.

Is it better to use jenkins REST API to get previous build info?

*tl;tr  How do I get a list of changed files since the last build (from a
git project)?*

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to