-
-
Notifications
You must be signed in to change notification settings - Fork 404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
porcelain.status() fails when submodule directories are present #517
Comments
On Mon, Apr 17, 2017 at 01:52:33PM -0700, Thomas Ward wrote:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.5/dist-packages/dulwich/porcelain.py", line 743, in status
unstaged_changes = list(get_unstaged_changes(r.open_index(), r.path))
File "/usr/local/lib/python3.5/dist-packages/dulwich/index.py", line 567, in get_unstaged_changes
blob = blob_from_path_and_stat(full_path, os.lstat(full_path))
File "/usr/local/lib/python3.5/dist-packages/dulwich/index.py", line 545, in blob_from_path_and_stat
with open(fs_path, 'rb') as f:
IsADirectoryError: [Errno 21] Is a directory: b'./ChatExchange'
>>> import os
>>> os.getcwd()
'/home/teward/VCS Repos/GitHub/teward/SmokeDetector'
```
Why it's checking a directory that is a submodule, I'm not sure. Is this a limitation of the 'porcelain' system, and ultimately not the proper way to get current `git` status?
At the moment the porcelain status code indeed does not support submodules,
which is why this is happening. If you look in dulwich/index.py, a couple of
lines up from where this error is triggered (line 565) you'll see a TODO
comment about this.
The issue tracking support for submodules in porcelain is #506
Jelmer
|
@jelmer Your message never got back to me, sorry. Is it not possible to check if there's a submodule and if so "skip" that directory? While that's not the easiest thing to do, surely somewhere in git repo data and configuration that information is stored, and we can exclude submodule items from checks. |
On Thu, May 04, 2017 at 06:54:20AM -0700, Thomas Ward wrote:
@jelmer Your message never got back to me, sorry. Is it not possible to *check* if there's a submodule and if so "skip" that directory? While that's not the easiest thing to do, surely somewhere in git configuration that information is stored, and we can exclude submodule items from checks.
That is possible, but it should not be that much harder to support submodules properly in status.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello.
There is a small issue with Dulwich and it's Porcelain.status() functions. I'm working on a git project that has submodules and some other folders, and I get some failure cases with porcelain.status() (this is from a Python 3 shell):
Why it's checking a directory that is a submodule, I'm not sure. Is this a limitation of the 'porcelain' system, and ultimately not the proper way to get current
git
status?The text was updated successfully, but these errors were encountered: