guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/12: describe: Provide a hint when origin detection fails.


From: guix-commits
Subject: 01/12: describe: Provide a hint when origin detection fails.
Date: Sun, 28 Apr 2019 16:57:15 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 0663302618d6bef25bf09f694a91ab05fe7a9bd7
Author: Ludovic Court├Ęs <address@hidden>
Date:   Sun Apr 28 15:05:41 2019 +0200

    describe: Provide a hint when origin detection fails.
    
    * guix/scripts/describe.scm (display-checkout-info): Add call to
    'display-hint' in the error case.
---
 guix/scripts/describe.scm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/guix/scripts/describe.scm b/guix/scripts/describe.scm
index b6287d3..fa6b6ca 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
address@hidden 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))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]