0

I am exporting database DDL files from Oracle and adding them to Git.

When I add a new table, therefore exporting a new DDL file for that table, Git seems to think it is is a copy of an existing file, and not a new file (see screenshot). I understand Git operates on the hashed contents of the file - but these could never have had the same hash, they are different tables and so the DDL always differs, even if the column names are the same in the table definition.

enter image description here

Biffen
  • 6,249
  • 6
  • 28
  • 36
smackenzie
  • 2,880
  • 7
  • 46
  • 99
  • 1
    It doesn't matter. Git uses similarity to existing files to decide if something is a copy or new, but the decision doesn't actually have any effect outside of how diffs/logs might be displayed. Note that the "solutions" in the linked-to question are all about `git diff` and `git log`, because the information is re-calculated when needed and not stored. – Joachim Sauer Aug 16 '21 at 13:54
  • 2
    On a completely unrelated note: I hate the code style of putting the `(` on a new line, but following it up with the first column. Who does that? ;-) – Joachim Sauer Aug 16 '21 at 13:56
  • 1
    XD yeah, who does that? :/ – eftshift0 Aug 16 '21 at 13:57
  • @JoachimSauer SQL developer does that when you choose Pretty Print as the DDL export option – smackenzie Aug 16 '21 at 15:04
  • 1
    @smackenzie: that makes sense. I wouldn't trust Oracle with anything DB-related ;-) – Joachim Sauer Aug 16 '21 at 15:09
  • @JoachimSauer can I recalculate after a commit, how diff displays these? I need to keep on top of data model changes, and it is very confusing seeing new tables listed as copies of old ones!! – smackenzie Aug 16 '21 at 15:14

0 Answers0