diff mbox series

-w flag of git diff command hide lines which should not be hidden

Message ID 1582116710.20250322182756@yandex.ru (mailing list archive)
State New
Headers show
Series -w flag of git diff command hide lines which should not be hidden | expand

Commit Message

Eugen Konkov March 22, 2025, 10:27 p.m. UTC
I  got  merge  conflict and want to see changes ignoring difference in
whitespace.

>        -w, --ignore-all-space
           Ignore whitespace when comparing lines. This ignores differences even if one
           line has whitespace where the other line has none.

From  here  you  can  see that not only white space was changed. It is
"name" -> "qualified_name" change.

But when I add -w flag those lines are hidden from the output.

Those lines should not be hidden.

Thank you.

```
 $ git diff -b --ignore-blank-lines --minimal /home/kes/work/projects/github-forks/sql-translator/lib/SQL/Translator/Diff.pm
+++ b/lib/SQL/Translator/Diff.pm
@@@ -152,10 -169,10 +152,10 @@@ sub compute_differences 
  
    my %src_tables_checked = ();
    my %src_tables_deleted = ();
-   my @tar_tables         = sort { $a->name cmp $b->name } $target_schema->get_tables;
+   my @tar_tables         = sort { $a->qualified_name cmp $b->qualified_name } $target_s>
    ## do original/source tables exist in target?
 -    for my $tar_table ( @tar_tables ) {
 +  for my $tar_table (@tar_tables) {
-     my $tar_table_name = $tar_table->name;
+     my $tar_table_name = $tar_table->qualified_name;
  
      my $src_table;
  
 $ git diff -w -b --ignore-blank-lines --minimal /home/kes/work/projects/github-forks/sql-translator/lib/SQL/Translator/Diff.pm
+++ b/lib/SQL/Translator/Diff.pm
 $ git --version
git version 2.49.0
 $ git status
interactive rebase in progress; onto 1ef083ed
Last commands done (13 commands done):
   pick 354a27a9 Fix multiple arguments handling
   pick 1bfbcdad Introduce and use Postgres in-database schemas * Add CREATE SCHEMA to DDL * Use table schema-qualified names where possible * Support for diffs on in-db schemas
  (see more in file .git/rebase-merge/done)
Next commands to do (4 remaining commands):
   pick 5535f6a3 Fix tests after new layout for created functions
   pick 3c08c7c8 Add qualified_name's to MySQL producer - after table name parsing changes
  (use "git rebase --edit-todo" to view and edit)
You are currently rebasing.
  (fix conflicts and then run "git rebase --continue")
  (use "git rebase --skip" to skip this patch)
  (use "git rebase --abort" to check out the original branch)

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        modified:   t/13schema.t

Unmerged paths:
  (use "git restore --staged <file>..." to unstage)
  (use "git add <file>..." to mark resolution)
        both modified:   lib/SQL/Translator/Diff.pm
        both modified:   lib/SQL/Translator/Parser/PostgreSQL.pm
        both modified:   lib/SQL/Translator/Producer/PostgreSQL.pm
        both modified:   lib/SQL/Translator/Schema.pm
        both modified:   lib/SQL/Translator/Schema/Table.pm
        both modified:   lib/SQL/Translator/Schema/Trigger.pm
        both modified:   t/14postgres-parser.t
```
diff mbox series

Patch

diff --cc lib/SQL/Translator/Diff.pm
index 1d9ac40f,6c3e64a9..00000000
--- a/lib/SQL/Translator/Diff.pm
diff --cc lib/SQL/Translator/Diff.pm
index 1d9ac40f,6c3e64a9..00000000
--- a/lib/SQL/Translator/Diff.pm