[plt-dev] Re: generating patches

From: Štěpán Němec (stepnem at gmail.com)
Date: Wed May 26 06:34:29 EDT 2010

Matthew Flatt <mflatt-sDh8Nw2yj/+Vc3sceRu5cw at public.gmane.org> writes:

> At Tue, 25 May 2010 19:33:31 -0400, David Van Horn wrote:
>> How do I generate a patch from changes to my local git branch of the 
>> racket sources?  If I just use git diff -p I don't see any of the files 
>> I added; only the changes to the existing files.  For the files I added, 
>> I did a git add and git commit, but I still don't see the contents in 
>> git diff.
> It's easiest to use
>   git format-patch <since-SHA1>
> Without any arguments, `git diff' tells you about added but
> not-yet-committed changes.

No, `git diff' tells you about the changes that were not even added,
i.e. changes in the work tree (as opposed to the index/staging area). If
you want to see the added (i.e. to-be-committed, in the index) changes,
you have to use `git diff --cached'.


Posted on the dev mailing list.