Title: Add way to get only topmost untracked folders/files · gitpython-developers/GitPython · Discussion #1150 · GitHub
Open Graph Title: Add way to get only topmost untracked folders/files · gitpython-developers/GitPython · Discussion #1150
X Title: Add way to get only topmost untracked folders/files · gitpython-developers/GitPython · Discussion #1150
Description: Add way to get only topmost untracked folders/files
Open Graph Description: Let's say I have a new folder with three new files in it. When I use git status it will show like this: MyProject/New Folder/ But when I use GitPython's repo.untracked_files it will show like this:...
X Description: Let's say I have a new folder with three new files in it. When I use git status it will show like this: MyProject/New Folder/ But when I use GitPython's repo.untracked_files it will show li...
Opengraph URL: https://github.com/gitpython-developers/GitPython/discussions/1150
X: @github
Domain: togithub.com
{"@context":"https://schema.org","@type":"QAPage","mainEntity":{"@type":"Question","name":"Add way to get only topmost untracked folders/files","text":"Let's say I have a new folder with three new files in it.
\nWhen I use git status it will show like this:
\nMyProject/New Folder/\n
\nBut when I use GitPython's repo.untracked_files it will show like this:
\nMyProject/New Folder/file_a.txt\nMyProject/New Folder/file_b.txt\nMyProject/New Folder/file_c.txt\n
\nIs there a way to get the same result as the git status version?
","upvoteCount":1,"answerCount":2,"acceptedAnswer":{"@type":"Answer","text":"Hello, thanks for the response.
\nFor the time being I Implemented a workaround that calls git directly.
\nI am not sure if this is useful for you, but here is the code:
\nimport subprocess\ncommand = [\"git\", \"ls-files\", \"--others\", \"--directory\", \"--exclude-standard\", \"--no-empty-directory\"]\nprocess = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)\nuntracked_files_and_folders = [u.decode().strip() for u in process.stdout]\n
","upvoteCount":2,"url":"https://github.com/gitpython-developers/GitPython/discussions/1150#discussioncomment-408802"}}}
| route-pattern | /:user_id/:repository/discussions/:number(.:format) |
| route-controller | discussions |
| route-action | show |
| fetch-nonce | v2:1533f517-0d64-965f-5b70-1b7c8a73da8a |
| current-catalog-service-hash | 9f0abe34da433c9b6db74bffa2466494a717b579a96b30a5d252e5090baea7be |
| request-id | D3C8:1327C8:1F737E7:2C3011E:69690C09 |
| html-safe-nonce | a5c7013158efe39c6dcd344deab69ccfd96931547d38a2d7d115b2151078ddd7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEM0M4OjEzMjdDODoxRjczN0U3OjJDMzAxMUU6Njk2OTBDMDkiLCJ2aXNpdG9yX2lkIjoiNTIwNDQzODY0NDMwOTk1MzU0NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 85440f13f88a899a026fb3233992467c28890e9ec91c161dad8620e1b30ba7a2 |
| hovercard-subject-tag | discussion:3242088 |
| github-keyboard-shortcuts | repository,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/gitpython-developers/GitPython/discussions/1150 |
| twitter:image | https://opengraph.githubassets.com/cb0bbe79950a7a4dd6adbe711e1f5cb74ee7aada0473d5bc949abe4c961bebd5/gitpython-developers/GitPython/discussions/1150 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cb0bbe79950a7a4dd6adbe711e1f5cb74ee7aada0473d5bc949abe4c961bebd5/gitpython-developers/GitPython/discussions/1150 |
| og:image:alt | Let's say I have a new folder with three new files in it. When I use git status it will show like this: MyProject/New Folder/ But when I use GitPython's repo.untracked_files it will show like this:... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | e6156bd4ef9f2dc8dadf4c49a8f7ed8532186388cef72eda3ccb9f0ab3b8cfca |
| turbo-cache-control | no-preview |
| go-import | github.com/gitpython-developers/GitPython git https://github.com/gitpython-developers/GitPython.git |
| octolytics-dimension-user_id | 503709 |
| octolytics-dimension-user_login | gitpython-developers |
| octolytics-dimension-repository_id | 1126087 |
| octolytics-dimension-repository_nwo | gitpython-developers/GitPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1126087 |
| octolytics-dimension-repository_network_root_nwo | gitpython-developers/GitPython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ee2210c3e58153aae53400c942f8a7b4bbb43ec4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width