Skip to content

Make git diff .. less confusing for newbies #249

@Denton-L

Description

@Denton-L

It's pretty ridiculous how the meaning of .. and ... is exactly swapped for log and diff: log A..B is changes from merge base to B which is what diff A...B does

-phiresky link

The semantics of .. vs ... are essentially swapped between diff and the log family of commands. This is because diff uses setup_revisions but abuses the way that the returned endpoints are used.

There are several options to deal with this:

  • Print a warning into the output if a user uses git diff A..B instead of git diff A B (see here)

  • Update the documentation for git-diff so that it's obvious why this is happening (so we tell users about how range-notation is implemented). Upside is users will understand why git diff foo@^! works as well. Downside is that I'm not sure it's productive to expose implementation details to end-uers.

  • Swap the meaning of .. and .... One can dream...

  • Something else? I've been mulling over it and not wanting to contribute a patch because there might be some cleaner way to resolve this. Not really sure how.

See:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions