Skip to content

Fix patch commands when git config has color=always#5405

Open
matthijskooijman wants to merge 1 commit intojesseduffield:masterfrom
matthijskooijman:fix-patch-with-color-always
Open

Fix patch commands when git config has color=always#5405
matthijskooijman wants to merge 1 commit intojesseduffield:masterfrom
matthijskooijman:fix-patch-with-color-always

Conversation

@matthijskooijman
Copy link

This is the same option as used by pkg.commands.git_commands.diff.GetDiff().

This fixes some operations patch operation (tested with moving patch to another commit) with git config set --global color.ui always (or color.diff always).

Please check if the PR fulfills these requirements

  • Cheatsheets are up-to-date (run go generate ./...) <-- N/A
  • Code has been formatted (see here)
  • Tests have been added/updated (see here for the integration test guide) <-- No existing tests for this code
  • Text is internationalised (see here) <-- N/A
  • If a new UserConfig entry was added, make sure it can be hot-reloaded (see here) <-- N/A
  • Docs have been updated if necessary <-- N/A
  • You've read through your own file changes for silly mistakes etc

This is the same option as used by pkg.commands.git_commands.diff.GetDiff().
Copy link

@themavik themavik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Patch parsing assumes plain diff text; forcing --no-color beside --no-ext-diff stops ANSI escapes when color=always is set globally.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants