On Wed, Jun 21, 2006 at 06:22:58PM -0700, Linus Torvalds wrote:
> 
> 
> On Wed, 21 Jun 2006, Greg KH wrote:
> > 
> > Ok, but how?  I'm generating the diffstat in my script with:
> > 
> >     git diff origin..HEAD | diffstat -p1 >> $TMP_FILE
> 
> Btw, with a recent git (ie 1.4.0+), you can just do
> 
>       git diff -M --stat origin..HEAD
> 
> to do that much more efficiently, and without any external dependency on 
> the "diffstat" program (with rename detection, you really need to do this 
> using git itself, because "diffstat" doesn't understand rename patches 
> being renames).

Great, thanks, that works fine.  And it's faster :)

> In fact, in a script, add the "--summary" option too, which gives a 
> summary of file creation/deletion/renames at the end.

Ok, will do.  The next pull I send you will have the new format.

> And as usual, the diff options work fine with "git log" too, so you can do
> 
>       git log -M --stat --summary
> 
> and it will do the right thing. Look at your ae0dadcf.. commit, for 
> example.
> 
> Btw, the _one_ thing to be careful about is that when you generate a real 
> patch with "-M", if that patch actually has a rename, then only "git 
> apply" will be able to apply it correctly, and if somebody uses a regular 
> "patch" program to apply it, they'll miss out on the rename, of course.
> 
> Some day maybe the git "extended patch format" is so univerally recognized 
> to be superior that everybody understands them, in the meantime you may 
> not want to use "-M" to generate patches unless you know the other end 
> applies them with git.
> 
> (Which also explains why "-M" is not the default, of course).

For now I'll leave -M off, as people might want to apply the patches
from email.  Although it might cut down on main bandwidth, and they can
always refer to the git tree or original patch...  I'll think about that
one.

thanks,

greg k-h

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to