Initial Version Creation Fails on Some Git Repositories
See original GitHub issueSummary
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
- Create a git repo with an initial commit
- Create a second git repo with a commit and some history
- 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:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@edbzn friendly ping. Engineers on our repo are having to manually create a tag when adding new libraries. This is not a good experience 🙈
I was also noticing that the initial creation was failing unless I manually created a
CHANGELOG.mdfor each project.