Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No reference found on non-empty git history #230

Closed
CodingJonas opened this issue May 7, 2020 · 7 comments
Closed

No reference found on non-empty git history #230

CodingJonas opened this issue May 7, 2020 · 7 comments

Comments

@CodingJonas
Copy link
Contributor

I run this project on the latest version in my gitlab ci pipeline on different branches and experience some weird behaviour:
On some branches it works fine, while on others it throws this error:

$ commitsar -v
Starting analysis of commits on branch HEAD
reference not found

There is a git history available:

 $ git --no-pager log --oneline
c7c1561 chore: commit
5710afe chore: another commit
bea536b Merge branch 'branch' into 'develop'  <-- This is the latest commit to the branch I branched out from
236c3dc ci: add stuff

I'm not too familiar with the code of this project, how can I debug this further?

@fallion
Copy link
Member

fallion commented May 7, 2020

Hi @CodingJonas,

I'll add some additional debug output tonight or tomorrow. After that I'll help with any issues you might have :)

@fallion
Copy link
Member

fallion commented May 16, 2020

@CodingJonas What is your git_depth variable setting?

@fallion
Copy link
Member

fallion commented May 16, 2020

My guess right now is that it can't get to the commit object here:

commitObject, commitErr := gitRepo.Commit(commitHash)

@CodingJonas
Copy link
Contributor Author

CodingJonas commented May 18, 2020

You are right, when I set the GIT_DEPTH variable, it works. I tried out different values: 1,2,10
It always worked, but it checked a lot more commits than only the ones of the current branch. I'm not sure what the variable is doing. Would you recommend to run this job with the GIT_DEPTH variable set?

@fallion
Copy link
Member

fallion commented May 23, 2020

For now it's a quick fix. I'll look into fixing this.

So what GIT_DEPTH does is that it's the amount of full commit objects it will pull. This is useful on big repositories because you prevent pulling in extra data that you won't need. However the current implementation of the diff engine that commitsar uses relies on these full objects. I will try to find a way to either pull or completely skip this step.

@CodingJonas
Copy link
Contributor Author

Yes, I set GIT_DEPTH to 0, which defaults to fetch the entire history, so everything is working. Thank you!

lfilho pushed a commit to lfilho/sample-webextension that referenced this issue Jun 16, 2020
@lfilho
Copy link

lfilho commented Jun 16, 2020

Hey, I'm using the Github action and having this error. Please see my comment and more details at #167 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants