Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 361954

Summary: Create patch generates patches with no eol on the last line
Product: [Technology] EGit Reporter: Thomas Watson <tjwatson>
Component: CoreAssignee: Project Inbox <egit.core-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: markus.kell.r, matthias.sohn, remy.suen, stefan.lay
Version: unspecified   
Target Milestone: 3.0   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Thomas Watson CLA 2011-10-25 12:11:04 EDT
Build 1.2.0.201110240523

Not sure if this is MAC specific.  If I generate a patch from eGit the patch generated does not have an End Of Line for the last line.  The result is I cannot apply the patch with command line git.

You can apply through eGit, but this is not very nice at the moment for git style patches that include commit comments and author identity.  For these type of patches I would like to use the "git am" command.

Editing the patch file to add and EOL to the end of the file works around the issue.
Comment 1 Markus Keller CLA 2012-02-01 10:09:36 EST
Maybe bug 367623 would fix this?
Comment 2 Thomas Watson CLA 2012-08-23 13:29:21 EDT
This seems like a pretty easy bug to fix, but it is causing me issues.  Every time I get a patch from someone I proceed to apply it and get some strange message about the patch not being valid.  Then I have to remember, oh they probably created the patch with eGit and it has no EOL at the end of the file.  Can we get this fixed?
Comment 3 Matthias Sohn CLA 2013-05-23 18:36:18 EDT
(In reply to comment #0)
> Build 1.2.0.201110240523
> 
> Not sure if this is MAC specific.  If I generate a patch from eGit the patch
> generated does not have an End Of Line for the last line.  The result is I
> cannot apply the patch with command line git.
> 
> You can apply through eGit, but this is not very nice at the moment for git
> style patches that include commit comments and author identity.  For these
> type of patches I would like to use the "git am" command.
> 
> Editing the patch file to add and EOL to the end of the file works around
> the issue.

I can't reproduce this with EGit 3.0.0-SNAPSHOT and git 1.8.2.1 on Mac OS X 10.8.3. With this version I am able to git apply a patch file created with EGit which doesn't end with a LF.

If this still doesn't work for some scenario reopen and provide steps to reproduce