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

Add -- to count_reachable cmd #218

Conversation

ringohoffman
Copy link
Contributor

I am getting:

error: unable to get number of reachable commits from docs:
  fatal: ambiguous argument 'docs': both revision and filename
  Use '--' to separate paths from revisions, like this:
  'git <command> [<revision>...] -- [<file>...]'
make: *** [.makefiles/docs.mk:24: docs/build-version-release] Error 1

Originating from count_reachable.

My repo is structured s.t. we have both a docs/ folder and a docs branch, leading to the above error. As suggested in the git error message, by adding -- to clarify that we are specifying a revision, I am able to resolve this. I confirmed this by testing locally:

$ git rev-list --count docs
fatal: ambiguous argument 'docs': both revision and filename
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
$ git rev-list --count docs --
2028

Fixes possible ambiguous revision also matching a filename
@ringohoffman
Copy link
Contributor Author

@jimporter could you take a look when you have the chance 🙏🏼

@qthequartermasterman
Copy link

qthequartermasterman commented May 20, 2024

I see a similar problem in one of my private repositories.

@jimporter jimporter closed this in 3f7d756 May 30, 2024
@jimporter
Copy link
Owner

Thanks for the patch. I've merged this along with a few more added -- uses as 3f7d756.

@ringohoffman ringohoffman deleted the clarify-possible-ambiguous-revision-in-count_reachable branch May 30, 2024 18:29
@ringohoffman
Copy link
Contributor Author

@jimporter would you mind cutting a release with this change?

@jimporter
Copy link
Owner

jimporter commented Jun 7, 2024

I prefer to batch point releases so as to keep version churn down (every update has a nonzero risk of breaking downstream projects so I try to reduce the number of times people have to deal with that). If there aren't any other issues reported in the next couple weeks though, I'll tag a new version.

If you need this change sooner, you should be able to point your package manager to the relevant Git SHA for the time being.

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

Successfully merging this pull request may close these issues.

None yet

3 participants