-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
When I git diff
in a directory that hasn't been committed, the file paths appears to start with i/
and w/
:
$ mkdir testdunk && cd testdunk
$ git init
$ date > date.txt # create a file with a single line
$ git add date.txt
$ git commit -a -m 'Initial commit'
$ date >> date.txt # append a line to existing file
$ git diff
diff --git i/date.txt w/date.txt
index d4b0209..7873ad6 100644
--- i/date.txt
+++ w/date.txt
@@ -1 +1,2 @@
2025-04-20T11:01:30 CEST
+2025-04-20T11:02:12 CEST
When I add dunk
to the pipeline, it cannot seem to find the file:
$ git diff | dunk
1 file changed
+1 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -0
▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ i/date.txt (1 additions, 0 removals) ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
Traceback (most recent call last):
File "/home/kas/.local/lib/virtualenvs/dunk/bin/dunk", line 8, in <module>
sys.exit(main())
~~~~^^
File "/home/kas/.local/lib/virtualenvs/dunk/lib/python3.13/site-packages/dunk/dunk.py", line 83, in main
_run_dunk()
~~~~~~~~~^^
File "/home/kas/.local/lib/virtualenvs/dunk/lib/python3.13/site-packages/dunk/dunk.py", line 132, in _run_dunk
target_code = target_file.read_text()
File "/usr/lib/python3.13/pathlib/_local.py", line 546, in read_text
return PathBase.read_text(self, encoding, errors, newline)
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.13/p 1 file changed
+1 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -0
▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ i/date.txt (1 additions, 0 removals) ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
Traceback (most recent call last):
File "/home/kas/.local/lib/virtualenvs/dunk/bin/dunk", line 8, in <module>
sys.exit(main())
~~~~^^
File "/home/kas/.local/lib/virtualenvs/dunk/lib/python3.13/site-packages/dunk/dunk.py", line 83, in main
_run_dunk()
~~~~~~~~~^^
File "/home/kas/.local/lib/virtualenvs/dunk/lib/python3.13/site-packages/dunk/dunk.py", line 132, in _run_dunk
target_code = target_file.read_text()
File "/usr/lib/python3.13/pathlib/_local.py", line 546, in read_text
return PathBase.read_text(self, encoding, errors, newline)
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.13/pathlib/_abc.py", line 632, in read_text
with self.open(mode='r', encoding=encoding, errors=errors, newline=newline) as f:
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.13/pathlib/_local.py", line 537, in open
return io.open(self, mode, buffering, encoding, errors, newline)
~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/build/testdunk/i/date.txt'
athlib/_abc.py", line 632, in read_text
with self.open(mode='r', encoding=encoding, errors=errors, newline=newline) as f:
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.13/pathlib/_local.py", line 537, in open
return io.open(self, mode, buffering, encoding, errors, newline)
~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/build/testdunk/i/date.txt'
However, if I commit everything and ask for the diff between the two hashes, the file paths appears to start with a/
and b/
, and everything's cool:
$ git commit -a -m 'Updaste'
$ git diff e76e75b..eb9b405 | dunk
1 file changed
+1 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -0
▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ date.txt (1 additions, 0 removals) ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲ @@ -1,1 +1,2 @@ ╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲
1 2025-04-20T11:01:30 CEST 1 2025-04-20T11:01:30 CEST
2 2025-04-20T11:02:12 CEST
This happens with dunk 0.4.0a0 and 0.5.0b0.
$ uname -rom
6.14.2-arch1-1 x86_64 GNU/Linux
$ git --version
git version 2.49.0
Metadata
Metadata
Assignees
Labels
No labels