Git Mailing List Archive mirror
 help / color / mirror / Atom feed
* -w flag of git diff command hide lines which should not be hidden
@ 2025-03-22 22:27 Eugen Konkov
  0 siblings, 0 replies; only message in thread
From: Eugen Konkov @ 2025-03-22 22:27 UTC (permalink / raw)
  To: Git Mailing List

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
diff --cc lib/SQL/Translator/Diff.pm
index 1d9ac40f,6c3e64a9..00000000
--- a/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
diff --cc lib/SQL/Translator/Diff.pm
index 1d9ac40f,6c3e64a9..00000000
--- a/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
```


-- 
Best regards,
Eugen Konkov


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-03-22 22:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-22 22:27 -w flag of git diff command hide lines which should not be hidden Eugen Konkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).