René's URL Explorer Experiment


Title: What's wrong with resetting with both --mixed and paths? · gitpython-developers/GitPython · Discussion #1876 · GitHub

Open Graph Title: What's wrong with resetting with both --mixed and paths? · gitpython-developers/GitPython · Discussion #1876

X Title: What's wrong with resetting with both --mixed and paths? · gitpython-developers/GitPython · Discussion #1876

Description: What's wrong with resetting with both --mixed and paths?

Open Graph Description: The HEAD.reset method includes this code: GitPython/git/refs/head.py Lines 97 to 105 in e880c33 if index: mode = "--mixed" # Tt appears some git versions declare mixed and paths deprecated. # See h...

X Description: The HEAD.reset method includes this code: GitPython/git/refs/head.py Lines 97 to 105 in e880c33 if index: mode = "--mixed" # Tt appears some git versions declare mixed and paths deprecate...

Opengraph URL: https://github.com/gitpython-developers/GitPython/discussions/1876

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"QAPage","mainEntity":{"@type":"Question","name":"What's wrong with resetting with both --mixed and paths?","text":"

The HEAD.reset method includes this code:

\n

\n
\n

\n GitPython/git/refs/head.py\n

\n

\n Lines 97 to 105\n in\n e880c33\n

\n
\n
\n \n\n \n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n \n \n \n
if index:
mode = \"--mixed\"
# Tt appears some git versions declare mixed and paths deprecated.
# See http://github.com/Byron/GitPython/issues#issue/2.
if paths:
mode = None
# END special case
# END handle index
\n
\n
\n

\n

The issue URL is broken and seems it may not be archived. Is more known about this issue, and is there anything that can be replaced with?

","upvoteCount":1,"answerCount":2,"acceptedAnswer":{"@type":"Answer","text":"

Although I can't be certain there isn't further relevant information in the lost issue, I think I've figured this out. It's much more straightforward than I'd feared and indeed trying it out as you suggested in #1876 (comment) led directly to the answer.

\n

Running git reset --mixed -- path always shows a warning. For example:

\n
> git diff --staged --stat\n git/__init__.py | 16 ++++++++++------\n 1 file changed, 10 insertions(+), 6 deletions(-)\n> git reset --mixed -- git/__init__.py\nwarning: --mixed with paths is deprecated; use 'git reset -- <paths>' instead.\nUnstaged changes after reset:\nM       git/__init__.py\n
\n

The suggestion of what to do instead was added in git/git@a4941a8, but the behavior of issuing a deprecation message is older than that.

\n

It looks like it came in at git/git@0e5a7fa when git-reset was changed from being implemented as a shell script git-reset.sh (retained as an example, then later removed in git/git@49eb8d3 along with other such examples) to a builtin implemented in a newly introduced builtin-reset.c. The first stable version of git to include these changes was 1.5.4, whose release notes mention git reset becoming a builtin but do not mention the deprecation of passing paths after --mixed. But it is not to be found in the old shell script.

\n

As for why one shouldn't write --mixed when passing paths, it seems the idea is that a reset with paths--which must always have the same effect as when --mixed is passed--is already just its own separate kind of operation from other resets. Anyway, the approach taken in the code of simply omitting --mixed, not passing --hard or --soft either, and still passing the paths after --, seems to be robust and congruent with the expanded deprecation message.

\n

I'll open a small PR to clarify the comment.

","upvoteCount":1,"url":"https://github.com/gitpython-developers/GitPython/discussions/1876#discussioncomment-8975656"}}}

route-pattern/_view_fragments/Voltron::DiscussionsFragmentsController/show/:user_id/:repository/:discussion_number/discussion_layout(.:format)
route-controllervoltron_discussions_fragments
route-actiondiscussion_layout
fetch-noncev2:343e0ba1-9d98-bcc8-fe9d-bc1125078a61
current-catalog-service-hash9f0abe34da433c9b6db74bffa2466494a717b579a96b30a5d252e5090baea7be
request-id84BA:2B0D32:28225D3:385BA11:696920AE
html-safe-nonce27035324dd2fac77cac214861a8469a9942363a2fa46417679d2a5ddebb41e9a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NEJBOjJCMEQzMjoyODIyNUQzOjM4NUJBMTE6Njk2OTIwQUUiLCJ2aXNpdG9yX2lkIjoiMTg5MTE3NTA2ODI4ODQ5MTY5NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacac2f36d11f0ab709bb75a15ba2921afda6f10801e9efca40f08d57360dc4e009
hovercard-subject-tagdiscussion:6371726
github-keyboard-shortcutsrepository,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/discussions_fragments/discussion_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/Voltron::DiscussionsFragmentsController/show/gitpython-developers/GitPython/1876/discussion_layout
twitter:imagehttps://opengraph.githubassets.com/41d989b35470a2f11e8d23cb577f79f9be72407f5edf11fc3ba0a0f4ba9ede69/gitpython-developers/GitPython/discussions/1876
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/41d989b35470a2f11e8d23cb577f79f9be72407f5edf11fc3ba0a0f4ba9ede69/gitpython-developers/GitPython/discussions/1876
og:image:altThe HEAD.reset method includes this code: GitPython/git/refs/head.py Lines 97 to 105 in e880c33 if index: mode = "--mixed" # Tt appears some git versions declare mixed and paths deprecated. # See h...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None54182691a21263b584d2e600b758e081b0ff1d10ffc0d2eefa51cf754b43b51d
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
released69ac0477df0f87da03b8b06cebd187012d7a930
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/gitpython-developers/GitPython/discussions/1876#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgitpython-developers%2FGitPython%2Fdiscussions%2F1876
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%2Fdiscussions%2F1876
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%2Fdiscussions_fragments%2Fdiscussion_layout&source=header-repo&source_repo=gitpython-developers%2FGitPython
Reloadhttps://github.com/gitpython-developers/GitPython/discussions/1876
Reloadhttps://github.com/gitpython-developers/GitPython/discussions/1876
Reloadhttps://github.com/gitpython-developers/GitPython/discussions/1876
gitpython-developers https://github.com/gitpython-developers
GitPythonhttps://github.com/gitpython-developers/GitPython
Please reload this pagehttps://github.com/gitpython-developers/GitPython/discussions/1876
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/discussions/1876
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
Answered https://github.com/gitpython-developers/GitPython/discussions/1876#discussioncomment-8975656
EliahKaganhttps://github.com/EliahKagan
EliahKagan https://github.com/EliahKagan
Q&Ahttps://github.com/gitpython-developers/GitPython/discussions/categories/q-a
What's wrong with resetting with both --mixed and paths? https://github.com/gitpython-developers/GitPython/discussions/1876#top
EliahKagan https://github.com/EliahKagan
Answered https://github.com/gitpython-developers/GitPython/discussions/1876#discussioncomment-8975656
EliahKaganhttps://github.com/EliahKagan
Return to tophttps://github.com/gitpython-developers/GitPython/discussions/1876#top
Please reload this pagehttps://github.com/gitpython-developers/GitPython/discussions/1876
https://github.com/gitpython-developers/GitPython/discussions/1876
EliahKagan https://github.com/EliahKagan
Mar 14, 2024 https://github.com/gitpython-developers/GitPython/discussions/1876#discussion-6371726
GitPython/git/refs/head.pyhttps://github.com/gitpython-developers/GitPython/blob/e880c33284f2abff55d3cddfef2302663b178005/git/refs/head.py#L97-L105
e880c33https://github.com/gitpython-developers/GitPython/commit/e880c33284f2abff55d3cddfef2302663b178005
Give feedback.https://github.com/gitpython-developers/GitPython/discussions/1876
EliahKagan https://github.com/EliahKagan
Apr 1, 2024 https://github.com/gitpython-developers/GitPython/discussions/1876#discussioncomment-8975656
#1876 (comment)https://github.com/gitpython-developers/GitPython/discussions/1876#discussioncomment-8784228
git/git@a4941a8https://github.com/git/git/commit/a4941a81c8a67abad2000b044ecad71ceff9d695
View full answer https://github.com/gitpython-developers/GitPython/discussions/1876#discussioncomment-8975656
Oldest https://github.com/gitpython-developers/GitPython/discussions/1876?sort=old
Newest https://github.com/gitpython-developers/GitPython/discussions/1876?sort=new
Top https://github.com/gitpython-developers/GitPython/discussions/1876?sort=top
Please reload this pagehttps://github.com/gitpython-developers/GitPython/discussions/1876
https://github.com/gitpython-developers/GitPython/discussions/1876
Byron https://github.com/Byron
Mar 14, 2024 https://github.com/gitpython-developers/GitPython/discussions/1876#discussioncomment-8784228
#2https://github.com/gitpython-developers/GitPython/issues/2
Give feedback.https://github.com/gitpython-developers/GitPython/discussions/1876
Please reload this pagehttps://github.com/gitpython-developers/GitPython/discussions/1876
https://github.com/gitpython-developers/GitPython/discussions/1876
EliahKagan https://github.com/EliahKagan
Apr 1, 2024 https://github.com/gitpython-developers/GitPython/discussions/1876#discussioncomment-8975656
#1876 (comment)https://github.com/gitpython-developers/GitPython/discussions/1876#discussioncomment-8784228
git/git@a4941a8https://github.com/git/git/commit/a4941a81c8a67abad2000b044ecad71ceff9d695
git/git@0e5a7fahttps://github.com/git/git/commit/0e5a7faa3a903cf7a0a66c81e20a76b91f17faab
git/git@49eb8d3https://github.com/git/git/commit/49eb8d39c78f161231e63293df60f343d208f409
release noteshttps://github.com/git/git/blob/master/Documentation/RelNotes/1.5.4.txt
Give feedback.https://github.com/gitpython-developers/GitPython/discussions/1876
EliahKaganhttps://github.com/EliahKagan
Sign up for freehttps://github.com/join?source=comment-repo
Sign in to commenthttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgitpython-developers%2FGitPython%2Fdiscussions%2F1876
🙏 Q&A https://github.com/gitpython-developers/GitPython/discussions/categories/q-a
https://github.com/EliahKagan
https://github.com/Byron
https://github.com/gitpython-developers/GitPython/discussions/1876
https://github.com/settings/replies?return_to=1
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.