aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Spiers <git@adamspiers.org>2015-01-11 23:01:46 +0000
committerAdam Spiers <git@adamspiers.org>2015-01-11 23:05:30 +0000
commit06fcf2ff1bf04870edc3f5e1b83c372d2ad311ce (patch)
treec5dd1785b2f391f7a9367456c5d4d549325b3705
parent6e0c247e7e07b5c6732deedd194985da3e817007 (diff)
downloadgit-deps-06fcf2ff1bf04870edc3f5e1b83c372d2ad311ce.tar.gz
improve notification when commitish is full SHA1
e.g. when double-clicking an unexplored node
-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 " +