Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

diff mission gives "will not apply correctly" when I think the diff is fine #443

Closed
imported-from-roundup opened this Issue · 0 comments

1 participant

@imported-from-roundup

Comment by paulproteus:

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.)


Comment by pythonian4000:

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.


Comment by paulproteus:

Either this is a bug, or not.

Within 0.11.01, let's fix it or close the bug.


Comment by paulproteus:

quietly deassigning from myself, for now.


Comment by paulproteus:

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.


Comment by aldeka:

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.
    1. Move this step so it comes between #1 and #2. (Again, don't
  •  renumber the steps.)
    

    +

    1. 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.
    1. Delete this step (and the blank line below it). (Don't renumber the

- ones below it.)

  1. 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.
    1. There is a typo in this step, which you should fix.
    1. 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


Comment by paulproteus:

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.


Comment by grantbow:

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,


Comment by paulproteus:

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.


Comment by grantbow:

I did it with and without the blank line.


Comment by grantbow:

I tried it again and it didn't work with and without the blank line.


Comment by grantbow:

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.


Comment by paulproteus:

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


File at http://roundup-archive.openhatch.org/bugs/file66/broken-diff.diff by paulproteus

Status: resolved
Nosy List: aldeka, grantbow, paulproteus, stump
Priority: feature
Imported from roundup ID: 128 (view archived page)
Last modified: 2013-11-24.06:55:21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.