Skip to content

Chenyitong33/CS61bl_project2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

DESIGN DOCUMENT Classes:

  1. Gitlet
  2. CommitTree (private, nested inside Gitlet)
  3. Commit (private, nested inside Gitlet)
  4. Branch (private, nested inside Gitlet) Gitlet -Instance variables:
  5. CommitTree myCommitTree
  6. HashSet untracking
  7. HashSet staged
  8. Int currentID
  9. Boolean conflicted -Methods (feel the need to clean this up):
  10. clearFiles – clear files from untracking and staged after a commit
  11. initCommand – makes the .gitlet folder with the staging_area folder inside
  12. addCommand – adds to staging area or unmarks from untracking
  13. rmCommand – removes from staging or adds to the “untracking” list
  14. logCommand – calls the reportInfo method of the headCommit, which invokes the -reportInfo command recursively on its parentCommit
  15. findCommand – prints the ID of all commits sharing the specified message
  16. statusCommand – iterate through myCommitTree.branches, staged, and untracking instance variables
  17. checkoutCommand – uses the myCommitTree headCommit version of the file to overwrite the file in the current directory. OR uses the commit with the given commit id to find the version of the file used to overwrite. OR uses the commit at the head of the given branch to overwrite the files.
  18. branchCommand – makes a new branch in branches; points at the same commit that the current branch is pointing to.
  19. rmbranchCommand – remove a branch from the branches list
  20. mergeCommand – very complicated. Need to know how to recognize a split point.Requires checking the contents of the files at the current branch and the given branch to see if they are different. If the current branch has not been modified but the given branch has, then use the given branch’s files. If the other way, leave the current branch’s files as they are. If they are both modified, then make .conflicted files.
  21. rebaseCommand – requires being able to find a split point. Replay a branch, making copies of the commits in the current branch and “sticking” them onto the given branch. Propagate changes as well. -Other
  22. No argument constructor: instantiates myCommitTree CommitTree CommitTree - likely to remove and move all the instance variables to gitlet -Instance variables:
  23. Commit headCommit
  24. HashSet branches
  25. HashSet history -Methods
  26. addCommit -Other
  27. No argument constructor: instantiates headCommit, branches, and history Commit -Instance variables:
  28. int id
  29. String message
  30. String time
  31. Commit parent
  32. HashSet tracking -Methods
  33. reportInfo – reports all its relevant info for the sake of log and globallog
  34. hashCode – for quicker access in history, for the sake of find Branch - likely to remove altogether -instance variables:
  35. String myName
  36. Commit myCommit -Methods:
  37. changeCommit – changes myCommit to the commit in the argument

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages