nschlia / ffmpegfs

FUSE-based transcoding filesystem with video support from many formats to FLAC, MP4, TS, WebM, OGG, MP3, HLS, and others.
https://nschlia.github.io/ffmpegfs/
GNU General Public License v3.0
198 stars 14 forks source link

Version tag in `git describe` and `git describe --tags` are out of date and inconsistent with each other. #98

Closed dreirund closed 2 years ago

dreirund commented 2 years ago

git describe and git describe --tags on the latest git checkout provide version strings which are not in sync with each other and with what ffmpegfs --version says.

Currently, version of the latest git checkout is at 2.7 (ffmpegfs --version says so), but the git describe commands yield:

git describe or git describe --tags is quite commonly used in e.g. Arch Linux AUR packages to determine version, e.g. → package ffmpegfs-git. So I suggest to either somehow implement a way that they are automatically kept in sync with the version, or are not present at all.

In the end, It looks for me that the real version information can be extracted from the line which currently reads AC_INIT([FFMPEGFS], [2.7]) in the file configure.ac.

(→ here I have provided a note on this to the Arch Linux AUR package ffmpegfs-git.)

nschlia commented 2 years ago
* `git describe`: `v0.91-2093-g8bf2856f`
* `git describe --tags`: `V2.5-56-g8bf2856f`

Interesting, 8bf2856f is the last commit (as of now) and apparently neither v0.91 or V2.5 are the latest tags.

Doing the terse and comprehensible command

git for-each-ref --sort=creatordate --format '%(refname) %(creatordate)' refs/tags

returns a list sorted by date, ending with

refs/tags/V2.5 Fri Jun 18 12:54:44 2021 +0200 
refs/tags/v2.4 Sat Sep 4 16:37:35 2021 +0200
refs/tags/v2.6 Sat Sep 4 16:43:23 2021 +0200

You see me thumped. I do not know why GIT does that. It should return something like git describe --tags: V2.6-XX-g8bf2856f.

Sorry, GIT is giving me the creeps on a regular basis.

dreirund commented 2 years ago

I am not familiar with git at all that goes beyond clone, checkout, branch switching, so I cannot help.

Since I see repositories that return nothing on git describe, others that return nothing on git describe but something at git describe --tags, I assumed so far that the information given there it is manual input which needs to be done by the user (or a automagication-script which need to provided by the user).

Doing the terse and comprehensible command

git for-each-ref --sort=creatordate --format '%(refname) %(creatordate)' refs/tags

returns a list sorted by date, ending with

refs/tags/V2.5 Fri Jun 18 12:54:44 2021 +0200 
refs/tags/v2.4 Sat Sep 4 16:37:35 2021 +0200
refs/tags/v2.6 Sat Sep 4 16:43:23 2021 +0200

That seems to be sorted by latest commit date.

git tag lists also the tags, up to v2.6.

If I do git checkout FB and then do git describe --tags, I get v2.6-32-gdd4a9390 (where gdd4a9390 obviously also is not g8bf2856f, but at least it says 2.6).

You see me thumped. I do not know why GIT does that.

I have no idea even what that tags means at all and what is behind git describe.

If I do a git tag 2.6 and then a git describe --tags, I get 2.6 as return. So maybe somewhere in the commit procedure explicit tag handling needs to be done?

-- Most bacteria have the decency to be microscopic. Epulopiscium fishelsoni is not among them. The newly identified one-celled macro-microorganism is a full .5 mm long, large enough to be seen with the naked eye. Described in the current Nature, "It is a million times as massive as a typical bacterium."

nschlia commented 2 years ago

I am not familiar with git at all that goes beyond clone, checkout, branch switching, so I cannot help.

Well, metoo... I cannot tell you here what I think about GIT without being barred for bad language.

Anyways, if you do a git pull --tags -f you'll get updated tags now. Both git describe --tags and git describe return V2.5-56-g8bf2856f now. Seems that this is because I created the 2.6 tag in a different branch, I'll check to see how to fix that.

I created all tags with Github. Obviously git describe refers to the last annotated tag. I thought Github would only create such tags. Dunno what it does precisely here.

nschlia commented 2 years ago

OK, seems that git describe returns tags from the same branch only. v2.6 was created in a different one (FB),

To show the latest tag from all branches this concise command helps:

git describe --tags `git rev-list --tags --max-count=1`

See https://gist.github.com/rponte/fdc0724dd984088606b0

I guess this is not a bug, its a GIT feature. The next tag will be created in master and then it will be visible.

Oh how I hate GIT.