René's URL Explorer Experiment


Title: Init script makes slightly confusing reflog if multiple remotes have "master" · Issue #2145 · gitpython-developers/GitPython · GitHub

Open Graph Title: Init script makes slightly confusing reflog if multiple remotes have "master" · Issue #2145 · gitpython-developers/GitPython

X Title: Init script makes slightly confusing reflog if multiple remotes have "master" · Issue #2145 · gitpython-developers/GitPython

Description: Background This code in the init script runs this to check out the master branch if present and readily available, and other just make a branch called that where we are now: GitPython/init-tests-after-clone.sh Lines 42 to 43 in 7b83f7a #...

Open Graph Description: Background This code in the init script runs this to check out the master branch if present and readily available, and other just make a branch called that where we are now: GitPython/init-tests-af...

X Description: Background This code in the init script runs this to check out the master branch if present and readily available, and other just make a branch called that where we are now: GitPython/init-tests-af...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Init script makes slightly confusing reflog if multiple remotes have \"master\"","articleBody":"#### Background\n\nThis code in the init script runs this to check out the `master` branch if present and readily available, and other just make a branch called that where we are now:\n\nhttps://github.com/gitpython-developers/GitPython/blob/7b83f7a99af4313264650339e08601834b3ca968/init-tests-after-clone.sh#L42-L43\n\nThat is intended to cover, and does cover, the cases where `master` is available locally, or not available locally but available from one remote.\n\nThe `master` branch in GitPython is basically only for testing, and this has been so for some years. The default branch is `main`. The `master` branch is mostly just a ref for testing, and there is a lot of flexibility in where it points. The test suite needs a reflog at least a few entries long, so:\n\nhttps://github.com/gitpython-developers/GitPython/blob/7b83f7a99af4313264650339e08601834b3ca968/init-tests-after-clone.sh#L45-L48\n\nThen `master` is reset to wherever we started anyway. The reason for all this, of course, is that the test suite uses the current repository (of GitPython itself, as well as its submodules) in test fixtures. I think we intend to change that at some point, but it has to be done carefully, so this intended high coupling between the test suite and the local GitPython repository remains for now.\n\n#### When multiple remotes have it\n\nWhen multiple remotes have a `master` branch and no local `master` branch exists, Git configuration determines what happens. But by default, an attempt to switch to a locally absent branch that is to be set up automatically from a remote will refuse to proceed if there is more than one, even if they point to the same commit.\n\nAs a result, we get:\n\n```text\nek@ELIAHKAGAN76BA CLANGARM64 /e/repos/GitPython (main)\n$ ./init-tests-after-clone.sh\nThis operation will destroy locally modified files. Continue ? [N/y]: y\nhint: If you meant to check out a remote tracking branch on, e.g. 'origin',\nhint: you can do so by fully qualifying the name with the --track option:\nhint:\nhint:     git checkout --track origin/\u003cname\u003e\nhint:\nhint: If you'd like to always have checkouts of an ambiguous \u003cname\u003e prefer\nhint: one remote, e.g. the 'origin' remote, consider setting\nhint: checkout.defaultRemote=origin in your config.\nfatal: 'master' matched multiple (2) remote tracking branches\nSwitched to a new branch 'master'\nHEAD is now at c7648c0c Merge pull request #2143 from gitpython-developers/contrbuting\nHEAD is now at 5a294a6f bump version to 3.1.50\nHEAD is now at d7b029f1 Merge pull request #2142 from gitpython-developers/fix-validate-config-key-newlines\nHEAD is now at 7b83f7a9 Merge pull request #2144 from mvanhorn/osc/2016-clarify-execute-string-arg\nSubmodule 'gitdb' (https://github.com/gitpython-developers/gitdb.git) registered for path 'git/ext/gitdb'\nCloning into 'E:/repos/GitPython/git/ext/gitdb'...\nSubmodule path 'git/ext/gitdb': checked out '335c0f66173eecdc7b2597c2b6c3d1fde795df30'\nSubmodule 'smmap' (https://github.com/gitpython-developers/smmap.git) registered for path 'git/ext/gitdb/gitdb/ext/smmap'\nCloning into 'E:/repos/GitPython/git/ext/gitdb/gitdb/ext/smmap'...\nSubmodule path 'git/ext/gitdb/gitdb/ext/smmap': checked out 'c6b53d35deb82a38d5d07ca7712c1334a7a10c10'\nFetching origin\nFetching upstream\nFetching kip\n```\n\nThis is mostly harmless, and arguably completely harmless. The only actual significant effect that would ordinarily occur is that the resets, done to ensure a deep enough reflog for reflog-related tests, are populated from more recent history.\n\nHowever, it is unintuitive that adding (and fetching from) multiple remotes with `master` would affect which reflog entries the init script populates.\n\n#### The fix\n\nIt should be enough to add a comment describing the behavior. There is probably no simple always-right thing to do besides that. It's probably excessively complex to treat the case where all upstream `master` branches reference the same commit specially. The bug, if it can be called that, is in the confusion about what reflog entries are populated.\n\nIf I don't identify any more serious effect of this, then I'll make that change, possibly as part of some larger PR.\n\n#### Meta-discussion\n\nI guess this a liminal case of an issue. I almost didn't report it. But I didn't want to forget it. In particular, whenever the test suite is changed to be less coupled with the checked-out GitPython repository itself, the precise semantics of the init script may be important, so I think it's best they be as clear as possible.","author":{"url":"https://github.com/EliahKagan","@type":"Person","name":"EliahKagan"},"datePublished":"2026-05-07T18:47:39.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/2145/GitPython/issues/2145"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:9a5e2f4e-7adf-4c87-63ee-2edb3bc5ed1a
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idCFA4:3F2674:11F4A2E:19B6C85:6A58E671
html-safe-nonceca5d90353f0cd36d3ebba117ffaa3874aa45cd8180ac769f4568a9997f7b4798
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRkE0OjNGMjY3NDoxMUY0QTJFOjE5QjZDODU6NkE1OEU2NzEiLCJ2aXNpdG9yX2lkIjoiNzcyNDU0NDc3MjkzNDI2NDQzNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacccc68d353690594ae9fde2e399a5f88808466dfbb3baab4e287560bb4cfb7f8d
hovercard-subject-tagissue:4401190930
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/2145/issue_layout
twitter:imagehttps://opengraph.githubassets.com/a3d1c1db097211f1740dee0a69b0ac5285288a449fa3d43305a495a317f2403c/gitpython-developers/GitPython/issues/2145
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/a3d1c1db097211f1740dee0a69b0ac5285288a449fa3d43305a495a317f2403c/gitpython-developers/GitPython/issues/2145
og:image:altBackground This code in the init script runs this to check out the master branch if present and readily available, and other just make a branch called that where we are now: GitPython/init-tests-af...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameEliahKagan
hostnamegithub.com
expected-hostnamegithub.com
None5f2a0c7865178af3d91dd9f13b0cdfc3c73a2529c873d2780bb4c01271a57ec6
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
release8aae7b8d6caacacf5c66eaeb2702d8dc88d85b4a
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/gitpython-developers/GitPython/issues/2145#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgitpython-developers%2FGitPython%2Fissues%2F2145
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
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
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
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/enterprise/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%2F2145
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/2145
Reloadhttps://github.com/gitpython-developers/GitPython/issues/2145
Reloadhttps://github.com/gitpython-developers/GitPython/issues/2145
Please reload this pagehttps://github.com/gitpython-developers/GitPython/issues/2145
gitpython-developers https://github.com/gitpython-developers
GitPythonhttps://github.com/gitpython-developers/GitPython
Please reload this pagehttps://github.com/gitpython-developers/GitPython/issues/2145
Notifications https://github.com/login?return_to=%2Fgitpython-developers%2FGitPython
Fork 982 https://github.com/login?return_to=%2Fgitpython-developers%2FGitPython
Star 5.1k https://github.com/login?return_to=%2Fgitpython-developers%2FGitPython
Code https://github.com/gitpython-developers/GitPython
Issues 164 https://github.com/gitpython-developers/GitPython/issues
Pull requests 9 https://github.com/gitpython-developers/GitPython/pulls
Discussions https://github.com/gitpython-developers/GitPython/discussions
Actions https://github.com/gitpython-developers/GitPython/actions
Security and quality 12 https://github.com/gitpython-developers/GitPython/security
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 and quality https://github.com/gitpython-developers/GitPython/security
Insights https://github.com/gitpython-developers/GitPython/pulse
#2148https://github.com/gitpython-developers/GitPython/pull/2148
Init script makes slightly confusing reflog if multiple remotes have "master"https://github.com/gitpython-developers/GitPython/issues/2145#top
#2148https://github.com/gitpython-developers/GitPython/pull/2148
https://github.com/EliahKagan
EliahKaganhttps://github.com/EliahKagan
on May 7, 2026https://github.com/gitpython-developers/GitPython/issues/2145#issue-4401190930
GitPython/init-tests-after-clone.shhttps://github.com/gitpython-developers/GitPython/blob/7b83f7a99af4313264650339e08601834b3ca968/init-tests-after-clone.sh#L42-L43
7b83f7ahttps://github.com/gitpython-developers/GitPython/commit/7b83f7a99af4313264650339e08601834b3ca968
GitPython/init-tests-after-clone.shhttps://github.com/gitpython-developers/GitPython/blob/7b83f7a99af4313264650339e08601834b3ca968/init-tests-after-clone.sh#L45-L48
7b83f7ahttps://github.com/gitpython-developers/GitPython/commit/7b83f7a99af4313264650339e08601834b3ca968
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.