diff options
author | Adam Spiers <git@adamspiers.org> | 2015-01-11 23:01:46 +0000 |
---|---|---|
committer | Adam Spiers <git@adamspiers.org> | 2015-01-11 23:05:30 +0000 |
commit | 06fcf2ff1bf04870edc3f5e1b83c372d2ad311ce (patch) | |
tree | c5dd1785b2f391f7a9367456c5d4d549325b3705 | |
parent | 6e0c247e7e07b5c6732deedd194985da3e817007 (diff) | |
download | git-deps-06fcf2ff1bf04870edc3f5e1b83c372d2ad311ce.tar.gz |
improve notification when commitish is full SHA1
e.g. when double-clicking an unexplored node
-rwxr-xr-x | git-deps | 5 | ||||
-rw-r--r-- | html/js/git-deps-graph.coffee | 9 |
2 files changed, 9 insertions, 5 deletions
@@ -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 " + |