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

Fix wrong base tag used for deployment and displayed in About dialog #4070

Merged
merged 1 commit into from
Jul 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix wrong base tag used for deployment and displayed in About dialog
By default, `git describe` shows the number of commits from the latest
tag in the git history. In our case we don't want that, because this can
cause problems:

            2.4-alpha              Expected: 2.4-alpha-N-abcdef123
    main ---+X---------------+---> Actual: 2.3.0-M-abcdef456
             \              /
              X------------X--->
             2.3-beta     2.3.0

Hence, we need to add the `--first-parent` flag to git describe, so that
it only follows the first parent of a merge and does not pull in tags
from another branch.

Fixes mixxxdj/website#248.

See the issue for details: mixxxdj/website#248
  • Loading branch information
Holzhaus committed Jul 7, 2021
commit 9d7b783717ce9f4f8e09f7d0fccc5a9766ff9823
2 changes: 1 addition & 1 deletion cmake/modules/GitInfo.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Get the current commit ref
if(NOT GIT_DESCRIBE)
execute_process(
COMMAND git describe --tags --always --dirty=-modified
COMMAND git describe --tags --always --first-parent --dirty=-modified
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
OUTPUT_VARIABLE GIT_DESCRIBE
OUTPUT_STRIP_TRAILING_WHITESPACE
Expand Down
8 changes: 7 additions & 1 deletion tools/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,13 @@ def git_info(info, path="."):
elif info == "describe":
# A dirty git state should only be possible on local builds, but since
# this script may be used locally we'll add it here.
cmd = ("git", "describe", "--always", "--dirty=-modified")
cmd = (
"git",
"describe",
"--always",
"--first-parent",
"--dirty=-modified",
)
else:
raise ValueError("Invalid git info type!")

Expand Down