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

<commit-ish> parsing does not follow annotated tag #718

Open
KalleOlaviNiemitalo opened this issue Jan 26, 2022 · 3 comments
Open

<commit-ish> parsing does not follow annotated tag #718

KalleOlaviNiemitalo opened this issue Jan 26, 2022 · 3 comments

Comments

@KalleOlaviNiemitalo
Copy link

I have an annotated tag "1.49.0" and the tag object points to a commit. Now when I run nbgv get-version 1.49.0 using nbgv 3.4.255+06fb9182bf, it fails:

Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Nerdbank.GitVersioning.GitException: An object of type commit could not be located at offset 17101936.
   at Nerdbank.GitVersioning.ManagedGit.GitPackReader.GetObject(GitPack pack, Stream stream, Int64 offset, String objectType, GitPackObjectType packObjectType) in D:\a\1\s\src\NerdBank.GitVersioning\ManagedGit\GitPackReader.cs:line 70
   at Nerdbank.GitVersioning.ManagedGit.GitPack.GetObject(Int64 offset, String objectType) in D:\a\1\s\src\NerdBank.GitVersioning\ManagedGit\GitPack.cs:line 212
   at Nerdbank.GitVersioning.ManagedGit.GitRepository.TryGetObjectBySha(GitObjectId sha, String objectType, Stream& value) in D:\a\1\s\src\NerdBank.GitVersioning\ManagedGit\GitRepository.cs:line 534
   at Nerdbank.GitVersioning.ManagedGit.GitRepository.GetObjectBySha(GitObjectId sha, String objectType) in D:\a\1\s\src\NerdBank.GitVersioning\ManagedGit\GitRepository.cs:line 499
   at Nerdbank.GitVersioning.ManagedGit.GitRepository.GetCommit(GitObjectId sha, Boolean readAuthor) in D:\a\1\s\src\NerdBank.GitVersioning\ManagedGit\GitRepository.cs:line 264
   at Nerdbank.GitVersioning.Managed.ManagedGitContext.TrySelectCommit(String committish) in D:\a\1\s\src\NerdBank.GitVersioning\Managed\ManagedGitContext.cs:line 66
   at Nerdbank.GitVersioning.Tool.Program.OnGetVersionCommand(String project, IReadOnlyList`1 metadata, String format, String variable, String commitish) in D:\a\1\s\src\nbgv\Program.cs:line 385
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseErrorReporting>b__21_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass25_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass23_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__22_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseDirective>b__20_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseDebugDirective>b__11_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__10_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass14_0.<<UseExceptionHandler>b__0>d.MoveNext()
@KalleOlaviNiemitalo
Copy link
Author

nbgv get-version 1.49.0^{} and nbgv get-version 1.49.0^{commit} don't work either ("rev-parse produced no commit"), but those might be covered by #572.

@AArnott
Copy link
Collaborator

AArnott commented Jan 26, 2022

Ya, I'm not at all surprised that the ^{} syntax doesn't work any more. As for the bug with not handling annotated tags, I'm surprised we even try to read them. But we should get this fixed.

@AArnott
Copy link
Collaborator

AArnott commented Jan 26, 2022

@qmfrederik any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants