My own implementation for source code management system (SCM)
the main feature of the system is to record every change when you commit and let you checkout to this commit at any time
addto add files to staging areacommitto commit changeslogto list commits historycheckoutto change source code to this commithelpto list manual
To initialize a repo:
initIt will create a directory called .sstc inside the current folder.
Inside that directory, it will generate the initial repo structure :
.sstc
├── current.txt
├── master
└── 0.txt
└── commits_log.txt
└── depend_on.txt
└── tracked.txt
to add files to staging area:
add <file path> ...compute delta from origional file and current file and store change in the commit file:
commit <message>I have used flowe approach -mentioned in resources-.
to list commits history:
logto change source code to this commit:
checkout <commit_num>it reads the delta from commit then combine it with origional file then write the result in the current file
to list manual:
helpstatusto list changes and new files from the last commitbranchsupport branches and merge them- use
Zlib libraryto compress changes - use
VCDIFFto compute delta and compress it - use any
DBMSto store information about commits and branches
take your time in learning the theory and the best design you need ,this resources help me alot The Eric Sink's Weblog is A good place to learn about version control , specially:
- Time and Space Tradeoffs in Version Control Storage
- his series of articles Source Control HOWTO specially his article on Repositories
Two answers on stackoverflow :
- Writing my own file versioning program
- What are the core concepts of the Clearcase version control system every developer should know
You can contribute by reviewing and sending feedback on code , suggesting a new features ,implement Future work described above, as well as submit code fixes or code contributions of your own.