Open rmelotte opened 2 years ago
Thanks for reporting this, it's a pretty specific use-case!
In case the source branch has already been merged into the target branch before, dco-check silently fails:
Detected: git (default) using default branch 'master' error:
The error message could definitely be improved as a starting point. It should at least mention what/where the error happened and include the command error message/stderr output, if any.
Maybe if merge-base --fork-point failed, we should fallback to using git merge-base master topic?
I think this is reasonable. If you could open a PR with this fix that would be great, otherwise I'll get to it at some point!
(The following applies to the GitRetriever). In case the source branch has already been merged into the target branch before, dco-check silently fails:
This is because the
git merge-base --forkpoint master
command returns nothing (and exits with 1):It's relatively easy to reproduce with an empty repo:
Note that the
no-ff
flag is needed, otherwise a fast-forward merge is done anddco-check
doesn't fail in that case.Could it be related to this note in the manual of
git-merge-base
?I'm note sure what
dco-check
could do in this case... Maybe ifmerge-base --fork-point
failed, we should fallback to usinggit merge-base master topic
?EDIT: it looks like there could be multiple reason why
--forkpoint
would fail: https://public-inbox.org/git/xmqq7ewckbpk.fsf@gitster.mtv.corp.google.com/t/