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

Re: [PATCH 1/8] git-apply: work from subdirectory.

From: Linus Torvalds <torvalds@osdl.org>
Date: 2016-06-15 22:42:13

Possibly related (same subject, not in this thread)


On Sat, 26 Nov 2005, Junio C Hamano wrote:
This adds three things:

 - prefix_filename() is like prefix_path() but can be used to
   name any file on the filesystem, not the files that might go
   into the index file.

 - git-apply uses setup_git_directory() to find out the GIT_DIR
   and reads configuration file.  Later this would allow us to
   affect the behaviour of the command from the configuration.

 - When git-apply is run from a subdirectory, it applies the
   given patch only to the files under the current directory and
   below.

Signed-off-by: Junio C Hamano <redacted>
This breaks git-apply when used to just do a "diffstat", or when used on a 
non-git repository.

For "git-apply --stat", we definitely don't want to force it inside a git 
directory. In fact, even _trying_ to find a git directory would be wrong.

The only case where we care about a git directory is the "--index" case. 
In all other cases we should happily apply it (or stat it).

		Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help