When using gitlab-ci doing
git log --pretty=format:'%s' --date=relative origin/<branch_name>..HEAD
returns plenty of open branches instead the commits. Why is that?
Sample:
$ git log --pretty=format:'%s' --date=relative origin/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}..origin/${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME} --until=3.weeks.ago
.git/FETCH_HEAD:UDC-738
.git/FETCH_HEAD:UDC-831
.git/FETCH_HEAD:UDC-965
I am trying to get out the commit difference between branches, but GitlabCi seems to be running in detached head and ruturning the active branches instead.
I’ve tried using the CI_MERGE_REQUEST_SOURCE_BRANCH_SHA1
and CI_MERGE_REQUEST_TARGET_BRANCH_SHA1
as well with no luck.
Is it a misunderstanding on my end of what the git-log should return, or am I getting wrong results & how to get to the commit difference between the branches?
I’ve made this as a sample, but getting different results now apparently the target_sha is not available there.
Possible issuess with the variable - checking if I can replace it somehow
Thanks in advance