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

The ignoring of whitespace is problematic for git #657

Open
LevitatingBusinessMan opened this issue Mar 8, 2024 · 1 comment
Open

The ignoring of whitespace is problematic for git #657

LevitatingBusinessMan opened this issue Mar 8, 2024 · 1 comment

Comments

@LevitatingBusinessMan
Copy link

So for the xth time now I accidentally commited a commit that included whitespace changes that I didn't catch because I used difft.

Here is an example of the output of diff vs difft on a dirty git. I modified the first line but also entered a newline and a space.

(arch) rein /t/x (master)  $ GIT_EXTERNAL_DIFF=difft git diff
x.c --- C
1 void main() {                                                 1 int main() {
2         //filler                                              2         //filler
3         //filler                                              3         //filler
4         //filler                                              4         //filler
(arch) rein /t/x (master)  $ git diff
diff --git a/x.c b/x.c
index 7482fcb..17ac454 100644
--- a/x.c
+++ b/x.c
@@ -1,7 +1,8 @@
-void main() {
+int main() {
        //filler
        //filler
        //filler
        int x;
-       int foo(x);
+
+       int foo( x);
 }

It's easy to see how one could accidentally commit whitespace changes that may not alter the AST but are still unwelcme changes.
I understand that difftastic stands out from other tools because it can read AST's, but is there no option to also show changes to whitespace? I mainly use difft in this scenario because of the syntax highlighting and the side-by-side display.

@dirkfeytons
Copy link

See also #637

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

No branches or pull requests

2 participants