title: What can I do to prevent write-write conflicts on a wiki-style website?
body: <p>On a wiki-style website, what can I do to prevent or mitigate <a href="http://en.wikipedia.org/wiki/Write-Write_conflict" rel="noreferrer">write-write conflicts</a> while still allowing the site to run quickly and keeping the site easy to use?</p>
  
  <p>The problem I foresee is this:</p>
  
  <ol>
  <li>User A begins editing a file</li>
  <li>User B begins editing the file</li>
  <li>User A finishes editing the file</li>
  <li>User B finishes editing the file, accidentally overwriting all of User A's edits</li>
  </ol>
  
  <p>Here were some approaches I came up with:</p>
  
  <ul>
  <li>Have some sort of check-out / check-in / locking system (although I don't know how to prevent people from keeping a file checked out "too long", and I don't want users to be frustrated by not being <em>allowed</em> to make an edit)</li>
  <li>Have some sort of <a href="http://en.wikipedia.org/wiki/Diff" rel="noreferrer">diff</a> system that shows an other changes made when a user commits their changes and allows some sort of merge (but I'm worried this will hard to create and would make the site "too hard" to use)</li>
  <li>Notify users of concurrent edits <em>while</em> they are making their changes (some sort of AJAX?)</li>
  </ul>
  
  <p>Any other ways to go at this?  Any examples of sites that implement this well?</p>