logo

shit

Unnamed repository; edit this file 'description' to name the repository.
commit: dc3799706ada630669f3da8edb550e51ea09b683
parent 221772b8f451e4b2db9d7eabf0c86f7691728191
Author: Drew DeVault <sir@cmpwn.com>
Date:   Tue, 11 Feb 2020 18:32:49 -0500

Add usage example to README.md

Diffstat:

MREADME.md47+++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 47 insertions(+), 0 deletions(-)

diff --git a/README.md b/README.md @@ -15,3 +15,50 @@ Caveats: Enough plumbing commands are written to make this write the initial commit with itself, which is how the initial commit was written. Huzzah. + +## How to use + +1. Don't + +Okay, fine. Because only plumbing commands are implemented, you have to live +with a garbage manual process. Do something like this: + +``` +git clone https://git.sr.ht/~sircmpwn/shit +mkdir my-project +cd my-project +../shit/init +# Write some code +``` + +So we'll assume shit is at `../shit`. + +To create a new index from all of your files (note, subdirectories aren't +working yet): + +``` +../shit/update-index * +``` + +Then to create a tree object from these: + +``` +../shit/write-tree | ./hash-object -t tree -w +``` + +This will print the tree ID to stdout. Use that to make a commit: + +``` +export GIT_AUTHOR_NAME="Your Name" +export GIT_AUTHOR_EMAIL="you@example.org" +../shit/commit-tree <tree sha> | ./hash-object -t commit -w +``` + +This will print out the new commit's SHA. To update master to point to this new +commit: + +``` +echo <commit sha> > .git/refs/heads/master +``` + +Tada.