Subject: [PATCH v2] scripts: describe: Add branch information to json output.

From: jgart <[email-masked]>
Date: Sun, 13 Nov 2022 15:35:49 -0600

* guix/scripts/describe.scm (channel->json): Add branch information.

This patch adds branch information to the json output.

Here's an example of the output:

$ guix-shell  ./pre-inst-env guix describe -f json | jq
{
  "name": "guix",
  "url": "/home/jgart/dc2e8ad5-c818-41a4-ac33-198f11f868b2-guix/",
  "branch": "master",
  "commit": "a720eacc803d6e078ea07613ba5ab5ef59adcbb5",
  "introduction": {
    "commit": "9edb3f66fd807b096b48283debdcddccfea34bad",
    "signer": "BBB0 2DDF 2CEA F6A8 0D1D  E643 A2A0 6DF2 A33A 54FA"
  }
}

v2 just adds my copyright statement at the top of the file.

all best,

jgart
---
 guix/scripts/describe.scm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/guix/scripts/describe.scm b/guix/scripts/describe.scm
index 0c310e3da8..e2233c78a5 100644
--- a/guix/scripts/describe.scm
+++ b/guix/scripts/describe.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2018 Oleg Pykhalov <[email-masked]>
 ;;; Copyright © 2020 Ekaitz Zarraga <[email-masked]>
 ;;; Copyright © 2021 Simon Tournier <[email-masked]>
+;;; Copyright © 2022 jgart <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -119,6 +120,7 @@ (define (channel->json channel)
    (let ((intro (channel-introduction channel)))
      `((name . ,(channel-name channel))
        (url . ,(channel-url channel))
+       (branch . ,(channel-branch channel))
        (commit . ,(channel-commit channel))
        ,@(if intro
              `((introduction
-- 
2.38.1