Tuesday, January 24, 2012

When your SVN gets F'd.

So far, two students have screwed up. Shame on you!*

Time to play detective. How did I figure this out? Who screwed up and how? What should they have done differently? How did I repair the repository?

Please discuss in the comments section.

Here are two links to add to your reading. They are the first hits when you google "svn resolve conflict".
http://ariejan.net/2007/07/04/how-to-resolve-subversion-conflicts
http://www.logicaltrinkets.com/wordpress/?p=178


*just kidding. Mistakes are learning experiences.

8 comments:

  1. Without access the actual file, I'd guess that a change was committed (or attempted) that created a conflict. Can you you give us more details on the file you found? It could have been overwritten, merged, or the local changes discarded in favor of the changes on the server. The remediation would depend on what you found, but most likely a manual fix.

    ReplyDelete
  2. You have access to the same information as I do.

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
    Replies
    1. Discovered the awesomeness of checking out older revisions and the log to try and see what was going on. I'm looking to see if I can figure out what happened.

      Delete
    2. Alright, did some detective work with old versions of roster.txt and the svn log command.

      ***How did you figure it out?
      Probably the same way I did. There was an empty roster.txt (uh oh), you checked the logs to see who last committed, noticed the roster.txt was complete a revision back, then put 2 and 2 together.

      ***Who screwed up and how?
      I don't want to call out names on the blog, so I'll just refer to users responsible for certain revisions.

      1) User responsible for versions 24-26 seems to have accidentally left behind some revision marks on their first try, then got their name in. Revision marks might have come from partially deleted marks from a conflict that was manually merged.

      2) User responsible for version 32 left a space at the top of the file.

      3) User responsible for revision 37 accidentally erased the roster.txt file. Instructor notices and restores roster.txt in version 38.

      4) User responsible for revision 44 appears to have run into a conflict. Two other students checked out the same version, but committed before the user did. It appears the user chose to manually merge the roster.txt back into the repository, but did not remove the special conflict marks added (.mine, etc.).

      ***What should they have done differently?
      I'm not sure what happened to the user who deleted the roster.txt file. Could have been a bunch of things. They may or may not have even realized they did it.

      The user who got the conflict could have chosen to revert or to resolve the file rather than merging it to avoid dealing with the formatting marks. Merging the file and taking care of the formatting marks would probably have been the best option, that way the user doesn't inadvertently drop other students off the list by resolving their incomplete file.

      ***How did you repair the repository
      You probably just checked out the version of roster.txt immediately prior to it being erased, committed it as the current version.

      Well, that was a mouthful, but a fun exercise.

      Delete
    3. Zach shows some definite sleuthing ability here, but hasn't quite got everything perfectly.

      One helpful unix command is "diff". The main way it's used is by typing:
      diff file1 file2
      It will show you all the differences between the two files, in a compact shorthand.

      There is also a version within svn, "svn diff". One way to use it is;
      svn diff -r9:10
      This will show you the differences (file by file and line by line) between revision 9 and 10.

      As you can imagine, this is very helpful for unravelling this kind of mystery.

      Delete
  4. From what I have seen in both the roster.txt file and and svn log display IS two or more people have placed there names in the .mine directory of roster.txt. There are also names that are bellow the line in the file may also be one of the problems. As for how the problem was resolved I am at a loss..

    ReplyDelete
  5. Also, For those of you who have NO clue what-so-ever about subversion (this was me when I was introduced to it) I wrote a short pdf explaining the BASIC commands svn uses and what they do. It doesn't cover any merging issues, but hopefully it sheds some light on what SVN really does and how incredibly useful it is! If I made a mistake on there, feel free to tell me. Here's the link and its also on my webpage

    http://cs.unm.edu/~tberge01/files/subversion.pdf

    ReplyDelete