openhatch

Issue128

Title diff mission gives "will not apply correctly" when I think the diff is fine
Milestone 0.11.01 Priority feature
Waiting On Status resolved
Superseder Nosy List aldeka, grantbow, paulproteus, stump
Assigned To Keywords

Created on 2010-08-03.05:52:09 by paulproteus, last changed 2013-11-24.06:55:21 by paulproteus.

Files
File name Uploaded Type Edit Remove
broken-diff.diff paulproteus, 2010-08-03.05:52:09 text/x-patch
Messages
msg3976 (view) Author: paulproteus Date: 2013-11-24.06:55:21
We've changed the actual diff mission so it's less confusing. That resolves this 
bug. Thanks to all who helped with that, and to e.g. grantbow for pointing out 
the confusing nature of the previous mission
msg3267 (view) Author: grantbow Date: 2012-05-24.05:17:15
Simply saying "it works for me" means we have to go deeper to find the problem, 
even if the problem is "just the user." The point of missions is to teach, 
helping users. If it fails despite all reasonable attempts something needs to be 
improved somewhere. Please provide logs or instructions with code so I can try to 
reproduce it on another instance.
msg3262 (view) Author: grantbow Date: 2012-05-22.03:46:39
I tried it again and it didn't work with and without the blank line.
msg3244 (view) Author: grantbow Date: 2012-05-15.21:13:19
I did it with and without the blank line.
msg3243 (view) Author: paulproteus Date: 2012-05-15.21:00:00
Grant, the problem with your submission is that you didn't "remember the 
blank line", in "Take this sentence, and copy it underneath itself 
(remember the blank line!)."

But the deeper problem is that we don't give you enough hints to succeed. 
The point of this training mission is *not* to teach people to be 
sticklers about whitespace; that should come later, if at all. (-:

Grant, your idea of showing a diff between the submitted data and what we 
consider the correct data is a good one. It deserves a separate bug to be 
filed.

-- Asheesh.
msg3242 (view) Author: grantbow Date: 2012-05-15.20:54:19
I am feeling very, very frustrated. Is this the same problem as the svn mission?

What is submitted should be diffed against the correct answer after a couple
tries, don't you think?

error message: The file resulting from patching does not have the correct contents.

What I am pasting that fails:

--- diffsingle.txt	2012-05-15 13:47:14.056719074 -0700
+++ diffsingle-modified.txt	2012-05-15 13:49:21.285534685 -0700
@@ -1,3 +1,6 @@
+Move this sentence to at the start of the file, ensuring that it
+starts on the first line (remember about the blank lines!).
+
 This mission is to have you make modifications to a file and submit a
 diff of them. The changes may seem a bit silly, but they will cause the
 diff to contain examples of different types of changes - additions,
@@ -19,15 +22,10 @@
 
 Read this sentence, and leave it alone.
 
-Nod your head enthusiastically, and then remove this paragraph
-(being careful to keep just one blank line between the surrounding paragraphs).
-
+Take this sentence, and copy it underneath itself (remember the blank line!).
 Take this sentence, and copy it underneath itself (remember the blank line!).
 
-Move this sentence to at the start of the file, ensuring that it
-starts on the first line (remember about the blank lines!).
-
-There is a typo in this sentence, which oyu should fix.
+There is a typo in this sentence, which you should fix.
 
 Finally, save your changes in your editor and make a unified diff
 of your changes with the diff command. (If you're not sure how,
msg2771 (view) Author: paulproteus Date: 2011-12-04.20:16:44
The problem here, fwiw, is that aldeka moved (rather than copied) step 6.

I think we should change the mission so that fewer people make these sorts of
mistakes, but that's a separate bug.

Marking as resolved again for now.
msg2770 (view) Author: aldeka Date: 2011-12-04.20:12:04
Diff mission is failing. I suspect it's because of the name of my modified file. In any case, it's 
another data point.

--- diffsingle.txt	2011-12-04 12:03:38.000000000 -0800
+++ diffsingle2.txt	2011-12-04 12:04:51.000000000 -0800
@@ -3,26 +3,23 @@
 diff to contain examples of different types of changes - additions,
 deletions, and changes. Here is what we want you to do to this file:
 
+  0.  Make an exact copy of this step and place it before #1; change the
+      copy's step number to be 0.
+
   1.  Keep an unmodified copy of this file handy; you'll need it to
       make the diff once you're finished.
 
+  5.  Move this step so it comes between #1 and #2. (Again, don't
+      renumber the steps.)
+
   2.  Try to keep the formatting intact, as the result file will be
       compared character-for-character. There is exactly one blank line
       between each paragraph and bullet point, and all indentation is
       done with spaces. There is never trailing whitespace.
 
-  3.  Delete this step (and the blank line below it). (Don't renumber the
-      ones below it.)
-
   4.  Leave this step the way it is.
 
-  5.  Move this step so it comes between #1 and #2. (Again, don't
-      renumber the steps.)
-
-  6.  Make an exact copy of this step and place it before #1; change the
-      copy's step number to be 0.
-
-  7.  There is a typo in this step, which oyu should fix.
+  7.  There is a typo in this step, which you should fix.
 
   8.  Save the changes and make a unified diff of your changes using the
       diff command. Submit the diff on the page from which you obtained
msg816 (view) Author: paulproteus Date: 2011-01-27.23:11:09
Well, I tried it with GNU patch and our patch library from Python, and with
Luke's patch, it actually does *not* apply properly.

So I'm going to close this as "resolved". If someone can come up with a good
test case, we can have a new bug.
msg763 (view) Author: paulproteus Date: 2011-01-23.20:12:19
quietly deassigning from myself, for now.
msg707 (view) Author: paulproteus Date: 2011-01-08.22:04:39
Either this is a bug, or not.

Within 0.11.01, let's fix it or close the bug.
msg394 (view) Author: pythonian4000 Date: 2010-08-03.12:48:59
When I submit the exact diff that is supplied (Ctl+A, Ctl+C, Ctl+V), I get the
following error:

"The file resulting from patching does not have the correct contents."

When I move the added step 0 to the correct place in the diff then it passes. So
I don't see any problem here.
msg392 (view) Author: paulproteus Date: 2010-08-03.05:52:09
The attached .diff file is what lfaraone submitted as the answer to 
http://openhatch.org/missions/diffpatch/diffsingle

Alas, it told him, "The patch will not apply correctly to the original file."

But I watched him make it! It seemed fine.

(I know that he did the step 0 insertion wrong, but I don't think that's the 
problem. If it is, then the problem is "simply" the error message.)
History
Date User Action Args
2013-11-24 06:55:21paulproteussetstatus: reopened -> resolved
messages: + msg3976
2012-05-24 05:17:18grantbowsetmessages: + msg3267
2012-05-22 03:46:43grantbowsetmessages: + msg3262
2012-05-15 21:13:19grantbowsetmessages: + msg3244
2012-05-15 21:12:43grantbowsetnosy: + grantbow
2012-05-15 21:00:02paulproteussetmessages: + msg3243
2012-05-15 20:54:20grantbowsetstatus: resolved -> reopened
messages: + msg3242
2011-12-04 20:16:44paulproteussetstatus: reopened -> resolved
messages: + msg2771
2011-12-04 20:12:05aldekasetstatus: resolved -> reopened
messages: + msg2770
2011-01-27 23:11:10paulproteussetstatus: chatting -> resolved
messages: + msg816
2011-01-23 20:12:19paulproteussetassignedto: paulproteus ->
messages: + msg763
2011-01-08 22:04:39paulproteussetmessages: + msg707
milestone: 0.11.01
2010-10-22 06:19:56aldekasetnosy: + aldeka
2010-08-03 12:48:59pythonian4000setstatus: unread -> chatting
messages: + msg394
2010-08-03 05:52:09paulproteuscreate