-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
RFC: Simpelify packaging by splitting out collection of git version info #5095
Closed
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d1d1db6
Simpelify packaging by splitting out collection of git version info
ivarne f2d4e8a
Updated make clean
ivarne a6ba1ea
Improved building without git and added NO_GIT make flag
ivarne a23dc0c
Made NO_GIT automatically get correct value based on the existence of…
ivarne 1bed895
Changed NO_GIT mentioning in DISTRIBUTING.md
ivarne e415a2b
Fixed for strange version of echo
ivarne 6e5f8ba
Fix spelling
ivarne File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
/fenv_constants.jl | ||
/file_constants.jl | ||
/uv_constants.jl | ||
/version_git.jl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# This file collects git info and create a julia file with the GIT_VERSION_INFO struct | ||
|
||
echo "# This file was autogenerated in base/version_git.sh" | ||
echo "immutable GitVersionInfo" | ||
echo " commit::String" | ||
echo " commit_short::String" | ||
echo " branch::String" | ||
echo " build_number::Int" | ||
echo " date_string::String" | ||
echo " tagged_commit::Bool" | ||
echo " fork_master_distance::Int" | ||
echo " fork_master_timestamp::Float64" | ||
echo "end" | ||
echo "" | ||
|
||
# If the script didn't ask not to use git info | ||
if [ "$#" = "1" -a "$1" = "NO_GIT" ]; then | ||
# this comment is used in base/Makefile to distinguish boilerplate | ||
echo "# Default output if git is not available." | ||
echo "const GIT_VERSION_INFO = GitVersionInfo(\"\" ,\"\" ,\"\" ,0 ,\"\" ,true ,0 ,0.)" | ||
exit 0 | ||
fi | ||
# Collect temporary variables | ||
origin=$(git config -l 2>/dev/null | grep 'remote\.\w*\.url.*JuliaLang/julia.git' | sed -n 's/remote\.\([a-zA-Z]*\)\..*/\1\//p') | ||
last_tag=$(git describe --tags --abbrev=0) | ||
git_time=$(git log -1 --pretty=format:%ct) | ||
|
||
#collect the contents | ||
commit=$(git rev-parse HEAD) | ||
commit_short=$(git rev-parse --short HEAD) | ||
if [ -n "$(git status --porcelain)" ]; then | ||
# append dirty mark '*' if the repository has uncommited changes | ||
commit_short="$commit_short"* | ||
fi | ||
branch=$(git branch | sed -n '/\* /s///p') | ||
build_number=$(git rev-list --count HEAD ^$last_tag) | ||
|
||
date_string=$git_time | ||
if [ "$(uname)" = "Darwin" ] || [ "$(uname)" = "FreeBSD" ]; then | ||
date_string="$(/bin/date -jr $git_time -u '+%Y-%m-%d %H:%M %Z')" | ||
else | ||
date_string="$(/bin/date --date="@$git_time" -u '+%Y-%m-%d %H:%M %Z')" | ||
fi | ||
if [ $(git describe --tags --exact-match 2> /dev/null) ]; then | ||
tagged_commit="true" | ||
else | ||
tagged_commit="false" | ||
fi | ||
fork_master_distance=$(git rev-list --count HEAD ^"$(echo $origin)master") | ||
fork_master_timestamp=$(git show -s $(git merge-base HEAD $(echo $origin)master) --format=format:"%ct") | ||
|
||
echo "const GIT_VERSION_INFO = GitVersionInfo(" | ||
echo " \"$commit\"," | ||
echo " \"$commit_short\"," | ||
echo " \"$branch\"," | ||
echo " $build_number," | ||
echo " \"$date_string\"," | ||
echo " $tagged_commit," | ||
echo " $fork_master_distance," | ||
echo " $fork_master_timestamp." | ||
echo ")" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These variables
JULIA_COMMIT
andJULIA_VERSION
are almost not used. See https://gist.github.com/ivarne/8130d4cac3aa3e7772eeIt should be the same info that is used in all processes involving version and commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since
JULIA_COMMIT
is only used for file naming, I think it'd be better to just setJULIA_COMMIT = JULIA_VERSION
instead of"Not Available"
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems right