René's URL Explorer Experiment


Title: Fix issue with directory glob ignore in subdirectories by roblg · Pull Request #4239 · libgit2/libgit2 · GitHub

Open Graph Title: Fix issue with directory glob ignore in subdirectories by roblg · Pull Request #4239 · libgit2/libgit2

X Title: Fix issue with directory glob ignore in subdirectories by roblg · Pull Request #4239 · libgit2/libgit2

Description: Observed issue: Git understands /*/ in a .gitignore file to mean "ignore all root-level directories, but include files". Published libgit2 has the same behavior except when the .gitignore file is in a subdirectory of the repository. I reproduced this behavior with tests master and 0.24.3. I added four new tests; three of them already work in master. The one that fails w/o my change is test_status_ignore__subdir_ignore_all_toplevel_dirs_include_files. The other tests in status::ignore illustrate that the issue was only occurring for .gitignore files in subdirectories, and only for directory matches. My proposed changed seems safe to me, because relpath is derived from path->path, which is in the original code, and it only affects the case where the match is looking for a directory and the path being looked at is a file. I also rolled a dev version of atom and linked in a version of this patch based on 0.24.3 and verified that the expected behavior (my root-level files show up!) is observed. Old and new tests pass, so how could it possibly be broken, amirite? 😀 But in all seriousness, I'm not at all familiar with this code, so if there's something else I can do, let me know. Thanks!

Open Graph Description: Observed issue: Git understands /*/ in a .gitignore file to mean "ignore all root-level directories, but include files". Published libgit2 has the same behavior except when the .gitignor...

X Description: Observed issue: Git understands /*/ in a .gitignore file to mean "ignore all root-level directories, but include files". Published libgit2 has the same behavior except when the ....

Opengraph URL: https://github.com/libgit2/libgit2/pull/4239

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:9040db15-8b22-9dbf-7c30-827220ea3e6d
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC1EC:2F6413:624F3E7:813C78D:6A5DC75A
html-safe-noncee483f36ad1424fb2f6ca2802ca802fec50fb911fb530c9735caf12465c2169d0
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMUVDOjJGNjQxMzo2MjRGM0U3OjgxM0M3OEQ6NkE1REM3NUEiLCJ2aXNpdG9yX2lkIjoiNTc1Mzk3ODY5MTk0MTk0MzEzMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacf39aac3c80856afe2cdc48e1cc5e3d5a963fe8bb4d700219032094b045f141ab
hovercard-subject-tagpull_request:120495738
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/libgit2/libgit2/pull/4239/files
twitter:imagehttps://avatars.githubusercontent.com/u/777138?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/777138?s=400&v=4
og:image:altObserved issue: Git understands /*/ in a .gitignore file to mean "ignore all root-level directories, but include files". Published libgit2 has the same behavior except when the .gitignor...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/libgit2/libgit2 git https://github.com/libgit2/libgit2.git
octolytics-dimension-user_id394745
octolytics-dimension-user_loginlibgit2
octolytics-dimension-repository_id901662
octolytics-dimension-repository_nwolibgit2/libgit2
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id901662
octolytics-dimension-repository_network_root_nwolibgit2/libgit2
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
release9c975978430e9ad293956f2bbdaf153b1bd84a99
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/libgit2/libgit2/pull/4239/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Flibgit2%2Flibgit2%2Fpull%2F4239%2Ffiles
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%2Flibgit2%2Flibgit2%2Fpull%2F4239%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=libgit2%2Flibgit2
Reloadhttps://github.com/libgit2/libgit2/pull/4239/files
Reloadhttps://github.com/libgit2/libgit2/pull/4239/files
Reloadhttps://github.com/libgit2/libgit2/pull/4239/files
Please reload this pagehttps://github.com/libgit2/libgit2/pull/4239/files
libgit2 https://github.com/libgit2
libgit2https://github.com/libgit2/libgit2
Notifications https://github.com/login?return_to=%2Flibgit2%2Flibgit2
Fork 2.6k https://github.com/login?return_to=%2Flibgit2%2Flibgit2
Star 10.5k https://github.com/login?return_to=%2Flibgit2%2Flibgit2
Code https://github.com/libgit2/libgit2
Issues 423 https://github.com/libgit2/libgit2/issues
Pull requests 108 https://github.com/libgit2/libgit2/pulls
Discussions https://github.com/libgit2/libgit2/discussions
Actions https://github.com/libgit2/libgit2/actions
Projects https://github.com/libgit2/libgit2/projects
Security and quality 9 https://github.com/libgit2/libgit2/security
Insights https://github.com/libgit2/libgit2/pulse
Code https://github.com/libgit2/libgit2
Issues https://github.com/libgit2/libgit2/issues
Pull requests https://github.com/libgit2/libgit2/pulls
Discussions https://github.com/libgit2/libgit2/discussions
Actions https://github.com/libgit2/libgit2/actions
Projects https://github.com/libgit2/libgit2/projects
Security and quality https://github.com/libgit2/libgit2/security
Insights https://github.com/libgit2/libgit2/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Flibgit2%2Flibgit2%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Flibgit2%2Flibgit2%2Fissues%2Fnew%2Fchoose
ethomsonhttps://github.com/ethomson
libgit2:masterhttps://github.com/libgit2/libgit2/tree/master
roblg:toplevel-dir-ignore-fixhttps://github.com/roblg/libgit2/tree/toplevel-dir-ignore-fix
Conversation 13 https://github.com/libgit2/libgit2/pull/4239
Commits 1 https://github.com/libgit2/libgit2/pull/4239/commits
Checks 0 https://github.com/libgit2/libgit2/pull/4239/checks
Files changed https://github.com/libgit2/libgit2/pull/4239/files
Please reload this pagehttps://github.com/libgit2/libgit2/pull/4239/files
Fix issue with directory glob ignore in subdirectories https://github.com/libgit2/libgit2/pull/4239/files#top
Show all changes 1 commit https://github.com/libgit2/libgit2/pull/4239/files
c3b8e8b Fix issue with directory glob ignore in subdirectories roblg May 14, 2017 https://github.com/libgit2/libgit2/pull/4239/commits/c3b8e8b3583b3767f8a0e124893083a15226afec
Clear filters https://github.com/libgit2/libgit2/pull/4239/files
Please reload this pagehttps://github.com/libgit2/libgit2/pull/4239/files
Please reload this pagehttps://github.com/libgit2/libgit2/pull/4239/files
attr_file.c https://github.com/libgit2/libgit2/pull/4239/files#diff-a5c6339ecc713942734dd06e44c402e4bcb301c0408a1aa8a098028ea35bb128
ignore.c https://github.com/libgit2/libgit2/pull/4239/files#diff-b72a1ecaa42c8becb8ede19e22ee02028f97e91311256b5d91e8e483c15477d3
ignore.c https://github.com/libgit2/libgit2/pull/4239/files#diff-6f4b5a39d57aa317147103396af4a2daff961da939e4720346f5bcf38939cab2
src/attr_file.chttps://github.com/libgit2/libgit2/pull/4239/files#diff-a5c6339ecc713942734dd06e44c402e4bcb301c0408a1aa8a098028ea35bb128
View file https://github.com/roblg/libgit2/blob/c3b8e8b3583b3767f8a0e124893083a15226afec/src/attr_file.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/libgit2/libgit2/pull/4239/{{ revealButtonHref }}
https://github.com/libgit2/libgit2/pull/4239/files#diff-a5c6339ecc713942734dd06e44c402e4bcb301c0408a1aa8a098028ea35bb128
https://github.com/libgit2/libgit2/pull/4239/files#diff-a5c6339ecc713942734dd06e44c402e4bcb301c0408a1aa8a098028ea35bb128
tests/attr/ignore.chttps://github.com/libgit2/libgit2/pull/4239/files#diff-b72a1ecaa42c8becb8ede19e22ee02028f97e91311256b5d91e8e483c15477d3
View file https://github.com/roblg/libgit2/blob/c3b8e8b3583b3767f8a0e124893083a15226afec/tests/attr/ignore.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/libgit2/libgit2/pull/4239/{{ revealButtonHref }}
https://github.com/libgit2/libgit2/pull/4239/files#diff-b72a1ecaa42c8becb8ede19e22ee02028f97e91311256b5d91e8e483c15477d3
tests/status/ignore.chttps://github.com/libgit2/libgit2/pull/4239/files#diff-6f4b5a39d57aa317147103396af4a2daff961da939e4720346f5bcf38939cab2
View file https://github.com/roblg/libgit2/blob/c3b8e8b3583b3767f8a0e124893083a15226afec/tests/status/ignore.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/libgit2/libgit2/pull/4239/{{ revealButtonHref }}
https://github.com/libgit2/libgit2/pull/4239/files#diff-6f4b5a39d57aa317147103396af4a2daff961da939e4720346f5bcf38939cab2
pks-thttps://github.com/pks-t
May 15, 2017https://github.com/libgit2/libgit2/pull/4239/files#r116412172
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/libgit2/libgit2/pull/4239/files
roblghttps://github.com/roblg
May 15, 2017https://github.com/libgit2/libgit2/pull/4239/files#r116526090
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/libgit2/libgit2/pull/4239/files
pks-thttps://github.com/pks-t
May 16, 2017https://github.com/libgit2/libgit2/pull/4239/files#r116667245
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/libgit2/libgit2/pull/4239/files
pks-thttps://github.com/pks-t
May 15, 2017https://github.com/libgit2/libgit2/pull/4239/files#r116412272
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/libgit2/libgit2/pull/4239/files
roblghttps://github.com/roblg
May 15, 2017https://github.com/libgit2/libgit2/pull/4239/files#r116525103
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/libgit2/libgit2/pull/4239/files
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.