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

Bug 423610

Summary: successful status text shown when patch fails to apply
Product: [ECD] Orion Reporter: Grant Gayed <grant_gayed>
Component: GitAssignee: Eric Moffatt <emoffatt>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: Carolyn_MacLeod, emoffatt, grant_gayed, snorthov
Version: 5.0Keywords: triaged
Target Milestone: 10.0   
Hardware: PC   
OS: All   
See Also: https://git.eclipse.org/r/57432
https://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/?id=3bd58d3f809433550d6d035e506d06a9a6e3d7b0
Whiteboard:
Attachments:
Description Flags
apply this file as a patch and it'll look like it succeeded...why? none

Description Grant Gayed CLA 2013-12-09 11:45:21 EST
I20131207-1412

After selecting a patch to apply the status message shown is: "Patch applied, files modified:".  The message's trailing ':' indicates that there's likely a list of modified files following, but they don't appear in the status message.  The list of modified files should either be included in the displayed text, or the message could change to something that does not set this expectation, like "Patch applied".
Comment 1 Grant Gayed CLA 2013-12-09 11:51:03 EST
Actually the problem is not what I thought, I now see that the patch was not successfully applied.  I have not looked into whether this failure is legitimate or not, but the status message that was shown is misleading.  Its problem is not the missing list of modified files, since in this case this set is in fact empty, but it should have been an error status message with words indicating the failure.
Comment 2 Grant Gayed CLA 2013-12-09 11:54:39 EST
The patch file I was trying to apply was not actually a patch file, so the failure is legitimate, just the resulting message that is not.
Comment 3 Grant Gayed CLA 2015-05-04 10:05:59 EDT
Still happens in the latest, providing my id_dsa file as the patch file showed a "successfully applied" status.
Comment 4 Steve Northover CLA 2015-07-03 10:06:59 EDT
We can't be telling people that a patch file has applied when it has not, even if the file is garbage.  Please fix this.
Comment 5 Eric Moffatt CLA 2015-10-05 11:09:45 EDT
This is at least partly fixed; the message no longer has a ':' in it and we can induce a valid failure message applying a corrupted patch.

However, we also tried applying a regular txt file as a patch (attachment coming) and it gave a success message even though it couldn't have worked...
Comment 6 Eric Moffatt CLA 2015-10-05 11:10:27 EDT
Created attachment 257042 [details]
apply this file as a patch and it'll look like it succeeded...why?
Comment 7 Eric Moffatt CLA 2015-10-05 14:08:08 EDT
This is a case where JGIT is actually incorrectly stating that the file correctly 'applied' as a patch (but if you look at the results then while there are no errors there are also no files...).

I'm looking at detecting this in the server side handler for this, checking if any files have changes and indicating an 'Incorrect patch format' if no files have changed (sort of a philosophical question.."Can a patch that changes no files be correctly formatted?").
Comment 8 Eclipse Genie CLA 2015-10-05 14:34:24 EDT
New Gerrit change created: https://git.eclipse.org/r/57432
Comment 10 Eric Moffatt CLA 2015-10-05 14:47:27 EDT
Thanks Silenio...

If anybody wants to change the message go ahead, it's the best we could come up with...