#4691 Fix last commit info

v1.0.0
closed
sf-16 (2)
General
2015-08-20
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

Tickets: #4549
Tickets: #4935
Tickets: #5341
Tickets: #5514

Discussion

<< < 1 2 (Page 2 of 2)
    • status: code-review --> validation
     
  • Dave Brondsema

    Dave Brondsema - 2013-02-08
    • status: validation --> closed
    • size: 8 --> 16
     
<< < 1 2 (Page 2 of 2)

Log in to post a comment.