You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This may be a known/expected behaviour, based on the logic and todo comment, but I thought it'd be worth reporting since it has surprised me once or twice, and I don't find existing bugreports about it.
When running porcelain.describe on a repository that contains no annotated git tags, the abbrev argument (prefix-length to return from the git commit ID) appears to be ignored and the output includes a commit prefix length of 7 (the default).
For example, to replicate this:
$ git clone https://github.com/jelmer/dulwich/ &&cd dulwich
$ fortagin$(git tag -l);do git tag --delete ${tag};done;
$ PYTHONPATH=. python3
Python 3.12.8 (main, Dec 13 2024, 13:19:48) [GCC 14.2.0] on linux
Type "help", "copyright", "credits" or "license"for more information.
>>> from dulwich import porcelain
>>> porcelain.describe(".", abbrev=10)
'g77c2d8d'
When an annotated tag exists in the history, a correctly-abbreviated commit prefix is produced (along with the expected contextual formatting describing the tag it relates to).
$ git tag testing a029d7b2cc83c26a53d8b2a24fa12c340fcfac59 --annotate --message "Archaeology Today"
$ PYTHONPATH=. python3
Python 3.12.8 (main, Dec 13 2024, 13:19:48) [GCC 14.2.0] on linux
Type "help", "copyright", "credits" or "license"for more information.
>>> from dulwich import porcelain
>>> porcelain.describe(".", abbrev=10)
'testing-4746-g77c2d8d106'
Would it be acceptable to offer a patch to pass the abbrev parameter to the find_unique_abbrev method, even if the todo task isn't completed as part of that?
The text was updated successfully, but these errors were encountered:
Hello,
This may be a known/expected behaviour, based on the logic and
todo
comment, but I thought it'd be worth reporting since it has surprised me once or twice, and I don't find existing bugreports about it.When running
porcelain.describe
on a repository that contains no annotatedgit
tags, theabbrev
argument (prefix-length to return from thegit
commit ID) appears to be ignored and the output includes a commit prefix length of7
(the default).For example, to replicate this:
When an annotated tag exists in the history, a correctly-abbreviated commit prefix is produced (along with the expected contextual formatting describing the tag it relates to).
Would it be acceptable to offer a patch to pass the
abbrev
parameter to thefind_unique_abbrev
method, even if thetodo
task isn't completed as part of that?The text was updated successfully, but these errors were encountered: