jimporter / mike

Manage multiple versions of your MkDocs-powered documentation via Git
BSD 3-Clause "New" or "Revised" License
511 stars 45 forks source link

Add `--` to `count_reachable` cmd #218

Closed ringohoffman closed 1 month ago

ringohoffman commented 2 months ago

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
ringohoffman commented 2 months ago

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

qthequartermasterman commented 1 month ago

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

jimporter commented 1 month ago

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

ringohoffman commented 1 month ago

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

jimporter commented 1 month ago

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.

jimporter commented 3 weeks ago

As there haven't been any new issues reported in a while, I've tagged this as v2.1.2 and published to PyPI and all that.