René's URL Explorer Experiment


Title: Init script presents challenges on some platforms · Issue #1691 · gitpython-developers/GitPython · GitHub

Open Graph Title: Init script presents challenges on some platforms · Issue #1691 · gitpython-developers/GitPython

X Title: Init script presents challenges on some platforms · Issue #1691 · gitpython-developers/GitPython

Description: The script for preparing the repository to be used to run tests, init-tests-after-clone.sh, can be hard to use, or to understand how to use, on some platforms. Running it on Windows It is unclear from the script and the current documenta...

Open Graph Description: The script for preparing the repository to be used to run tests, init-tests-after-clone.sh, can be hard to use, or to understand how to use, on some platforms. Running it on Windows It is unclear f...

X Description: The script for preparing the repository to be used to run tests, init-tests-after-clone.sh, can be hard to use, or to understand how to use, on some platforms. Running it on Windows It is unclear f...

Opengraph URL: https://github.com/gitpython-developers/GitPython/issues/1691

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Init script presents challenges on some platforms","articleBody":"The script for preparing the repository to be used to run tests, `init-tests-after-clone.sh`, can be hard to use, or to understand how to use, on some platforms.\r\n\r\n### Running it on Windows\r\n\r\nIt is unclear from the script and the current documentation how to run it on Windows. It should typically be invoked from within Git Bash (though another MinGW shell would be okay too). Opening it as a file, including by attempting to run it in PowerShell, may not work at all or may cause it to malfunction. Running it in Cygwin or WSL *for the purpose of developing in those environments* is fine, but that should be avoided if the goal is to prepare the repository for native Windows development. In particular, if the repository is cloned outside WSL, then it should not usually be operated on with `git` from within WSL; doing so can create a strange situation with line endings where every file appears to have been changed locally, and may otherwise use the wrong `git` configuration.\r\n\r\n  I think adding a note to `README.md` about how it can be run in Git Bash on Windows is sufficient to fix this. Other remedies are possible and might be of value, too. For example, a `.cmd` batch file could be created that either is a translation of the script (i.e., does the same things, including accounting for the effect of `set -e` by ending most commands with `|| exit /b`) or invokes the shell script with Git Bash, and if the script's `.sh` suffix is dropped and the batch file is named the same but with `.cmd`, then separate invocation instructions would not be needed (for example, from PowerShell, `./init-tests-after-clone` would run both). This may be better than writing a PowerShell script, which might be helpful but where an execution policy may be set that forbids it from running due to its remote origin. However, especially if the new script (batch file or otherwise) were a translation, this imposes the burden of updating both scripts anytime the logic needs to change. In addition, batch files have some subtleties related to what happens when they are deleted or modified while running (this is allowed, but it affects their behavior!), and since the script performs checkouts and resets, that would need to be taken into account.\r\n\r\n### Running it without `bash`\r\n\r\nThe script is not portable to platforms that don't have any version of `bash` installed anywhere.\r\n\r\nPorting it to `sh` (i.e., using only POSIX shell features and changing the hashbang from `#!/usr/bin/env bash` to `#!/bin/sh`) would fix this. I think this is worthwhile, since its use of non-POSIX features is limited and easy to replace. This differs from the other scripts, which gain greater benefit from `bash` features like `trap` *[edit: this was a misstatement, see [this comment](https://github.com/gitpython-developers/GitPython/issues/1691#issuecomment-1747731293) for clarification]*, and which are run far less often and by fewer people and therefore don't need to be as portable.\r\n\r\n### Manually performing the steps\r\n\r\nIf someone cannot or is not willing to run the script, it would be useful if they could easily inspect it to understand what each command achieves, so they can perform analogous actions themselves, modified if necessary according to their platform and requirements. Currently that is difficult because the script does not contain comments that explain the purpose of the operations it performs.\r\n\r\n### Checking it for correctness and portability\r\n\r\nIt is hard to remain confident that the script runs on the systems and with the interpreters it is believed to run on (currently `bash` but on any system, but this could change as suggested above), because we are not currently using static analysis to scan for incompatibilities with the language specified in the hashbang and to scan for common scripting problems (including nonportable assumptions about standard commands). Setting up [`shellcheck`](https://www.shellcheck.net/) to run as a pre-commit hook and on CI would address this.\r\n\r\nAlthough I think this issue is topically coherent, I think the benefit of adding `shellcheck` (to run automatically) makes it not not map one-to-one into a pull request. Adding `shellcheck` will benefit the other scripts as well. A suppression (or other code change) will be needed in `check-version.sh`, where `$config_opts` is intentionally expanded unquoted to trigger word splitting (and where globbing, which is not desired there, has already been disabled with `set -f`). Manual examination accompanying the introduction of `shellcheck` can identify other areas that might be improved. Most importantly, `shellcheck` is best added *before making further shell script changes*, so that the changes can be checked, and this applies to other changes to the scripts as well, including those for #1690 (which would also affect the instructions for, or around, running the init script, by simplifying them).\r\n\r\n","author":{"url":"https://github.com/EliahKagan","@type":"Person","name":"EliahKagan"},"datePublished":"2023-10-04T02:05:40.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/1691/GitPython/issues/1691"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:b114c4a6-ae20-32c8-62f4-0d82d583296b
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9094:179793:903BF9:C2CCF9:69683748
html-safe-nonce01a222ab4c292dd4a7987ff19d80f7b87fc189b6ad2bc811958b6b7d047c86df
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MDk0OjE3OTc5Mzo5MDNCRjk6QzJDQ0Y5OjY5NjgzNzQ4IiwidmlzaXRvcl9pZCI6IjQ1MDM5NTAzNzMzNDgxOTQxMjAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmace17ef16505c32b1dde9fc483880f986d70e4abf81c989044ad3ad4bb49492437
hovercard-subject-tagissue:1925261300
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/gitpython-developers/GitPython/1691/issue_layout
twitter:imagehttps://opengraph.githubassets.com/c5b7aeb7e9d305b1d75e8e4ff49cf82387f652f5e1dabc860cc09b5cdceddb89/gitpython-developers/GitPython/issues/1691
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/c5b7aeb7e9d305b1d75e8e4ff49cf82387f652f5e1dabc860cc09b5cdceddb89/gitpython-developers/GitPython/issues/1691
og:image:altThe script for preparing the repository to be used to run tests, init-tests-after-clone.sh, can be hard to use, or to understand how to use, on some platforms. Running it on Windows It is unclear f...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameEliahKagan
hostnamegithub.com
expected-hostnamegithub.com
Nonee25f416bb6d8a5f8624aad6cebc375ab2c50ac58f2175f32a7093325e66e5515
turbo-cache-controlno-preview
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
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release32212b8b3bddd6432b3b35d27c050b1c22bd8cca
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/gitpython-developers/GitPython/issues/1691#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgitpython-developers%2FGitPython%2Fissues%2F1691
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%2Fissues%2F1691
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%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=gitpython-developers%2FGitPython
Reloadhttps://github.com/gitpython-developers/GitPython/issues/1691
Reloadhttps://github.com/gitpython-developers/GitPython/issues/1691
Reloadhttps://github.com/gitpython-developers/GitPython/issues/1691
gitpython-developers https://github.com/gitpython-developers
GitPythonhttps://github.com/gitpython-developers/GitPython
Please reload this pagehttps://github.com/gitpython-developers/GitPython/issues/1691
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/issues/1691
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
New issuehttps://github.com/login?return_to=https://github.com/gitpython-developers/GitPython/issues/1691
New issuehttps://github.com/login?return_to=https://github.com/gitpython-developers/GitPython/issues/1691
#1693https://github.com/gitpython-developers/GitPython/pull/1693
Init script presents challenges on some platformshttps://github.com/gitpython-developers/GitPython/issues/1691#top
#1693https://github.com/gitpython-developers/GitPython/pull/1693
acknowledgedhttps://github.com/gitpython-developers/GitPython/issues?q=state%3Aopen%20label%3A%22acknowledged%22
https://github.com/EliahKagan
https://github.com/EliahKagan
EliahKaganhttps://github.com/EliahKagan
on Oct 4, 2023https://github.com/gitpython-developers/GitPython/issues/1691#issue-1925261300
this commenthttps://github.com/gitpython-developers/GitPython/issues/1691#issuecomment-1747731293
shellcheckhttps://www.shellcheck.net/
#1690https://github.com/gitpython-developers/GitPython/issues/1690
acknowledgedhttps://github.com/gitpython-developers/GitPython/issues?q=state%3Aopen%20label%3A%22acknowledged%22
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.