From: Junio C Hamano Date: Fri, 13 May 2005 23:05:57 GMT Subject: Re: [PATCH] Resurrect diff-tree-helper -R Message-ID: <7vbr7e9162.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <20050513224529.GF32232@pasky.ji.cz> >>>>> "PB" == Petr Baudis writes: PB> that is, using a '@.' prefix for those. It seems to be unique enough and PB> '@' is one of the four magic characters prefixing diff lines. Just using PB> the plain string seems too volatile, and I need to grep all the PB> interesting bits out of the diff file. This is because patch can PB> otherwise complain "only garbage found in the patch" when processing the PB> diff, which confuses my users greatly. PB> What do you think? Personally what I think is that grepping in the diff, especially if the diff is something you are generating (I am assuming that you are taling about cg-diff fed to cg-patch to port work tree changes forward), is a wrong way to do things. The way JIT does the equivalent is via git-apply-patch-script. You run git-diff-{files,cache,tree}, setting GIT_EXTERNAL_DIFF environment variable to git-apply-patch-script, and have the apply-patch-script to take care of the mode changes, creation, etc. See the implementation of the jit-patch command if you are interested.