-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
diff mode doesn't display content #1869
Comments
What's curious here is that
However, upon testing, unsetting this has no effect whatsoever. |
Thanks for reporting this bug and providing instructions to reproduce it! It definitely looks like something's off with bat's output. Some other bugged cases: $ printf "foo\nbar" > README && git add README && git commit -m 'commit'
$ printf "baz\nbar" > README
$ bat -d README
───────┬─────────────────────────────────────────────────────────────────────────────────────────
│ File: README
───────┼─────────────────────────────────────────────────────────────────────────────────────────
───────┴──────────────────────────────────────────────────────────────────────────────────────── $ printf "1\n2\n3" > README && git add README && git commit -m 'commit'
$ printf "0\n2\n3" > README
$ bat -d README
───────┬─────────────────────────────────────────────────────────────────────────────────────────
│ File: README
───────┼─────────────────────────────────────────────────────────────────────────────────────────
───────┴──────────────────────────────────────────────────────────────────────────────────────── It looks like |
Just to be explicit here, this issue is present even when lines other than the first are modified. |
Thank you for reporting this.
I can only reproduce the bug for the first line modification:
seq 5 > README
git commit -am "dummy commit" > /dev/null
for i in $(seq 5); do
echo "=== $i"
sed -i -e "s/^$i\$/this line has been modified/" README
bat --diff README
git checkout README > /dev/null
done output:
|
Interestingly, I copied a file that I experience the issue with into a temporary "test" repository, and cannot reproduce the error there. I'll dig into |
Describe the bug you encountered:
After installing
bat
for the first time, I wanted to test it out in my git repository. Runningbat -d <filename>
with a file that has been stored in my git repository's index and has a local modification does not output any of the content, modification or not.I am able to replicate this erroneous behavior in a new repository:
What did you expect to happen instead?
I expected to see the modified line(s) with proper highlighting.
How did you install
bat
?Through my system package manager.
bat version and environment
Software version
bat 0.18.3 (b146958)
Operating system
Linux 5.14.8-arch1-1
Command-line
Environment variables
Config file
Compile time information
Less version
The text was updated successfully, but these errors were encountered: