Thanks for the great tutorial: https://www.leshenko.net/p/ugit
Thanks again Nikita!
I found some good reference material, and I put them under the ./doc directory.
Besides, the follow links maybe help you too.
If you feel interested about this project, you can post your idea on the discussion or just contact me with email.
alias zit='java -jar ../zit-1.0-SNAPSHOT-shaded.jar' alias the zit executable file.
C:\Program Files\Git\etc\profile.d\aliases.shzit init init directory .zit which include objects subdirectory, init index file which would be treated as stage area, and set main branch as default to prevent detached head
ref: ref/heads/mainzit hash-object file
.ugit/objects/{the SHA-1 hash}.zit cat-file hash [object|tree|commit|...type] print the file content
zit write-tree generate the tree which is the whole description of the repository.
add command, it will write tree which is generated by index filezit read-tree hash
cat-file to find which tree is the root, and the logs of write-tree also help you find all the trees. Although write-tree can save version, but it does not take any context information, so will need to develop zit commit -m "message" command.
cat-file hash commit-id to check your commit contentHEAD will record your commit with its parent.Just enjoy commit and the type log to see the logs.
Now we get the first point: checkout. Pick a commit id from the log and checkout whether things as expected.
tag will alias commit id, and at this time, you will get first inner core concept.
todo: zit lg graph feature with Graphviz
zit branch name [id] so familiar.
zit show will use diff show changes detail while status only show simply changes info.
zit add will add paths which could be file or directory into stage file: .zit/index.
zit commit will call write tree and update head pointer to the commit id.
main and will rewrite the HEAD file content to the commit idzit status this command will tell you what is the situation you are in now.
zit diff the default diff algorithm is myers diff without linear space refinement optimized
zit reset just change head to the current commit, the difference between it and checkout is the // todo
zit merge will check if the merge base equals the head, it will use fast-forward to merge
zit merge-base is used to help the merge command find the first common parent commit of the commits which will be merged. But you also can use this command to do debug task.zit fetch, zit push these two combined commands are used to download or upload objects and update the ref.
implemented the diff(myers diff but without linear space optimized) and merge algorithms(simple diff3) instead of using unix tools.
Ugit use some cool Pythonic code while zit trying to make code easy understood for the other language developer.