Skip to content

file command labels both sides with the NEW filename #12

Description

@n1ckyb

The bug

intentumdiff file OLD NEW labels both sides with the NEW filename.

printf "def greet(name):\n    return 'hi ' + name\n" > a.py
printf "def greet(name):\n    if not name:\n        return None\n    return 'hi ' + name\n" > b.py
intentumdiff --no-banner file a.py b.py
+---- Semantic diff -----+
| Old       b.py         |     <-- should be a.py
| New       b.py         |
| Language  python       |
| Scope     working tree |     <-- questionable for two local files
| Changes   1            |
+------------------------+

The diff itself is correct — one ADDITION, Insert -> if_statement. Only the header is wrong.

Why it matters more than it looks

This is the first thing a new user sees, and it says the tool compared a file with itself. It
reads as "this tool is broken" before anyone gets as far as the result, which is right
underneath and perfectly good.

Scope: working tree is also misleading for two explicitly named local files — nothing about
that invocation involves a working tree.

Environment

Reproduced against a locally built 0.0.1b1 (release core) on Windows.

Definition of done

  • Old shows the first path as given, New the second
  • Scope reflects the actual invocation, or is omitted when it does not apply
  • A test asserts the header, since the diff being right is clearly not sufficient

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions