user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
* [PATCH] solvergit: use --unidiff-zero with git-apply(1)
@ 2019-11-14  1:03 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2019-11-14  1:03 UTC (permalink / raw)
  To: meta

I sometimes post context-free documentation patches generated
with "-U0" to reduce size and bandwidth overhead when replacing
URLs or updating copyright notices.  git-apply(1) needs the
--unidiff-zero switch to work properly with context-free
patches.

Given our search looks for blob OIDs, and we're never going
to be running the code we regenerate, "--unidiff-zero" ought
to be safe.
---
 lib/PublicInbox/SolverGit.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/PublicInbox/SolverGit.pm b/lib/PublicInbox/SolverGit.pm
index b7327ffa..95334d7a 100644
--- a/lib/PublicInbox/SolverGit.pm
+++ b/lib/PublicInbox/SolverGit.pm
@@ -450,7 +450,7 @@ sub do_git_apply ($) {
 
 	# we need --ignore-whitespace because some patches are CRLF
 	my @cmd = (qw(git -C), $dn, qw(apply --cached --ignore-whitespace
-			--whitespace=warn --verbose));
+			--unidiff-zero --whitespace=warn --verbose));
 	my $len = length(join(' ', @cmd));
 	my $total = $self->{tot};
 	my $di; # keep track of the last one for "git ls-files"

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-11-14  1:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-14  1:03 [PATCH] solvergit: use --unidiff-zero with git-apply(1) Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).