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

Build error when the first commit on a new branch is a cherry pick #133

Closed
GeRooster opened this issue Oct 6, 2020 · 3 comments
Closed

Comments

@GeRooster
Copy link

GitInfo.2.1.2\build\GitInfo.targets(683,3): error : Could not retrieve first commit where branch xxx/yyy forked from master. Defaulting to zero commits.

@kzu kzu added the enhancement label Oct 7, 2020
@kzu kzu closed this as completed in 95bf12f Oct 14, 2020
@kzu
Copy link
Member

kzu commented Oct 14, 2020

The "error" is actually a warning, see https://github.com/kzu/GitInfo/blob/main/src/GitInfo/build/GitInfo.targets#L684.

You most likely have configured your build to treat warnings as errors. I've now added warning codes to all warnings so you can ignore the warnings as needed.

@crypto-rsa
Copy link

We see the warning in our repository, too. We use a different branching model so the git merge-base --fork-point command will always fail. While it is possible to hide the GitInfo warning GI005, we also get a generic warning MSB3073 with a message The command ... exited with code 1 which would be potentially dangerous to hide.
Do you think you could update the build targets so that this warning is not issued, or perhaps add some condition to prevent running the "fork point check" from running altogether?

@kzu
Copy link
Member

kzu commented Oct 15, 2022

As seen in the linked target, the entire target (that's failing for your scenario) is conditioned with: Condition="'$(GitBaseVersion)' == '' And '$(GitIgnoreBranchVersion)' != 'true' ".

So if the behavior in that target shouldn't run for you, just set GitIgnoreBranchVersion=true in your project file.

@devlooped devlooped locked and limited conversation to collaborators Sep 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants