From d7e59d3ef86beb3b3b3e53a610af122b2220841b Mon Sep 17 00:00:00 2001 From: Michael Trier Date: Sun, 18 May 2008 16:56:55 -0400 Subject: added in note about how to handle date time information. Fixed up repo tests for the removal of the shared option. --- README | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'README') diff --git a/README b/README index d9c6f1df..fd5597c6 100644 --- a/README +++ b/README @@ -120,8 +120,20 @@ Commit objects contain information about a specific commit. (2008, 5, 7, 5, 0, 56, 2, 128, 0) >>> head.message - 'cleaned up a lot of test information. Fixed escaping so it works with subprocess.' + 'cleaned up a lot of test information. Fixed escaping so it works with + subprocess.' +Note: date time is represented in a `struct_time`_ format. Conversion to +human readable form can be accomplished with the various time module methods. + + >>> import time + >>> time.asctime(head.committed_date) + 'Wed May 7 05:56:02 2008' + + >>> time.strftime("%a, %d %b %Y %H:%M", head.committed_date) + 'Wed, 7 May 2008 05:56' + +.. _struct_time: http://docs.python.org/lib/module-time.html You can traverse a commit's ancestry by chaining calls to ``parents``. @@ -149,9 +161,9 @@ Once you have a tree, you can get the contents. , ] -This tree contains three ``Blob`` objects and one ``Tree`` object. The trees are -subdirectories and the blobs are files. Trees below the root have additional -attributes. +This tree contains three ``Blob`` objects and one ``Tree`` object. The trees +are subdirectories and the blobs are files. Trees below the root have +additional attributes. >>> contents = tree.contents[-2] @@ -211,7 +223,11 @@ You can also get a blob directly from the repo if you know its name. What Else? ********** -There is more stuff in there, like the ability to tar or gzip repos, stats, blame, and probably a few other things. Additionally calls to the git instance are handled through a ``method_missing`` construct, which makes available any git commands directly, with a nice conversion of Python dicts to command line parameters. +There is more stuff in there, like the ability to tar or gzip repos, stats, +log, blame, and probably a few other things. Additionally calls to the git +instance are handled through a ``method_missing`` construct, which makes +available any git commands directly, with a nice conversion of Python dicts +to command line parameters. Check the unit tests, they're pretty exhaustive. -- cgit v1.2.3