question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature] Support custom `git diff` options

See original GitHub issue

Yesterday, patch-package created a diff that contained all of the patched file, even though only some lines changed. The culprit in this case were differences in line-endings; my locally changed files had only LFs in them (edited on Mac) but the files installed via npm contained (CRs). I then created a patch manually with --strip-trailing-cr which only included the lines that actually changed.

I’m note sure whether the Git config affects how patches are created and applied, so I propose adding an option to patch-package (and maybe make it the default?) to ignore changes w.r.t. line endings and/or whitespaces.

Maybe you want to ponder adding an option to pass arbitrary parameters to git diff just in case 😉

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:16 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
alexandrospanagiotidiscommented, Oct 19, 2017

Just tried it, works perfectly for me 👍

0reactions
ds300commented, Jan 27, 2019

Closing this issue due to inactivity.

Read more comments on GitHub >

github_iconTop Results From Across the Web

diff-options Documentation - Git
This format lists the commits in the range like git-submodule[1] summary does. When --submodule=diff is specified, the diff format is used. This format...
Read more >
git-diff Documentation - Git
This form is to view the changes you made relative to the index (staging area for the next commit). In other words, the...
Read more >
git-difftool Documentation - Git
Specify a custom command for viewing diffs. git-difftool ignores the configured defaults and runs $command $LOCAL $REMOTE when this option is specified.
Read more >
diff-config Documentation - Git
Generate diffs with <n> lines of context instead of the default of 3. This value is overridden by the -U option. diff.interHunkContext. Show...
Read more >
[<path>…​] git diff [options] --cached [<commit>] [--]
This form is to view the changes you have in your working tree relative to the named <commit>. You can use HEAD to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found