@@ -27,10 +27,10 @@ From the ``Repo`` object, you can get a list of ``Commit``
27
27
objects.
28
28
29
29
>>> repo.commits()
30
- [<GitPython .Commit "207c0c4418115df0d30820ab1a9acd2ea4bf4431">,
31
- <GitPython .Commit "a91c45eee0b41bf3cdaad3418ca3850664c4a4b4">,
32
- <GitPython .Commit "e17c7e11aed9e94d2159e549a99b966912ce1091">,
33
- <GitPython .Commit "bd795df2d0e07d10e0298670005c0e9d9a5ed867">]
30
+ [<git .Commit "207c0c4418115df0d30820ab1a9acd2ea4bf4431">,
31
+ <git .Commit "a91c45eee0b41bf3cdaad3418ca3850664c4a4b4">,
32
+ <git .Commit "e17c7e11aed9e94d2159e549a99b966912ce1091">,
33
+ <git .Commit "bd795df2d0e07d10e0298670005c0e9d9a5ed867">]
34
34
35
35
Called without arguments, ``Repo.commits`` returns a list of up to ten commits
36
36
reachable by the master branch (starting at the latest commit). You can ask
@@ -61,19 +61,19 @@ Commit objects contain information about a specific commit.
61
61
'207c0c4418115df0d30820ab1a9acd2ea4bf4431'
62
62
63
63
>>> head.parents
64
- [<GitPython .Commit "a91c45eee0b41bf3cdaad3418ca3850664c4a4b4">]
64
+ [<git .Commit "a91c45eee0b41bf3cdaad3418ca3850664c4a4b4">]
65
65
66
66
>>> head.tree
67
- <GitPython .Tree "563413aedbeda425d8d9dcbb744247d0c3e8a0ac">
67
+ <git .Tree "563413aedbeda425d8d9dcbb744247d0c3e8a0ac">
68
68
69
69
>>> head.author
70
- <GitPython .Actor "Michael Trier <mtrier@gmail.com>">
70
+ <git .Actor "Michael Trier <mtrier@gmail.com>">
71
71
72
72
>>> head.authored_date
73
73
(2008, 5, 7, 5, 0, 56, 2, 128, 0)
74
74
75
75
>>> head.committer
76
- <GitPython .Actor "Michael Trier <mtrier@gmail.com>">
76
+ <git .Actor "Michael Trier <mtrier@gmail.com>">
77
77
78
78
>>> head.committed_date
79
79
(2008, 5, 7, 5, 0, 56, 2, 128, 0)
@@ -107,25 +107,25 @@ A tree records pointers to the contents of a directory. Let's say you want
107
107
the root tree of the latest commit on the master branch.
108
108
109
109
>>> tree = repo.commits()[0].tree
110
- <GitPython .Tree "a006b5b1a8115185a228b7514cdcd46fed90dc92">
110
+ <git .Tree "a006b5b1a8115185a228b7514cdcd46fed90dc92">
111
111
112
112
>>> tree.id
113
113
'a006b5b1a8115185a228b7514cdcd46fed90dc92'
114
114
115
115
Once you have a tree, you can get the contents.
116
116
117
117
>>> contents = tree.contents
118
- [<GitPython .Blob "6a91a439ea968bf2f5ce8bb1cd8ddf5bf2cad6c7">,
119
- <GitPython .Blob "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391">,
120
- <GitPython .Tree "eaa0090ec96b054e425603480519e7cf587adfc3">,
121
- <GitPython .Blob "980e72ae16b5378009ba5dfd6772b59fe7ccd2df">]
118
+ [<git .Blob "6a91a439ea968bf2f5ce8bb1cd8ddf5bf2cad6c7">,
119
+ <git .Blob "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391">,
120
+ <git .Tree "eaa0090ec96b054e425603480519e7cf587adfc3">,
121
+ <git .Blob "980e72ae16b5378009ba5dfd6772b59fe7ccd2df">]
122
122
123
123
This tree contains three ``Blob`` objects and one ``Tree`` object. The trees
124
124
are subdirectories and the blobs are files. Trees below the root have
125
125
additional attributes.
126
126
127
127
>>> contents = tree["lib"]
128
- <GitPython .Tree "c1c7214dde86f76bc3e18806ac1f47c38b2b7a3">
128
+ <git .Tree "c1c7214dde86f76bc3e18806ac1f47c38b2b7a3">
129
129
130
130
>>> contents.name
131
131
'test'
@@ -138,23 +138,23 @@ from a tree with a syntax similar to how paths are written in an unix
138
138
system.
139
139
140
140
>>> tree/"lib"
141
- <GitPython .Tree "c1c7214dde86f76bc3e18806ac1f47c38b2b7a30">
141
+ <git .Tree "c1c7214dde86f76bc3e18806ac1f47c38b2b7a30">
142
142
143
143
You can also get a tree directly from the repository if you know its name.
144
144
145
145
>>> repo.tree()
146
- <GitPython .Tree "master">
146
+ <git .Tree "master">
147
147
148
148
>>> repo.tree("c1c7214dde86f76bc3e18806ac1f47c38b2b7a30")
149
- <GitPython .Tree "c1c7214dde86f76bc3e18806ac1f47c38b2b7a30">
149
+ <git .Tree "c1c7214dde86f76bc3e18806ac1f47c38b2b7a30">
150
150
151
151
The Blob object
152
152
***************
153
153
154
154
A blob represents a file. Trees often contain blobs.
155
155
156
156
>>> blob = tree.contents[-1]
157
- <GitPython .Blob "b19574431a073333ea09346eafd64e7b1908ef49">
157
+ <git .Blob "b19574431a073333ea09346eafd64e7b1908ef49">
158
158
159
159
A blob has certain attributes.
160
160
@@ -178,7 +178,7 @@ You can get the data of a blob as a string.
178
178
You can also get a blob directly from the repo if you know its name.
179
179
180
180
>>> repo.blob("b19574431a073333ea09346eafd64e7b1908ef49")
181
- <GitPython .Blob "b19574431a073333ea09346eafd64e7b1908ef49">
181
+ <git .Blob "b19574431a073333ea09346eafd64e7b1908ef49">
182
182
183
183
What Else?
184
184
**********
0 commit comments