question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Initial Version Creation Fails on Some Git Repositories

See original GitHub issue

Summary

When first running npx nx run <project>:version on some repositories where the command git rev-list --max-parents=0 HEAD returns more than 1 commit, the target fails with a “bad revision” error.

Steps to Recreate

  1. Create a git repo with an initial commit
  2. Create a second git repo with a commit and some history
  3. Use some stack overflow post to merge the two repos together that maintains history for both. The exact post I have unfortunately forgotten. Probably something to do with filter-branch.

Solution

Fix the output of this function so that it will split the results on newlines and just pick the first valid commit SHA. The current code ends up concating all the commit SHAs together resulting in an invalid ref.

Work Arounds

Manually create the first tag with <project>-0.0.1 and not <project>-0.0.0 because using 0.0.0 will result in the plugin trying to find that first commit in the repo.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ianldgscommented, Sep 30, 2022

@edbzn friendly ping. Engineers on our repo are having to manually create a tag when adding new libraries. This is not a good experience 🙈

1reaction
wSedlacekcommented, Nov 28, 2021

I was also noticing that the initial creation was failing unless I manually created a CHANGELOG.md for each project.

Read more comments on GitHub >

github_iconTop Results From Across the Web

git hub repository creation fails
In this case, make sure you remake it with exactly the same name, or update the URL.
Read more >
Troubleshooting cloning errors
If you're having trouble cloning a repository, check these common errors.
Read more >
Git error - Fatal: Not a git repository and how to fix it
This error means you attempted to run a Git command, but weren't inside a Git repository. Make sure you've: Navigated to the right...
Read more >
How to Fix the “fatal: not a git repository” Error
Check that you correctly created the repo. If the directory doesn't contain a .git repo, use git init to properly initialize the repo...
Read more >
Fix Git's 'fatal: repository not found' error quickly
If the repository was deleted or renamed, you'll obviously hit a Git repository not found error when you attempt to clone or fetch...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found