crashappsec / chalk

Chalk allows you to follow code from development, through builds and into production.
https://crashoverride.com/
GNU General Public License v3.0
322 stars 11 forks source link

chalk incorrectly handles empty commit message, and annotated tag with empty message #353

Closed ee7 closed 2 weeks ago

ee7 commented 2 weeks ago

Example

Create an annotated tag with an empty message, then report on it:

git tag -a 1.2.3 -m ''
chalk insert foo

Expected behavior

The operation is successful, and the chalk report contains tag-related keys.

Observed behavior

Chalk outputs warnings, something like:

warn:  unable to retrieve Git ref data: 3f1bbc7b19cee603a52c61eb42203cf60bdfcb7e due to: index -1 not in 0 .. 136
warn:  1.2.3: Git tag couldn't be loaded

and chalk report omits the tag-related keys.

Other Information

The impact is just for annotated tags with an empty tag message. I believe that's a completely legitimate/supported thing to do (e.g. from a rationale of the tag message not being the best place to write things, and then not wanting to repeat yourself), but probably not extremely common.

Occurs with:

miki725 commented 2 weeks ago

can commit messages be empty as well? if so we might might have similar issue there as well

ee7 commented 2 weeks ago

can commit messages be empty as well?

Yes. With:

git commit --allow-empty-message -m ''