jgabaut / invil

A Rust implementation of amboso.
https://github.com/jgabaut/amboso
GNU General Public License v3.0
4 stars 0 forks source link

[BUG] C header generation uses HEAD info rather than queried tag #173

Closed jgabaut closed 2 months ago

jgabaut commented 2 months ago

Currently, the -G flag does not correctly use the info of queried git tag, but rather just peels the current repo's HEAD to a commit and fetches info from that.

The correct behaviour to align with amboso is to use the info of queried tag even if current HEAD does not match that status. In any case, the old behaviour would be supported when the passed tag is HEAD, if amboso allows it.

To Reproduce Steps to reproduce the behavior:

  1. Gen an anvil__proj.h header using both invil and amboso on the same commit:
    invil -XG ./src "$my_tag"

    The resulting commit description hashes will not match, because of this code:

Expected behavior

The commit for passed tag argument is reached and its info is used.