[development] using git, create patch with new files

Randy Fay randy at randyfay.com
Mon Apr 11 17:40:05 UTC 2011


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.

When you find a git documentation problem like this, please file an issue at
http://drupal.org/project/issues/git_dev

My approaches to patch creation: http://randyfay.com/node/97

-Randy

On Mon, Apr 11, 2011 at 11:28 AM, Kyle Mathews <mathews.kyle at gmail.com>wrote:

> Hmm... well those instructions are wrong I guess.
>
> "git diff" is the diff of changes since the last commit that have *not*been staged. So once you've added a file via "git add", it won't show up
> anymore when you run "git diff".
>
> If you want to see the diff between the last commit and staged files, run
> "git diff --cached"
>
> --
> Kyle Mathews
>
> Blog: kyle.mathews2000.com/blog
> Twitter: http://twitter.com/kylemathews
>
>
>
>
> On Mon, Apr 11, 2011 at 10:16 AM, Dave Cohen <drupal at dave-cohen.com>wrote:
>
>> I'm trying, and failing, to create a patch that adds new files to a
>> module.
>>
>> According to http://drupal.org/node/707484, 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.
>>
>> When I run `git status`, I see something like this:
>>
>> [dave at starbuck fb-3]$ git status
>> # On branch 6.x-3.x
>> # Changes to be committed:
>> #   (use "git reset HEAD <file>..." to unstage)
>> #
>> #       new file:   fb.process.inc
>> #       new file:   fb_tab.js
>> #
>> # Changes not staged for commit:
>> #   (use "git add <file>..." to update what will be committed)
>> #   (use "git checkout -- <file>..." to discard changes in working
>> directory)
>> #
>> #       modified:   README.txt
>> #       modified:   contrib/fb_example.module
>> #       modified:   fb.module
>> #       modified:   fb_canvas.admin.inc
>> #       modified:   fb_canvas.module
>> #       modified:   fb_devel.module
>> #       modified:   fb_settings.inc
>> #       modified:   fb_tab.admin.inc
>> #       modified:   fb_tab.info
>> #       modified:   fb_tab.module
>> #       modified:   fb_url_rewrite.inc
>>
>>
>> When I run `git diff`, I see changes to all the modified files, but I do
>> not see the new files.
>>
>> What am I missing?  Thanks,
>>
>> -Dave
>>
>
>


-- 
Randy Fay
Drupal Module and Site Development
randy at randyfay.com
+1  970.462.7450
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20110411/1aad608a/attachment.html 


More information about the development mailing list