aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xgit-deps5
-rw-r--r--html/js/git-deps-graph.coffee9
2 files changed, 9 insertions, 5 deletions
diff --git a/git-deps b/git-deps
index c850a9d..410a475 100755
--- a/git-deps
+++ b/git-deps
@@ -735,7 +735,7 @@ def serve(options):
detector.add_listener(listener)
try:
- sha1 = detector.get_commit(commitish)
+ root_commit = detector.get_commit(commitish)
except InvalidCommitish as e:
return json_error(
422, 'Invalid commitish',
@@ -746,7 +746,8 @@ def serve(options):
json = listener.json()
json['root'] = {
'commitish': commitish,
- 'sha1': sha1.hex,
+ 'sha1': root_commit.hex,
+ 'abbrev': GitUtils.abbreviate_sha1(root_commit.hex),
}
return jsonify(json)
diff --git a/html/js/git-deps-graph.coffee b/html/js/git-deps-graph.coffee
index f6edeb8..65e41e1 100644
--- a/html/js/git-deps-graph.coffee
+++ b/html/js/git-deps-graph.coffee
@@ -222,9 +222,12 @@ new_data_notification = (new_data) ->
new_nodes = new_data[0]
new_deps = new_data[1]
root = new_data[2]
- notification = \
- "<span class=\"commit-ref\">#{root.commitish}</span>
- resolved as " + root.sha1
+ notification =
+ if root.commitish == root.sha1
+ "Analysed dependencies of #{root.abbrev}"
+ else
+ "<span class=\"commit-ref\">#{root.commitish}</span>
+ resolved as #{root.sha1}"
notification += "<p>#{new_nodes} new commit"
notification += "s" unless new_nodes == 1
notification += "; #{new_deps} new " +