If you look at the "Git instructions" tab for the project you're working on I think you'll find more mature instructions for patch creation.<br><br>When you find a git documentation problem like this, please file an issue at <a href="http://drupal.org/project/issues/git_dev">http://drupal.org/project/issues/git_dev</a><br>
<br>My approaches to patch creation: <a href="http://randyfay.com/node/97">http://randyfay.com/node/97</a><br><br>-Randy<br><br><div class="gmail_quote">On Mon, Apr 11, 2011 at 11:28 AM, Kyle Mathews <span dir="ltr"><<a href="mailto:mathews.kyle@gmail.com">mathews.kyle@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hmm... well those instructions are wrong I guess.<div><br></div><div>"git diff" is the diff of changes since the last commit that have <i>not</i> been staged. So once you've added a file via "git add", it won't show up anymore when you run "git diff".</div>
<div><br></div><div>If you want to see the diff between the last commit and staged files, run "git diff --cached"</div><div><br clear="all"><font color="#888888">--<br>Kyle Mathews<br><br>Blog: <a href="http://kyle.mathews2000.com/blog" target="_blank">kyle.mathews2000.com/blog</a><br>
Twitter: <a href="http://twitter.com/kylemathews" target="_blank">http://twitter.com/kylemathews</a></font><div><div></div><div class="h5"><br><br>
<br><br><div class="gmail_quote">On Mon, Apr 11, 2011 at 10:16 AM, Dave Cohen <span dir="ltr"><<a href="mailto:drupal@dave-cohen.com" target="_blank">drupal@dave-cohen.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'm trying, and failing, to create a patch that adds new files to a module.<br>
<br>
According to <a href="http://drupal.org/node/707484" target="_blank">http://drupal.org/node/707484</a>, I should simply run `git add ...` then "Next time you run git diff, these new files will be included as well." In my experience, this statement is false.<br>
<br>
When I run `git status`, I see something like this:<br>
<br>
[dave@starbuck fb-3]$ git status<br>
# On branch 6.x-3.x<br>
# Changes to be committed:<br>
# (use "git reset HEAD <file>..." to unstage)<br>
#<br>
# new file: fb.process.inc<br>
# new file: fb_tab.js<br>
#<br>
# Changes not staged for commit:<br>
# (use "git add <file>..." to update what will be committed)<br>
# (use "git checkout -- <file>..." to discard changes in working directory)<br>
#<br>
# modified: README.txt<br>
# modified: contrib/fb_example.module<br>
# modified: fb.module<br>
# modified: fb_canvas.admin.inc<br>
# modified: fb_canvas.module<br>
# modified: fb_devel.module<br>
# modified: fb_settings.inc<br>
# modified: fb_tab.admin.inc<br>
# modified: <a href="http://fb_tab.info" target="_blank">fb_tab.info</a><br>
# modified: fb_tab.module<br>
# modified: fb_url_rewrite.inc<br>
<br>
<br>
When I run `git diff`, I see changes to all the modified files, but I do not see the new files.<br>
<br>
What am I missing? Thanks,<br>
<font color="#888888"><br>
-Dave<br>
</font></blockquote></div><br></div></div></div>
</blockquote></div><br><br clear="all"><br>-- <br>Randy Fay<br>Drupal Module and Site Development<br><a href="mailto:randy@randyfay.com">randy@randyfay.com</a><br>+1 970.462.7450<br><br>