Skip to content

Line number for a binary change (without hunks) #122

Closed

Description

@cpina

debdiff generates diff files such as the one in the unit test seen in:

cpina@7510966

I'd like to know which line of the diff the line: Binary files Binary files /t/p1/a.png and /t/p2/a.png differ is.

Since it doesn't have hunks I don't think that this is currently possible.

In PatchSet._parse there is unused_diff_line_no which likely contains it. I think that perhaps this could be added to PatchedFile and then the caller would have easy access.

Actually in other cases I get the line number of the first hunk of the file and substract 3 to get what would be the line number of the file.

Have this been discussed? I might propose an implementation if could be merged at that level (PatchedFile) but I haven't checked if this would require bigger changes everywhere.

Activity

  1. added a commit that references this issue on Jul 18, 2026
  2. matiasb commented on Jul 18, 2026

    @matiasb
    Owner

    Implemented by #136

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions