René's URL Explorer Experiment


Title: Fix up checks in Makefile and make them portable by EliahKagan · Pull Request #1661 · gitpython-developers/GitPython · GitHub

Open Graph Title: Fix up checks in Makefile and make them portable by EliahKagan · Pull Request #1661 · gitpython-developers/GitPython

X Title: Fix up checks in Makefile and make them portable by EliahKagan · Pull Request #1661 · gitpython-developers/GitPython

Description: Fixes #1660 In .gitattributes: Fix checking out init-tests-after-clone.sh with LF line endings on all systems (this was broken). Add Makefile to so it is also checked out with LF line endings on all systems. (Windows ports of make will usually tolerate CRLF line endings, but \r or other representations of CR may, and often do, appear in output, giving an appearance of a problem that is hard to dismiss. So it's worth keeping it LF.) For the force_release target: Don't try to upload if building failed (#1660). Only suggest using a virtual environment to solve a failure that occurred outside of one. In a virtual environment, use python, not python3, for compatibility with Windows. (Windows may have a python3 command installed outside the virtual environment, which is the most confusing case, since it gets used even from inside, so it feels like installing packages in the venv had no effect. In contrast, some Debian and derived systems, and some macOS systems, have no python command outside a venv, or it's Python 2. So keep using python3 when no venv is detected.) For the release target: Reference the current commit as HEAD rather than head. HEAD is more portable, because git does not treat names case-insensitively by default on all systems. head works on Windows and I think macOS, but not GNU/Linux or most other Unix-like systems. Use git tag --sort=-v:refname with an appropriate versionsort.suffix to order the version tags in the specific SemVer-inspired way this project uses, and a glob to omit the non-version tags. This avoids the correctness problem with the | sort -nr approach, is portable, and is more precise for this project's versions than even nonportable sort -V tweaked for SemVer, because this project has SemVer suffixes like -pre where N-pre sorts before N, but also non-SemVer -patched where N-patched sorts after N. (Thanks to @hugovk for investigating what sort -nr was doing on macOS!) Decrease duplication of complex git commands and pipelines. Write the checks to fail if a command in $( ) fails (by extracting them to assignments), so that if a git command whose output is needed fails, this doesn't cause a check to wrongly succeed. Check for VERSION and changes.rst, against each other and also the latest tag name. Check for uncommitted changes. Do the version/tag/reference agreement check after printing out a table showing all the relevant values, so the specific problems can always be efficiently identified. The above includes checks for indications that each of the actions listed in the README.md release instructions was done, and is intended to make it so make release is correct, fully usable, and preferable to make force_release in most situations. I have tested this on Ubuntu and Windows. When testing, I pressed Ctrl+C when twine prompted for credentials. I tested both the release and force_release targets. Some of the manual tests of the release target on Ubuntu can be seen in this original gist from before that review, and this newer gist testing build-release.sh. Although not shown in those gists, I have also tested that the Makefile targets use the scripts correctly since extracting commands to them. Here's an example of output from make release showing various checks and the new version/tag/ref table and failing with an error due to an inconsistency that should block the release: (.venv) ek@Glub:~/repos-wsl/GitPython (portable-makefile=)$ make release rm -rf build/ dist/ .eggs/ .tox/ ./check-version.sh Checking current directory. Checking that VERSION and doc/source/changes.rst exist and have no uncommitted changes. Checking that ALL changes are committed. Gathering current version, latest tag, and current HEAD commit info. VERSION file = 3.1.36 changes.rst = 3.1.36 Latest tag = 3.1.36 HEAD SHA = 4b7d7028193d3a03cc20867fa534e21528886f51 Latest tag SHA = 5297f6210f185c9df9c97392ffef4da8562b58ff ./check-version.sh: Check failed. Stopping. make: *** [Makefile:10: release] Error 1 Here's an example of a failure where it doesn't get anywhere near that far: (.venv) ek@Glub:~/repos-wsl/GitPython (portable-makefile +=)$ make release rm -rf build/ dist/ .eggs/ .tox/ ./check-version.sh Checking current directory. Checking that VERSION and doc/source/changes.rst exist and have no uncommitted changes. M VERSION ./check-version.sh: Check failed. Stopping. make: *** [Makefile:10: release] Error 1

Open Graph Description: Fixes #1660 In .gitattributes: Fix checking out init-tests-after-clone.sh with LF line endings on all systems (this was broken). Add Makefile to so it is also checked out with LF line endings on a...

X Description: Fixes #1660 In .gitattributes: Fix checking out init-tests-after-clone.sh with LF line endings on all systems (this was broken). Add Makefile to so it is also checked out with LF line endings on a...

Opengraph URL: https://github.com/gitpython-developers/GitPython/pull/1661

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:c7af8279-10c8-ec82-0310-02dc04b10278
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB4D6:2C49D6:4B0B:5C17:69688A27
html-safe-noncedc5d5be7b744beba3c8daf6963d0b74a71c6ef5f0752d1116284f891cfba8491
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNEQ2OjJDNDlENjo0QjBCOjVDMTc6Njk2ODhBMjciLCJ2aXNpdG9yX2lkIjoiNjQxMDUyMjk3MDYzODgxMzczNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac19df10da351e791d38fdbbbb8a002f5c16eb1370781b1ae472938d8453d280c6
hovercard-subject-tagpull_request:1513956097
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/gitpython-developers/GitPython/pull/1661/files
twitter:imagehttps://avatars.githubusercontent.com/u/1771172?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1771172?s=400&v=4
og:image:altFixes #1660 In .gitattributes: Fix checking out init-tests-after-clone.sh with LF line endings on all systems (this was broken). Add Makefile to so it is also checked out with LF line endings on a...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None50f46dc2d6192249fd8ebf20e76c800f4f2596d4a5f3ab63dd63a754df154f54
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/gitpython-developers/GitPython git https://github.com/gitpython-developers/GitPython.git
octolytics-dimension-user_id503709
octolytics-dimension-user_logingitpython-developers
octolytics-dimension-repository_id1126087
octolytics-dimension-repository_nwogitpython-developers/GitPython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1126087
octolytics-dimension-repository_network_root_nwogitpython-developers/GitPython
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasefef287f17234b4529a4b112a3d47fe8551e32ddd
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/gitpython-developers/GitPython/pull/1661/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgitpython-developers%2FGitPython%2Fpull%2F1661%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgitpython-developers%2FGitPython%2Fpull%2F1661%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=gitpython-developers%2FGitPython
Reloadhttps://github.com/gitpython-developers/GitPython/pull/1661/files
Reloadhttps://github.com/gitpython-developers/GitPython/pull/1661/files
Reloadhttps://github.com/gitpython-developers/GitPython/pull/1661/files
gitpython-developers https://github.com/gitpython-developers
GitPythonhttps://github.com/gitpython-developers/GitPython
Please reload this pagehttps://github.com/gitpython-developers/GitPython/pull/1661/files
Notifications https://github.com/login?return_to=%2Fgitpython-developers%2FGitPython
Fork 964 https://github.com/login?return_to=%2Fgitpython-developers%2FGitPython
Star 5k https://github.com/login?return_to=%2Fgitpython-developers%2FGitPython
Code https://github.com/gitpython-developers/GitPython
Issues 169 https://github.com/gitpython-developers/GitPython/issues
Pull requests 8 https://github.com/gitpython-developers/GitPython/pulls
Discussions https://github.com/gitpython-developers/GitPython/discussions
Actions https://github.com/gitpython-developers/GitPython/actions
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/gitpython-developers/GitPython/security
Please reload this pagehttps://github.com/gitpython-developers/GitPython/pull/1661/files
Insights https://github.com/gitpython-developers/GitPython/pulse
Code https://github.com/gitpython-developers/GitPython
Issues https://github.com/gitpython-developers/GitPython/issues
Pull requests https://github.com/gitpython-developers/GitPython/pulls
Discussions https://github.com/gitpython-developers/GitPython/discussions
Actions https://github.com/gitpython-developers/GitPython/actions
Security https://github.com/gitpython-developers/GitPython/security
Insights https://github.com/gitpython-developers/GitPython/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fgitpython-developers%2FGitPython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fgitpython-developers%2FGitPython%2Fissues%2Fnew%2Fchoose
Byronhttps://github.com/Byron
gitpython-developers:mainhttps://github.com/gitpython-developers/GitPython/tree/main
EliahKagan:portable-makefilehttps://github.com/EliahKagan/GitPython/tree/portable-makefile
Conversation 8 https://github.com/gitpython-developers/GitPython/pull/1661
Commits 18 https://github.com/gitpython-developers/GitPython/pull/1661/commits
Checks 0 https://github.com/gitpython-developers/GitPython/pull/1661/checks
Files changed https://github.com/gitpython-developers/GitPython/pull/1661/files
Please reload this pagehttps://github.com/gitpython-developers/GitPython/pull/1661/files
Fix up checks in Makefile and make them portable https://github.com/gitpython-developers/GitPython/pull/1661/files#top
Show all changes 18 commits https://github.com/gitpython-developers/GitPython/pull/1661/files
6fb2318 Reference HEAD in Makefile (more portable than head) EliahKagan Sep 11, 2023 https://github.com/gitpython-developers/GitPython/pull/1661/commits/6fb231828ea845e7f0b80e52280f3efb98a25545
335d03b Have Makefile use git tag to sort the tags EliahKagan Sep 11, 2023 https://github.com/gitpython-developers/GitPython/pull/1661/commits/335d03b174569b4bc840e2020886a5f65adc56b7
b1c61d9 Make "git tag" sort our SemVer-ish tags correctly EliahKagan Sep 13, 2023 https://github.com/gitpython-developers/GitPython/pull/1661/commits/b1c61d933d36a8e7fb6fb4109d2b07bd06bfbf32
cc202cc Improve when and how Makefile suggests virtual env EliahKagan Sep 13, 2023 https://github.com/gitpython-developers/GitPython/pull/1661/commits/cc202cc0fcbbb365e86a8dbc99bb5d6381619671
b54c346 Use "python" in the virtual env, "python3" outside EliahKagan Sep 13, 2023 https://github.com/gitpython-developers/GitPython/pull/1661/commits/b54c34647bf6281d7f5f757d9850484bdb25f800
ae9405a LF line endings for scripts that may need them EliahKagan Sep 13, 2023 https://github.com/gitpython-developers/GitPython/pull/1661/commits/ae9405a339e7b01fb539e1837e4c3f450250cfb7
f5da163 Have "make release" check other release preconditions EliahKagan Sep 13, 2023 https://github.com/gitpython-developers/GitPython/pull/1661/commits/f5da163bed2ababec006c0806187070341cc390e
5cf7f97 Fix non-venv branch always failing EliahKagan Sep 13, 2023 https://github.com/gitpython-developers/GitPython/pull/1661/commits/5cf7f9777bc3f5bb92c57116071fd2bed3ac0b70
6495d84 Extract checks from release target to script EliahKagan Sep 14, 2023 https://github.com/gitpython-developers/GitPython/pull/1661/commits/6495d84142b60ba81a5b4268a0dfc0785c22d60a
4b1c564 Extract build from force_release target to script EliahKagan Sep 14, 2023 https://github.com/gitpython-developers/GitPython/pull/1661/commits/4b1c56409e905b852e3c93de142e109b147eee5e
729372f Prevent buggy interaction between MinGW and WSL EliahKagan Sep 14, 2023 https://github.com/gitpython-developers/GitPython/pull/1661/commits/729372f6f87639f0c4d8211ee7d173100117a257
ba84db4 Fix message wording that was opposite of intended EliahKagan Sep 14, 2023 https://github.com/gitpython-developers/GitPython/pull/1661/commits/ba84db487a31c593fe0618a63f80709e405039c9
de40e68 Ignore some other virtual environment directories EliahKagan Sep 14, 2023 https://github.com/gitpython-developers/GitPython/pull/1661/commits/de40e6864d5cbf8cd604b6f718b876c4d8c5a323
693d041 make `.gitattributes` file more generic Byron Sep 15, 2023 https://github.com/gitpython-developers/GitPython/pull/1661/commits/693d041869497137085171cdabbaf43e33fb9c84
962f747 submodules don't contribute to the release; ignore their changes Byron Sep 15, 2023 https://github.com/gitpython-developers/GitPython/pull/1661/commits/962f747d9c2a877e70886f2ebee975b9be4bb672
d18d90a Use 'echo' where possible to avoid explicit newlines Byron Sep 15, 2023 https://github.com/gitpython-developers/GitPython/pull/1661/commits/d18d90a2c04abeff4bcc8d642fcd33be1c1eb35b
5919f8d Be explicit on how to interpret the data table Byron Sep 15, 2023 https://github.com/gitpython-developers/GitPython/pull/1661/commits/5919f8d04bccfaf0c98ae032437635d1a2de656b
1e0b3f9 refinements to `build-reelase.sh` Byron Sep 15, 2023 https://github.com/gitpython-developers/GitPython/pull/1661/commits/1e0b3f91f6dffad6bfc262528c14bf459c6a63c8
Clear filters https://github.com/gitpython-developers/GitPython/pull/1661/files
Please reload this pagehttps://github.com/gitpython-developers/GitPython/pull/1661/files
Please reload this pagehttps://github.com/gitpython-developers/GitPython/pull/1661/files
.gitattributes https://github.com/gitpython-developers/GitPython/pull/1661/files#diff-618cd5b83d62060ba3d027e314a21ceaf75d36067ff820db126642944145393e
.gitignore https://github.com/gitpython-developers/GitPython/pull/1661/files#diff-bc37d034bad564583790a46f19d807abfe519c5671395fd494d8cce506c42947
Makefile https://github.com/gitpython-developers/GitPython/pull/1661/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52
build-release.sh https://github.com/gitpython-developers/GitPython/pull/1661/files#diff-56d440968971bab627980eb075620a7939bc1d91395d9f6c5d4814277dd3ff47
check-version.sh https://github.com/gitpython-developers/GitPython/pull/1661/files#diff-1d636aeb91861725876870b28214bb3c0100b2c87206b5ba121cb343065f778d
.gitattributeshttps://github.com/gitpython-developers/GitPython/pull/1661/files#diff-618cd5b83d62060ba3d027e314a21ceaf75d36067ff820db126642944145393e
View file https://github.com/EliahKagan/GitPython/blob/1e0b3f91f6dffad6bfc262528c14bf459c6a63c8/.gitattributes
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/gitpython-developers/GitPython/pull/1661/{{ revealButtonHref }}
.gitignorehttps://github.com/gitpython-developers/GitPython/pull/1661/files#diff-bc37d034bad564583790a46f19d807abfe519c5671395fd494d8cce506c42947
View file https://github.com/EliahKagan/GitPython/blob/1e0b3f91f6dffad6bfc262528c14bf459c6a63c8/.gitignore
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/gitpython-developers/GitPython/pull/1661/{{ revealButtonHref }}
https://github.com/gitpython-developers/GitPython/pull/1661/files#diff-bc37d034bad564583790a46f19d807abfe519c5671395fd494d8cce506c42947
Makefilehttps://github.com/gitpython-developers/GitPython/pull/1661/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52
View file https://github.com/EliahKagan/GitPython/blob/1e0b3f91f6dffad6bfc262528c14bf459c6a63c8/Makefile
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/gitpython-developers/GitPython/pull/1661/{{ revealButtonHref }}
https://github.com/gitpython-developers/GitPython/pull/1661/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52
build-release.shhttps://github.com/gitpython-developers/GitPython/pull/1661/files#diff-56d440968971bab627980eb075620a7939bc1d91395d9f6c5d4814277dd3ff47
View file https://github.com/EliahKagan/GitPython/blob/1e0b3f91f6dffad6bfc262528c14bf459c6a63c8/build-release.sh
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/gitpython-developers/GitPython/pull/1661/{{ revealButtonHref }}
check-version.shhttps://github.com/gitpython-developers/GitPython/pull/1661/files#diff-1d636aeb91861725876870b28214bb3c0100b2c87206b5ba121cb343065f778d
View file https://github.com/EliahKagan/GitPython/blob/1e0b3f91f6dffad6bfc262528c14bf459c6a63c8/check-version.sh
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/gitpython-developers/GitPython/pull/1661/{{ revealButtonHref }}
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.