git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git-apply{,mbox,patch} should default to --unidiff-zero
@ 2007-07-05 23:22 Adrian Bunk
  2007-07-06  1:18 ` Johannes Schindelin
  0 siblings, 1 reply; 10+ messages in thread
From: Adrian Bunk @ 2007-07-05 23:22 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-07-06 12:57 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-05 23:22 git-apply{,mbox,patch} should default to --unidiff-zero Adrian Bunk
2007-07-06  1:18 ` Johannes Schindelin
2007-07-06  1:42   ` Adrian Bunk
2007-07-06  1:51     ` Johannes Schindelin
2007-07-06  2:26       ` Adrian Bunk
2007-07-06  3:16         ` Johannes Schindelin
2007-07-06  4:12           ` Linus Torvalds
2007-07-06  5:41             ` Junio C Hamano
2007-07-06 12:14               ` Adrian Bunk
2007-07-06 12:49                 ` Johannes Schindelin

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 NNTP newsgroup(s).