aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgit-arr2
-rw-r--r--git.py4
-rw-r--r--sample.conf9
3 files changed, 13 insertions, 2 deletions
diff --git a/git-arr b/git-arr
index 902bb89..95455ec 100755
--- a/git-arr
+++ b/git-arr
@@ -46,6 +46,7 @@ def load_config(path):
"""
defaults = {
'tree': 'yes',
+ 'rootdiff': 'yes',
'desc': '',
'recursive': 'no',
'commits_in_summary': '10',
@@ -108,6 +109,7 @@ def load_config(path):
if r.info.max_pages <= 0:
r.info.max_pages = sys.maxint
r.info.generate_tree = config.getboolean(s, 'tree')
+ r.info.root_diff = config.getboolean(s, 'rootdiff')
r.info.web_url = config.get(s, 'web_url')
web_url_file = fullpath + '/' + config.get(s, 'web_url_file')
diff --git a/git.py b/git.py
index bddca70..9a77c7c 100644
--- a/git.py
+++ b/git.py
@@ -198,8 +198,6 @@ class Repo:
def __init__(self, path, branch = None, name = None, info = None):
self.path = path
self.branch = branch
-
- # We don't need these, but provide them for the users' convenience.
self.name = name
self.info = info or SimpleNamespace()
@@ -303,6 +301,8 @@ class Repo:
cmd.patch = None
cmd.numstat = None
cmd.find_renames = None
+ if (self.info.root_diff):
+ cmd.root = None
# Note we intentionally do not use -z, as the filename is just for
# reference, and it is safer to let git do the escaping.
diff --git a/sample.conf b/sample.conf
index 705a022..f5e950a 100644
--- a/sample.conf
+++ b/sample.conf
@@ -11,6 +11,15 @@ path = /srv/git/repo/
# Useful to disable an expensive operation in very large repositories.
#tree = yes
+# Show a "creation event" diff for a root commit? (optional)
+# For projects placed under revision control from inception, the root commit
+# diff is often meaningful. However, in cases when a well established, large
+# project is placed under revision control belatedly, the root commit may
+# represent a lump import of the entire project, in which case such a
+# "creation event" diff would likely be considered meaningless noise.
+# Default: yes
+#rootdiff = yes
+
# How many commits to show in the summary page (optional).
#commits_in_summary = 10