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

git describe showing old version? #382

Open
DAC324 opened this issue Jun 21, 2022 · 3 comments
Open

git describe showing old version? #382

DAC324 opened this issue Jun 21, 2022 · 3 comments

Comments

@DAC324
Copy link

DAC324 commented Jun 21, 2022

Hello,

according to tutorials I found on the net, it should be possible to obtain the version of a git branch using the following command:

git clone https://github.com/atom-community/atom.git
cd atom
git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'

However, this command does not show the current version (1.63-dev if I am not mistaken) but something older:

$ git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
v1.6.0.beta0.r11309.g05d408fdf
$ git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
1.35.0.r2688.g05d408fdf

Please let me kindly ask you for advice.

@DeeDeeG
Copy link
Member

DeeDeeG commented Jun 21, 2022

We haven't been pushing the tags from upstream to this repo lately.

Edit: I can do that now, I guess. Good to have record of all of what upstream was up to. And it'll make sure we don't post conflicting tags. I hope it doesn't start a flood of CI runs. I'll look out for that, just in case.

Also, we have hundreds of commits which aren't technically in upstream. (Even if some of the work has actually been merged over at upstream, it was usually on separate, rebased branches. So git would see them as totally unique commits.) Not sure if that complicates use of git describe.

The fork hasn't really been tagging releases, so much as working with upstream until now, and putting changes in master branch. That could change, given upstream is not receiving any input or action from maintainers as far as I can tell, and will be fully archived in December.

Edit 2: Additionally, upstream never tagged anything newer than v1.61.0-beta0. So that is the most recent thing that's going to show.

By default (without --all or --tags) git describe only shows annotated tags.
For more information about creating annotated tags see the -a and -s options to git-tag(1).

Upstream apparently has not been in the habit of creating annotated tags. In my experience, annotated tags are a git feature that is rarely used in open-source.

@DAC324
Copy link
Author

DAC324 commented Jun 21, 2022

Thanks a lot.

Meanwhile, I use the following code for obtaining atom version:

  atom_version=$(node -e 'console.log(require("./package").version)')
  # To strip ".dev" from the package version, comment out the line above, and uncomment the line below.
  # atom_version=$(node -e 'console.log(require("./package").version)' | grep -o '[0-9.]*')
  atom_version_base_commit=$(git log --oneline | grep $atom_version | grep -o "[0-f]* ")
  # If the command on the line above doesn't find a "base" commit on `master` branch for the current Atom version,
  # then the latest commit on `master` branch will be tagged instead, and revisions (".r") in the package version will be "0".
  git tag -f $atom_version $atom_version_base_commit
  # Remove 'v' prefix on tags; prefix revision with 'r'; replace all '-' with '.'
  git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'

@iamunadike
Copy link

@DeeDeeG YOU HAVE SPOKEN WELL
CAN WE INTRODUCE @Sadick235 and @DaRanga from the last repo so they are aware this is the backup repo incase microsoft archives atom/atom

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants