Skip to content
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

Honor default-language option #1655

Merged
merged 2 commits into from Mar 16, 2024
Merged

Conversation

imbrish
Copy link
Contributor

@imbrish imbrish commented Mar 16, 2024

Supersedes pull request #859. See also discussion #858. Fixes #499.

The actual code changes were made by @dandavison in that pull request, here I have only added tests.

Take diff:

diff --git a/abc b/abc
index 8c4ae06..0a37de7 100644
--- a/abc
+++ b/abc
@@ -9,7 +9,7 @@ foobar()
     dst=$(winpath $2)
 
     # List the directory.
-    ls -l $src
+    ls -la $src
 
     echo $src '->' $dst
     rsync -avu --delete $src/ $dst

And command:

cat diff | delta --no-gitconfig --default-language bash

Output before and after:

image

@imbrish
Copy link
Contributor Author

imbrish commented Mar 16, 2024

The failing check is the usual test_env_parsing_with_pager_set_to_bat. All tests pass locally, and this is ready to merge.

@dandavison dandavison merged commit 34e3367 into dandavison:main Mar 16, 2024
10 of 12 checks passed
@dandavison
Copy link
Owner

dandavison commented Mar 16, 2024

Excellent, thanks a lot!

For anyone looking to use this, one way is to add an entry like

[delta]
    default-language = bash

to your repo's .git/config (that way you can choose the language per-repo).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🚀 --language option as bat
2 participants