Np: Fails on first time start with git rev-list error

Created on 6 Jun 2018  ·  16Comments  ·  Source: sindresorhus/np

Issuehunt badges

When run np (v3.0.4) first time on some repo it fails with this output:

Publish a new version of arrgv (current: 0.0.6)

✖ Command failed: git rev-list --tags --max-count=1
usage: git rev-list [OPTION] <commit-id>... [ -- paths... ]
  limiting output:
    --max-count=<n>
    --max-age=<epoch>
...
... and so on

Then if run 'np major' (or other command) it works as usual.

On repos, where np was successfully used before, this problem do not appears.

Maybe it is bug.

itaisteinherz earned $40.00 by resolving this issue!

Rewarded on Issuehunt bug help wanted

All 16 comments

I guess this error occurs due to absence of commits in git commit history.

@ziyaddin unfortunately this error occurs even if there is few commits in git commit history. But this error does not occurs if there is at least one tag.

I can confirm I was faced with the same issue when trying to run np on its own. Providing an argument like np 0.1.0 seems to have solved the issue in my case.

Hey folks, also just bumped into this error in a repo in which I have never used np before.

I tried to just run npx np from a repo that currently has no tags, and which I've manually published the repo to npm once. Can't think of any other discerning features of this repo.

I had a look at the error message that git provides & it seems the <commit-id> argument is missing.

✖ Command failed: git rev-list --tags --max-count=1
usage: git rev-list [OPTION] <commit-id>... [ -- paths... ]

(...confirmed by running git rev-list --tags --max-count=1 manually)

An obvious commit id would be HEAD, as in git rev-list --tags --max-count=1 HEAD, which does give me some kind of hash - I don't know if that is the correct behavior, but I hope that's helpful for anyone who might want to fix this :)

Thanks to Sindre & the squad for this awesome module ✌️

@jjperezaguinaga solution works for me

@issuehuntfest has funded $40.00 to this issue. See it on IssueHunt

Is this still an issue? It should have been fixed in #322 (@sindresorhus I didn't submit the PR to IssueHunt for this issue, but in case it fixed it I can do so).

@itaisteinherz, it still not working for me. 3.1.0.

@astur Can you try again using the latest version from GitHub (i.e. npm install --global sindresorhus/np)?

@itaisteinherz, it works great with latest version from GitHub.

@astur Great 👍🏻 @sindresorhus I'm going to submit #322 to IssueHunt as a PR which fixes this since it seems to be the case here. Also, I think this can be closed now.

@itaisteinherz has submitted a pull request. See it on IssueHunt

@itaisteinherz what about wait for fixed npm package before close this issue?

@astur A new version with the fix included has already been released - v4.0.0.

@itaisteinherz thanks

@sindresorhus has rewarded $36.00 to @itaisteinherz. See it on IssueHunt

  • :moneybag: Total deposit: $40.00
  • :tada: Repository reward(0%): $0.00
  • :wrench: Service fee(10%): $4.00
Was this page helpful?
0 / 5 - 0 ratings

Related issues

nickthesing picture nickthesing  ·  5Comments

inker picture inker  ·  4Comments

voxpelli picture voxpelli  ·  5Comments

jescalan picture jescalan  ·  3Comments

dotconnor picture dotconnor  ·  4Comments