Skip to content

The --no-ext-diff is not passed to git diff commands #1585

Description

@diniamo

Affected Version

paru v2.1.0 - libalpm v16.0.1

Description

Paru uses git diff to produce .diff files for AUR packages that are being updated. In my eyes .diff files a expected (by me and by my editor for highlighting) to use the regular diff syntax, not whatever my external diff tool provides. Even if I wanted to use my external diff tool, I would need colors, because it's unreadable without them, but paru disables colors with --color=never. I think the most sensible solution here is to simply always pass the --no-ext-diff flag to git diff.

I tried fixing this on my end, but as far as I can tell, the only way to disable it is using the --no-ext-diff flag passed to git diff (not git!), which paru doesn't let me do. Git has no flags or environment variables for unsetting options (I can only set diff.external to an empty string, which will make git diff error). The only way then to fix this is on my end is by creating a git wrapper script for paru that checks if the subcommand used is diff, and if so appends the --no-ext-diff flag, but this is a massive hack. So if for some reason, --no-ext-diff shouldn't always be passed (in my opinion, it should, as I explained previously), a GitDiffFlags option could be added to paru to let users pass it.

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