-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Crash if there's a tag on the root commit #14
Comments
That's an interesting find! I was able to reproduce it on Windows using both Git 2.27.0 and 2.31.1 (the latest). I can reproduce it with $ git init
Initialized empty Git repository in C:/tmp/repro/.git/
$ git commit --allow-empty -m init
[master (root-commit) bc54978] init
$ git log --simplify-by-decoration
$ git log
commit d7814029effeb7e824e480ca52e30f5a9d1e8058 (HEAD -> master)
Author: mtkennerly <[email protected]>
Date: Fri Apr 16 19:48:06 2021 -0400
init However, the issue does not occur if the first commit is non-empty: $ git init
Initialized empty Git repository in C:/tmp/repro2/.git/
$ echo hi > foo.txt
$ git add .
$ git commit -m init
[master (root-commit) 35b6427] init
1 file changed, 1 insertion(+)
create mode 100644 foo.txt
$ git log --simplify-by-decoration
commit 35b6427461fe48c0e918dfea2bc5ddab9dc8844d (HEAD -> master)
Author: mtkennerly <[email protected]>
Date: Fri Apr 16 19:51:06 2021 -0400
init
$ git log
commit 35b6427461fe48c0e918dfea2bc5ddab9dc8844d (HEAD -> master)
Author: mtkennerly <[email protected]>
Date: Fri Apr 16 19:51:06 2021 -0400
init I've reported this on the Git mailing list here: https://lore.kernel.org/git/CAKqNo6TFudrXnuPzQcOaVQrRpq_0K_fxyyMA5god-WQL7y=RcQ@mail.gmail.com/ . If you ever want to report something to them in the future, you just have to send a plain-text email to the address listed on this page: https://git.wiki.kernel.org/index.php/GitCommunity If they confirm that it's a bug, and given the limited scope of where it can occur, I would probably just add a note to the README in the meantime. |
Thanks :) Thanks for posting to the git ML! |
No progress on the mailing list report yet, but I've updated the documentation, so I'll go ahead and close this for now. |
Description
Dunamai crashes if there's a tag on the root git commit
It seems there's a bug in git that prevents it from listing a tag in
git log --simplify-by-decoration
if that tag happens to be of the first commit, but the tag still appears ingit tags --list
. Consequently,commit_offset
fails with a runtime error because the tag cannot be found.I'll let you be the judge of whether you want to fix or wait for a proper upstream fix
Workaround
The workaround for me will be to delete my root tag. It wasn't 100% useful anyway, but I didn't expect I'd have to delete it.
Additional info
I spent 20 minutes failing to determine whether this was fixed in recent git version, or at least a known bug in git, let alone reporting it. This is an open source investement I'm not ready to make :D
Reference
The text was updated successfully, but these errors were encountered: