[Feature] Support custom `git diff` options
See original GitHub issueYesterday, 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:
- Created 6 years ago
- Comments:16 (10 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just tried it, works perfectly for me 👍
Closing this issue due to inactivity.