Thread (7 messages) flat view 7 messages, 3 authors, 2016-06-15

git-apply{,mbox,patch} should default to --unidiff-zero

From: Adrian Bunk <hidden>
Date: 2016-06-15 22:43:19

I just ran into the following issue:

I sent someone a patch that purposefully contained a chunk without 
context, and git-apply of the recipient refused to apply it without
an explicit --unidiff-zero.

git-apply{,mbox,patch} should default to doing --unidiff-zero:
Generating a patch without context is something I have to do explicitely 
by giving "diff" an option or by manually editing the patch. I know 
about the dangers of having no context, but there are use cases where
I know that replacing and/or deleting one or more lines is safe even 
without context and where I want to avoid context e.g. for avoiding to 
clash with other patches.

Example use case:
Look at the file Documentation/feature-removal-schedule.txt in the Linux 
kernel. If I want to send someone two independent patches removing 
adjanced entries in this file, the patches can be applied in any order 
exactly as long as this chunk does not contain any context. Removing an 
entry from this file is obviously safe even without any context.

TIA
Adrian

BTW: Please Cc me on replies.

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help