#4691 Fix last commit info

forge-feb-08
closed
Cory Johns
None
General
16
2014-08-23
2012-08-10
Cory Johns
No

The following corner cases exist for displaying last commit information correctly. There should be explicit test cases for these cases. It will almost certainly require a change to the LastCommitDoc structure.

  • Two identical files are committed at different times in the same tree level:
    • commit1 = Add /file1
    • commit2 = Add /file2
      • hash(/file1) == hash(/file2)
  • Two identical files are committed at different times in different tree levels:
    • commit1 = Add /dir1/file1
    • commit2 = Add /dir2/file2
      • hash(/dir1/file1) == hash(/dir2/file2)
      • hash(/dir1/) == hash(/dir2/)
    • commit3 = Add /dir2/file3
      • hash(/dir2/file2) != hash(/dir2/file3)
      • hash(/dir1/) != hash(/dir2/)
  • Two identical copies of a directory are committed at different times (e.g., recursive copy of dir):
    • commit1 = Add /dir1/file1
    • commit2 = Add /dir1-copy/file1
      • hash(/dir1/file1) == hash(/dir1-copy/file1)
      • hash(/dir1/) == hash(/dir1-copy/)
    • (i.e., trees, like files, can have matching hashes but different commit info)
  • File is changed then reverted to original content:
    • commit1 = Add /file1
      • hash(/file1) == F0
      • hash(/) == T0
    • commit2 = Change /file1
      • hash(/file1) == F1
      • hash(/) == T1
    • commit3 = Revert /file1
      • hash(/file1) == F0
      • hash(/) == T0
    • (view as of commit3 should show commit3 message, but view as of commit1 should show commit1 message despite identical hashes)
  • All of these cases also have to work across repos, though ideally with minimal duplication of data (forks)

  • Given a commit ID and a path, the solution needs to be able to find the most recent values for the tree's nodes that are not newer than the given commit. This means we need to have some way of determining ordering: is the tree information for commit ID X before or after the info for commit ID Y.

Related

Chat: 5176dfd70594ca715388473b
Chat: 5176dfd80594ca715388473e
Tickets: #4826
Tickets: #4935
Tickets: #5341
Tickets: #5514
Tickets: #5763

Discussion

<< < 1 2 3 > >> (Page 2 of 3)
  • I pushed some small bug fixes to origin/cj/4691, so make sure you pull those.

    Latest test was pushing two new (no history in mongo) repos to the sandbox - Allura (git) and vim (hg).

    The refresh succeeded without error, and the repo browser worked fine, but there are no (or very few) last_commit_docs in mongo. Fixing this may force us to get to the root of the performance issues.

     
<< < 1 2 3 > >> (Page 2 of 3)


Anonymous


Cancel   Add attachments