Skip to content

Commit

Permalink
docs: refer only to the current commit
Browse files Browse the repository at this point in the history
The output of `git-describe` is in terms of the latest tag on the
current branch, which can produce surprising results when tags are
distributed across release branches (i.e. `v7.1.0-992-g51300a1a` is the
best it can produce for that commit, even though the latest stable tag
at that point is `v7.1.9`).

It makes more sense to refer only to the commit.
  • Loading branch information
SnoopJ committed Nov 12, 2023
1 parent e1556de commit a755e02
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,8 @@

is_dirty = bool(subprocess.check_output(["git", "status", "--untracked-files=no", "--porcelain"], text=True).strip())
commit_hash = subprocess.check_output(["git", "rev-parse", "HEAD"], text=True).strip()
git_describe = subprocess.check_output(["git", "describe", "--tags"], text=True).strip() + ("-dirty" if is_dirty else "")
github_ref = "https://github.com/sopel-irc/sopel/commit/{commit_hash}".format(commit_hash=commit_hash)
build_info = "(built against `{git_describe} <{github_ref}>`_)".format(git_describe=git_describe, github_ref=github_ref)
build_info = "(built against `{commit_hash} <{github_ref}>`_)".format(commit_hash=commit_hash[:7], github_ref=github_ref)
except Exception as exc:
build_info = "(built against an unknown commit)"

Expand Down

0 comments on commit a755e02

Please sign in to comment.