summaryrefslogtreecommitdiff
path: root/lib/git/head.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2009-10-20 17:32:52 +0200
committerSebastian Thiel <byronimo@gmail.com>2009-10-20 17:32:52 +0200
commit13ac6b6aa35f01eb50590998e1e5e9a41d186046 (patch)
tree34119f1d188fbbba640e10105c60e62717484ec7 /lib/git/head.py
parent4c39f9da792792d4e73fc3a5effde66576ae128c (diff)
parentf4874ca00b5f6bcba3a62d5776a4b2da899c8846 (diff)
downloadgitpython-13ac6b6aa35f01eb50590998e1e5e9a41d186046.tar.gz
Merge commit 'origin/improvements_for_mainline' into integration
* commit 'origin/improvements_for_mainline': Moved compatibility information of possible future release into right spot ( to the top of the release list ) repo_tests: fixed duplicate test-method name which would redefine the previous one which never ran Fixed Diff class which used Commits instead of Blobs - as Blobs contain the path ( in the 'name' member variable ), the a|b_path members of Diff have been removed. Tests were adjusted and run git.git.Git.__init__ takes None as default argument as the execute method handles this correctly Fixed git.blob.Blob.blame function which would return the text-per-commit as individual characters improved repo documentation Improved head and tag object documentation slightly Added docs for the error module Added missing information to docstrings of commit and stats module improved git.cmd documentation Improved documentation on Actor and Blob
Diffstat (limited to 'lib/git/head.py')
-rw-r--r--lib/git/head.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/lib/git/head.py b/lib/git/head.py
index 86686f17..639cee40 100644
--- a/lib/git/head.py
+++ b/lib/git/head.py
@@ -28,16 +28,13 @@ class Head(object):
def __init__(self, name, commit):
"""
- Instantiate a new Head
+ Initialize a newly instanced Head
`name`
is the name of the head
`commit`
- is the Commit that the head points to
-
- Returns
- git.Head
+ is the Commit object that the head points to
"""
self.name = name
self.commit = commit
@@ -45,16 +42,19 @@ class Head(object):
@classmethod
def find_all(cls, repo, **kwargs):
"""
- Find all Heads
+ Find all Heads in the repository
`repo`
is the Repo
`kwargs`
- is a dict of options
+ Additional options given as keyword arguments, will be passed
+ to git-for-each-ref
Returns
git.Head[]
+
+ List is sorted by committerdate
"""
options = {'sort': "committerdate",
@@ -67,12 +67,12 @@ class Head(object):
@classmethod
def list_from_string(cls, repo, text):
"""
- Parse out head information into an array of baked head objects
+ Parse out head information into a list of head objects
``repo``
is the Repo
``text``
- is the text output from the git command
+ is the text output from the git-for-each-ref command
Returns
git.Head[]
@@ -95,7 +95,8 @@ class Head(object):
``line``
is the formatted head information
- Format
+ Format::
+
name: [a-zA-Z_/]+
<null byte>
id: [0-9A-Fa-f]{40}