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
add
to add files to staging areacommit
to commit changeslog
to list commits historycheckout
to change source code to this commithelp
to list manual
To initialize a repo:
init
It 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:
log
to 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:
help
status
to list changes and new files from the last commitbranch
support branches and merge them- use
Zlib library
to compress changes - use
VCDIFF
to compute delta and compress it - use any
DBMS
to 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.