Re: [PATCH] Teach 'git apply' to look at $GIT_DIR/config

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

 



On Mon, 19 Feb 2007, Linus Torvalds wrote:

> Imagine somebody sending you a patch to a set of files, and they didn't 
> use git to generate that patch. What would it look right? Right, it might 
> well look like
> 
> 	diff -u file.c.orig file.c
> 	--- file.c.orig
> 	+++ file.c
> 	@@ -29,6 +29,7 @@
> 	...
> 
> and it happens to be in some subdirectory. What would you do?
> 
> I'd use "git apply". And I would be really upset *if* git-apply actually 
> applied the patch to some *other* subdirectory than the one I was in.

"git apply" should be able to notice the many clues that this patch 
doesn't go at the root: (1) it's not -r; (2) it's not a rename, but the 
filenames aren't the same; (3) there isn't an extra path element to 
remove.

Wouldn't the patch author have to do something like 
"cd drivers; diff -ur usb.orig usb > patch" (i.e., have old and new 
_directories_ in the _same_ source tree, rather than just files, or 
separate source trees) in order to generate a patch that would be confusing?

I think "git apply" should just know that if the filenames don't match, 
and it's not a rename, and the --- filename isn't /dev/null, then add the 
current directory and use -p0.

	-Daniel
*This .sig left intentionally blank*
-
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]