aboutsummaryrefslogtreecommitdiff
path: root/lib/git/tag.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/tag.py
parent4c39f9da792792d4e73fc3a5effde66576ae128c (diff)
parentf4874ca00b5f6bcba3a62d5776a4b2da899c8846 (diff)
downloadGitPython-13ac6b6aa35f01eb50590998e1e5e9a41d186046.tar.gz
GitPython-13ac6b6aa35f01eb50590998e1e5e9a41d186046.zip
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/tag.py')
-rw-r--r--lib/git/tag.py25
1 files changed, 13 insertions, 12 deletions
diff --git a/lib/git/tag.py b/lib/git/tag.py
index f7bc140e..8413ce73 100644
--- a/lib/git/tag.py
+++ b/lib/git/tag.py
@@ -9,16 +9,13 @@ from commit import Commit
class Tag(object):
def __init__(self, name, commit):
"""
- Instantiate a new Tag
+ Initialize a newly instantiated Tag
``name``
is the name of the head
``commit``
is the Commit that the head points to
-
- Returns
- ``git.Tag``
"""
self.name = name
self.commit = commit
@@ -26,16 +23,19 @@ class Tag(object):
@classmethod
def find_all(cls, repo, **kwargs):
"""
- Find all Tags
+ Find all Tags 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.Tag[]``
+
+ List is sorted by committerdate
"""
options = {'sort': "committerdate",
'format': "%(refname)%00%(objectname)"}
@@ -47,16 +47,16 @@ class Tag(object):
@classmethod
def list_from_string(cls, repo, text):
"""
- Parse out tag information into an array of baked Tag objects
+ Parse out tag information into an array of Tag objects
``repo``
is the Repo
``text``
- is the text output from the git command
+ is the text output from the git-for-each command
Returns
- ``git.Tag[]``
+ git.Tag[]
"""
tags = []
for line in text.splitlines():
@@ -74,13 +74,14 @@ class Tag(object):
``line``
is the formatted tag information
- Format
+ Format::
+
name: [a-zA-Z_/]+
<null byte>
id: [0-9A-Fa-f]{40}
-
+
Returns
- ``git.Tag``
+ git.Tag
"""
full_name, ids = line.split("\x00")
name = full_name.split("/")[-1]