aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-04-28 15:05:41 +0200
committerLudovic Courtès <ludo@gnu.org>2019-04-28 22:57:06 +0200
commit0663302618d6bef25bf09f694a91ab05fe7a9bd7 (patch)
tree913bdb0900f216e6b302f7570292eb289812e348
parente0f3a4feb55851bd878607883498668f8b8fa10d (diff)
downloadguix-0663302618d6bef25bf09f694a91ab05fe7a9bd7.tar
guix-0663302618d6bef25bf09f694a91ab05fe7a9bd7.tar.gz
describe: Provide a hint when origin detection fails.
* guix/scripts/describe.scm (display-checkout-info): Add call to 'display-hint' in the error case.
-rw-r--r--guix/scripts/describe.scm8
1 files changed, 7 insertions, 1 deletions
diff --git a/guix/scripts/describe.scm b/guix/scripts/describe.scm
index b6287d3a4c..fa6b6cae37 100644
--- a/guix/scripts/describe.scm
+++ b/guix/scripts/describe.scm
@@ -18,6 +18,7 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (guix scripts describe)
+ #:use-module ((guix config) #:select (%guix-version))
#:use-module ((guix ui) #:hide (display-profile-content))
#:use-module (guix channels)
#:use-module (guix scripts)
@@ -114,7 +115,12 @@ within a Git checkout."
(lambda ()
(repository-discover (dirname program)))
(lambda (key err)
- (leave (G_ "failed to determine origin~%")))))
+ (report-error (G_ "failed to determine origin~%"))
+ (display-hint (format #f (G_ "Perhaps this
+@command{guix} command was not obtained with @command{guix pull}? Its version
+string is ~a.~%")
+ %guix-version))
+ (exit 1))))
(repository (repository-open directory))
(head (repository-head repository))
(commit (oid->string (reference-target head))))