From 06fcf2ff1bf04870edc3f5e1b83c372d2ad311ce Mon Sep 17 00:00:00 2001 From: Adam Spiers Date: Sun, 11 Jan 2015 23:01:46 +0000 Subject: improve notification when commitish is full SHA1 e.g. when double-clicking an unexplored node --- git-deps | 5 +++-- html/js/git-deps-graph.coffee | 9 ++++++--- 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 = \ - "#{root.commitish} - resolved as " + root.sha1 + notification = + if root.commitish == root.sha1 + "Analysed dependencies of #{root.abbrev}" + else + "#{root.commitish} + resolved as #{root.sha1}" notification += "

#{new_nodes} new commit" notification += "s" unless new_nodes == 1 notification += "; #{new_deps} new " + -- cgit