Skip to content
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

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

Closed
dreirund opened this issue Nov 4, 2021 · 4 comments
Assignees
Labels

Comments

@dreirund
Copy link

dreirund commented Nov 4, 2021

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: v0.91-2093-g8bf2856f
  • git describe --tags: V2.5-56-g8bf2856f

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.)

@dreirund dreirund changed the title Version tag in git describes is out of date. Version tag in git describe and git describe --tags are out of date and inconsistent with each other. Nov 4, 2021
@nschlia
Copy link
Owner

nschlia commented Nov 4, 2021

* `git describe`: `v0.91-2093-g8bf2856f`
* `git describe --tags`: `V2.5-56-g8bf2856f`

Interesting, 8bf2856 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.

@nschlia nschlia self-assigned this Nov 4, 2021
@dreirund
Copy link
Author

dreirund commented Nov 4, 2021 via email

@nschlia
Copy link
Owner

nschlia commented Nov 4, 2021

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
Copy link
Owner

nschlia commented Nov 4, 2021

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.

@nschlia nschlia closed this as completed Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants