aboutsummaryrefslogtreecommitdiffstats
path: root/git_deps/gitutils.py
diff options
context:
space:
mode:
authorAdam Spiers <git@adamspiers.org>2016-06-29 19:42:06 +0100
committerAdam Spiers <git@adamspiers.org>2018-05-15 13:42:16 +0100
commit456071c30c291db122fb7d8cfb407a5d16911b5c (patch)
treef7f1a2994455e217f64564671af430960ce1d67e /git_deps/gitutils.py
parent7c462c7184986e16aea1f01726a8cadcf0900168 (diff)
downloadgit-deps-456071c30c291db122fb7d8cfb407a5d16911b5c.tar.gz
extract commit_summary() function into gitutils.py
This helper can be reused elsewhere, e.g. in git-explode.
Diffstat (limited to 'git_deps/gitutils.py')
-rw-r--r--git_deps/gitutils.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/git_deps/gitutils.py b/git_deps/gitutils.py
index ce80ad5..d5981d2 100644
--- a/git_deps/gitutils.py
+++ b/git_deps/gitutils.py
@@ -53,6 +53,10 @@ class GitUtils(object):
return commit.message.split('\n', 1)[0]
@classmethod
+ def commit_summary(cls, commit):
+ return "%s %s" % (commit.hex[:8], cls.oneline(commit))
+
+ @classmethod
def refs_to(cls, sha1, repo):
"""Returns all refs pointing to the given SHA1."""
matching = []