Skip to content
Browse files

reformatting readme

  • Loading branch information...
1 parent bb58a0d commit ad3e7c0f2a50e53e6487120060a24a1f0175c30f @schacon committed
Showing with 15 additions and 15 deletions.
  1. +15 −15 README.md
View
30 README.md
@@ -15,12 +15,12 @@ Basic API
First you initialize a Git object with the path to a Git repository:
- Git = git:open("test_git")
+ Git = git:open("test_git")
You can get the type, size and data for any object in Git with the
git:object_data call:
- {Type, Size, Data} = git:object_data(Git, "8d47f3435ce5dfd0b2ab5758590c2db21b5294b4")
+ {Type, Size, Data} = git:object_data(Git, "8d47f3435ce5dfd0b2ab5758590c2db21b5294b4")
Type is a term (one of commit, tree, blob, tag), Size is an int of the size of
the object and Data is a binary of the object data.
@@ -28,16 +28,16 @@ the object and Data is a binary of the object data.
You can use object_exists to get a true/false back as to if a given object
exists in the database.
- Result = git:object_exists(Git, "8d47f3435ce5dfd0b2ab5758590c2db21b5294b4")
+ Result = git:object_exists(Git, "8d47f3435ce5dfd0b2ab5758590c2db21b5294b4")
You can get a topographically ordered listing of the commit SHAs reachable
froma given array of commit SHAs with the git:rev_list command
- RevList = git:rev_list(Git, ["25daa907ccb6feb267bfec70a130d5fe13e48a79"])
+ RevList = git:rev_list(Git, ["25daa907ccb6feb267bfec70a130d5fe13e48a79"])
That command will return an array of commit SHA strings:
- RevList: ["25daa907ccb6feb267bfec70a130d5fe13e48a79",
+ RevList: ["25daa907ccb6feb267bfec70a130d5fe13e48a79",
"dd991a4966e8807d448305e67a9b3727efc6060c",
"be62addb149d286893e2ec254e0dc783a871e8af",
"208fc4a6a08fb1e5136cf9943d79ad81097a0f36",
@@ -48,11 +48,11 @@ That command will return an array of commit SHA strings:
You can get formatted data back for tree and commit objects (and blobs, but it
just returns a string of the blob) with the git:object/2 call
- {ok, Commit} = git:object(Git, "25daa907ccb6feb267bfec70a130d5fe13e48a79")
+ {ok, Commit} = git:object(Git, "25daa907ccb6feb267bfec70a130d5fe13e48a79")
That will return a Commit object who's record looks like this:
- -record(commit, {sha, parents, tree,
+ -record(commit, {sha, parents, tree,
author, committer, encoding, message}).
So you can then get the array of parent SHAs with Commit#commit.parents, or
@@ -61,7 +61,7 @@ the commit message with Commit#commit.message.
If you run git:object/2 with a tree SHA, it will give you back an array of
tree entries, each of which is a tree record:
- -record(tree, {mode, name, sha}).
+ -record(tree, {mode, name, sha}).
IO Git API
===================
@@ -69,17 +69,17 @@ IO Git API
There are also a few output functions to help look at the data returned. You
can get the equivalent of the 'git log' output with the git_io:print_log command.
- git_io:print_log(Git, ["25daa907ccb6feb267bfec70a130d5fe13e48a79"])
+ git_io:print_log(Git, ["25daa907ccb6feb267bfec70a130d5fe13e48a79"])
That will print to stdout something like this:
- commit 61fa970afbf82f79611220203213cd9562a809e3
- Author: Scott Chacon <schacon@gmail.com> 1258278496 +0100
+ commit 61fa970afbf82f79611220203213cd9562a809e3
+ Author: Scott Chacon <schacon@gmail.com> 1258278496 +0100
- added test one
+ added test one
- commit a361a3163a1b521f277e3877232d94b787750c36
- Author: Scott Chacon <schacon@gmail.com> 1258278448 +0100
+ commit a361a3163a1b521f277e3877232d94b787750c36
+ Author: Scott Chacon <schacon@gmail.com> 1258278448 +0100
- first commit
+ first commit

0 comments on commit ad3e7c0

Please sign in to comment.
Something went wrong with that request. Please try again.