René's URL Explorer Experiment


Title: Committing a path that switched between file and directory fails (e.g. symlink replaced by a folder) · Issue #1 · reemus-dev/subcommit · GitHub

Open Graph Title: Committing a path that switched between file and directory fails (e.g. symlink replaced by a folder) · Issue #1 · reemus-dev/subcommit

X Title: Committing a path that switched between file and directory fails (e.g. symlink replaced by a folder) · Issue #1 · reemus-dev/subcommit

Description: subcommit can't commit a path that switched between a file and a directory, in either direction. Git's raw error leaks out, and the only fallback is plain git rm --cached plus git add. Found when I replaced a committed symlink skills/cua...

Open Graph Description: subcommit can't commit a path that switched between a file and a directory, in either direction. Git's raw error leaks out, and the only fallback is plain git rm --cached plus git add. Found when I...

X Description: subcommit can't commit a path that switched between a file and a directory, in either direction. Git's raw error leaks out, and the only fallback is plain git rm --cached plus git add. Foun...

Opengraph URL: https://github.com/reemus-dev/subcommit/issues/1

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Committing a path that switched between file and directory fails (e.g. symlink replaced by a folder)","articleBody":"subcommit can't commit a path that switched between a file and a directory, in either direction. Git's raw error leaks out, and the only fallback is plain `git rm --cached` plus `git add`.\n\nFound when I replaced a committed symlink `skills/cua-driver` with a folder `skills/cua-driver/SKILL.md`. Symlinks are not required to reproduce it.\n\n## Reproduce\n\n```bash\ngit init -q r && cd r\necho f > p && git add p && git commit -qm init\nrm p && mkdir p && echo g > p/q\n\nsubcommit p/q -m t --yes\n# error: git update-index --add --cacheinfo 100644,\u003coid>,p/q: error: 'p/q' appears as both a file and as a directory\n# error: p/q: cannot add to the index - missing --add option?\n# fatal: git update-index: --cacheinfo cannot add p/q\n\nsubcommit p p/q -m t --yes\n# error: cannot commit a directory: p\n```\n\nThe reverse case (`p/q` committed, `p` is now a file) fails the same way:\n\n```bash\nsubcommit p -m t --yes        # same \"appears as both a file and as a directory\"\nsubcommit p p/q -m t --yes    # error: open .../p: not a directory\n```\n\n## Cause\n\n`complete.go` and `finalize.go` stage with `update-index --add --cacheinfo`. Git refuses to add `p/q` while the index still holds `p`, or the reverse, unless you pass `--replace`. With `--replace`, both cases stage correctly (`D p`, `A p/q`, and the reverse).\n\nSelecting the old path doesn't help either. The worktree now has the opposite type at that path, so the selection step rejects it (`cannot commit a directory`) or fails to stat it (`not a directory`).\n\n## Design question\n\n`--replace` silently drops the conflicting index entries, and those were not selected. That widens the commit beyond the selection, against the explicit-scope guarantee. Options:\n\n1. Stage with `--replace` only when the displaced paths are also selected. Accept the old path as a target for this case (a removed file or a removed directory), as the \"move includes both endpoints\" rule already does. Otherwise, fail with a diagnostic that names the displaced paths to add.\n2. Always use `--replace`, and list the displaced paths in the preview as included removals.\n\nOption 1 fits the scope guarantees better.\n","author":{"url":"https://github.com/realfresh","@type":"Person","name":"realfresh"},"datePublished":"2026-11-05T00:09:11Z","url":"https://github.com/reemus-dev/subcommit/issues/1"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:c4fad23d-06b8-bb92-caa1-f6821dbc640c
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDE4A:16A125:96095B:C815CB:6B00B5FB
html-safe-nonced16d2c5d88df574bbc481502fec9676c0092f6f6011f826df6177107f8bc6bc4
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERTRBOjE2QTEyNTo5NjA5NUI6QzgxNUNCOjZCMDBCNUZCIiwidmlzaXRvcl9pZCI6IjIxNDc5NjY5NzUzNDk5Mjk0NjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmaccbf3cda2afb2023f01239186c387523754125a7d90b73186ed80589d1427bb35
hovercard-subject-tagissue:6213886057
github-keyboard-shortcutsrepository,issues,commits,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/reemus-dev/subcommit/1/issue_layout
twitter:imagehttps://opengraph.githubassets.com/619bc21784cae61a578e1d478abc612e3fa70cbe25a5dec243432b8978b9c791/reemus-dev/subcommit/issues/1
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/619bc21784cae61a578e1d478abc612e3fa70cbe25a5dec243432b8978b9c791/reemus-dev/subcommit/issues/1
og:image:altsubcommit can't commit a path that switched between a file and a directory, in either direction. Git's raw error leaks out, and the only fallback is plain git rm --cached plus git add. Found when I...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamerealfresh
hostnamegithub.com
expected-hostnamegithub.com
None1d07c25977adfc5ff6acb0a962a9bc168c07afbda6fef765f9761c350c2ae4a2
turbo-cache-controlno-preview
go-importgithub.com/reemus-dev/subcommit git https://github.com/reemus-dev/subcommit.git
octolytics-dimension-user_id133128348
octolytics-dimension-user_loginreemus-dev
octolytics-dimension-repository_id1354074441
octolytics-dimension-repository_nworeemus-dev/subcommit
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1354074441
octolytics-dimension-repository_network_root_nworeemus-dev/subcommit
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
release5429cbfc6aca8c7b9a086a3c8f47400346f38cc9
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/reemus-dev/subcommit/issues/1#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Freemus-dev%2Fsubcommit%2Fissues%2F1
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Freemus-dev%2Fsubcommit%2Fissues%2F1
Sign uphttps://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=reemus-dev%2Fsubcommit
Reloadhttps://github.com/reemus-dev/subcommit/issues/1
Reloadhttps://github.com/reemus-dev/subcommit/issues/1
Reloadhttps://github.com/reemus-dev/subcommit/issues/1
reemus-devhttps://github.com/reemus-dev
subcommithttps://github.com/reemus-dev/subcommit
Codehttps://github.com/reemus-dev/subcommit
Issues1 (1)https://github.com/reemus-dev/subcommit/issues
Pull requestshttps://github.com/reemus-dev/subcommit/pulls
Actionshttps://github.com/reemus-dev/subcommit/actions
Security and qualityhttps://github.com/reemus-dev/subcommit/security
Insightshttps://github.com/reemus-dev/subcommit/insights
https://github.com/reemus-dev/subcommit
New issuehttps://github.com/login?return_to=https://github.com/reemus-dev/subcommit/issues/1
New issuehttps://github.com/login?return_to=https://github.com/reemus-dev/subcommit/issues/1
Committing a path that switched between file and directory fails (e.g. symlink replaced by a folder)https://github.com/reemus-dev/subcommit/issues/1#top
https://github.com/realfresh
realfreshhttps://github.com/realfresh
on Nov 5, 2026https://github.com/reemus-dev/subcommit/issues/1#issue-6213886057
Sign up for freehttps://github.com/signup?return_to=https://github.com/reemus-dev/subcommit/issues/1
Sign in to commenthttps://github.com/login?return_to=https://github.com/reemus-dev/subcommit/issues/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.