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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux