all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#49581] [PATCH] Add git-issues
@ 2021-07-15 17:01 phodina via Guix-patches via
  2021-07-17  9:39 ` Giovanni Biscuolo
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: phodina via Guix-patches via @ 2021-07-15 17:01 UTC (permalink / raw)
  To: 49581

From dbfbc69932b29dd5b3a6bed2de3f67d89bc50bfa Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Thu, 15 Jul 2021 18:58:40 +0200
Subject: [PATCH] gnu: Add git-issues


diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 7c1dbe8b26..47768fdc05 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -1267,6 +1267,31 @@ subcommands helps automate some parts of the flow to make working with it a
 lot easier.")
     (license license:bsd-2)))

+(define-public git-issues
+(package
+  (name "git-issues")
+  (version "67aacad35888b4c51e2d7be35c86fef137874f12")
+  (source (origin
+            (method git-fetch)
+            (uri
+	      (git-reference
+		(url "https://github.com/dspinellis/git-issue")
+		(commit version)))
+            (sha256
+             (base32
+              "1z6dpwbikmiq5acpbji4kvmxqc2jw995rfk5703k5mvp5ps9a29q"))))
+  (build-system gnu-build-system)
+  (arguments
+    '(#:tests? #f
+      #:make-flags (list (string-append "PREFIX="(assoc-ref %outputs "out")))
+      #:phases (modify-phases %standard-phases
+		(delete 'configure)
+		(delete 'build))))
+  (synopsis "Git-based decentralized issue management")
+  (description "This is a minimalist decentralized issue management system based on Git, offering (optional) biderectional integration with GitHub and GitLab issue management. It has the following advantages over other systems.")
+  (home-page "https://github.com/dspinellis/git-issue")
+  (license license:gpl2)))
+
 (define-public stgit
   (package
     (name "stgit")
--
2.31.1




^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [bug#49581] [PATCH] Add git-issues
  2021-07-15 17:01 [bug#49581] [PATCH] Add git-issues phodina via Guix-patches via
@ 2021-07-17  9:39 ` Giovanni Biscuolo
  2021-07-17 10:23 ` Tobias Geerinckx-Rice via Guix-patches via
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Giovanni Biscuolo @ 2021-07-17  9:39 UTC (permalink / raw)
  To: phodina, 49581

[-- Attachment #1: Type: text/plain, Size: 844 bytes --]

Hello phodina,

thank you for your patch!

phodina via Guix-patches via <guix-patches@gnu.org> writes:

[...]

> +(define-public git-issues
> +(package
> +  (name "git-issues")
> +  (version "67aacad35888b4c51e2d7be35c86fef137874f12")

Upstream does not publish releases (does not tag branches): could you
please just add a comment, it could be useful to other Guix developers,
also to remember to check if things will change in the future.

[...]

> +  (license license:gpl2)))

The source code of the main script [1] states the license is gpl3+:
«version 3 of the License, or (at your option) any later version.»

Can you please submit an updated version of your patch?

Thanks! Gio'


[1] https://github.com/dspinellis/git-issue/blob/master/git-issue.sh

-- 
Giovanni Biscuolo

Xelera IT Infrastructures

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 849 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [bug#49581] [PATCH] Add git-issues
  2021-07-15 17:01 [bug#49581] [PATCH] Add git-issues phodina via Guix-patches via
  2021-07-17  9:39 ` Giovanni Biscuolo
@ 2021-07-17 10:23 ` Tobias Geerinckx-Rice via Guix-patches via
  2021-07-17 12:25   ` phodina via Guix-patches via
  2021-09-18  8:31 ` [bug#49581] [PATCH v3] gnu: " phodina via Guix-patches via
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Tobias Geerinckx-Rice via Guix-patches via @ 2021-07-17 10:23 UTC (permalink / raw)
  To: phodina; +Cc: 49581

Hi Petr,

In addition to what Gio' wrote:

On 2021-07-15 19:01, phodina via Guix-patches via wrote:
> +  (description "This is a minimalist decentralized issue management
> system based on Git, offering (optional) biderectional integration

'optional bidirectional'.

> with GitHub and GitLab issue management. It has the following
> advantages over other systems.")

If what came next wasn't too promotional, you can write 'features' 
instead, and use @enumerate to list [a subset of] them.  Otherwise the 
description's rather short.

Kind regards,

T G-R

Sent from a Web browser. Excuse or enjoy my brevity.




^ permalink raw reply	[flat|nested] 10+ messages in thread

* [bug#49581] [PATCH] Add git-issues
  2021-07-17 10:23 ` Tobias Geerinckx-Rice via Guix-patches via
@ 2021-07-17 12:25   ` phodina via Guix-patches via
  0 siblings, 0 replies; 10+ messages in thread
From: phodina via Guix-patches via @ 2021-07-17 12:25 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: 49581

Hi Tobias & Giovanni,

thanks for the suggestions. Here's the fixed patch

Kind regards
Petr

---
index 7c1dbe8b26..91af0badcb 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -1267,6 +1267,40 @@ subcommands helps automate some parts of the flow to make working with it a
 lot easier.")
     (license license:bsd-2)))

+(define-public git-issues
+(package
+  (name "git-issues")
+  (version "67aacad35888b4c51e2d7be35c86fef137874f12") ; no tags
+  (source (origin
+            (method git-fetch)
+            (uri (git-reference
+                  (url "https://github.com/dspinellis/git-issue")
+                  (commit version)))
+            (sha256
+             (base32
+              "1z6dpwbikmiq5acpbji4kvmxqc2jw995rfk5703k5mvp5ps9a29q"))))
+  (build-system gnu-build-system)
+  (arguments
+    '(#:tests? #f
+      #:make-flags (list (string-append "PREFIX="(assoc-ref %outputs "out")))
+      #:phases (modify-phases %standard-phases
+      (delete 'configure)
+      (delete 'build))))
+  (synopsis "Git-based decentralized issue management")
+  (description "This is a minimalist decentralized issue management system
+based on Git, offering (optional) biderectional integration with GitHub
+and GitLab issue management.
+It has the following advantages over other systems:
+@enumerate
+@item No backend, no dependencies
+@item Decentralized asynchronous management
+@item Transparent text file format
+@item Git-based
+@end enumerate
+")
+  (home-page "https://github.com/dspinellis/git-issue")
+  (license license:gpl3)))
+
 (define-public stgit
   (package
     (name "stgit")
--
2.31.1




^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [bug#49581] [PATCH v3] gnu: Add git-issues.
  2021-07-15 17:01 [bug#49581] [PATCH] Add git-issues phodina via Guix-patches via
  2021-07-17  9:39 ` Giovanni Biscuolo
  2021-07-17 10:23 ` Tobias Geerinckx-Rice via Guix-patches via
@ 2021-09-18  8:31 ` phodina via Guix-patches via
  2021-09-22 22:14   ` Sarah Morgensen
  2021-11-01 20:21 ` [bug#49581] [PATCH v4] " phodina via Guix-patches via
  2023-05-29 14:35 ` [bug#49581] [PATCH v5] gnu: Add git-issue jlicht
  4 siblings, 1 reply; 10+ messages in thread
From: phodina via Guix-patches via @ 2021-09-18  8:31 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: 49581

* gnu/packages/version-control.scm (git-issues): New variable.

diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 7c1dbe8b26..cff1190094 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -39,6 +39,7 @@
 ;;; Copyright © 2021 LibreMiami <packaging-guix@libremiami.org>
 ;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
 ;;; Copyright © 2021 François J. <francois-oss@avalenn.eu>
+;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1267,6 +1268,36 @@ subcommands helps automate some parts of the flow to make working with it a
 lot easier.")
     (license license:bsd-2)))

+(define-public git-issues
+  (let ((commit "67aacad35888b4c51e2d7be35c86fef137874f12")
+        (revision "1"))
+    (package
+      (name "git-issues")
+      (version commit)
+      (source (origin
+                (method git-fetch)
+                (uri
+                 (git-reference
+                  (url "https://github.com/dspinellis/git-issue")
+                  (commit version)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "1z6dpwbikmiq5acpbji4kvmxqc2jw995rfk5703k5mvp5ps9a29q"))))
+      (build-system gnu-build-system)
+      (arguments
+       '(#:tests? #f
+         #:make-flags (list (string-append "PREFIX="(assoc-ref %outputs "out")))
+         #:phases (modify-phases %standard-phases
+                    (delete 'configure)
+                    (delete 'build))))
+      (synopsis "Git-based decentralized issue management")
+      (description "Git-issues provide a minimalist decentralized issue
+management system based on Git, offering (optional) bidirectional integration
+with GitHub and GitLab issue management.")
+      (home-page "https://github.com/dspinellis/git-issue")
+      (license license:gpl3+))))
+
 (define-public stgit
   (package
     (name "stgit")
--
2.32.0




^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [bug#49581] [PATCH v3] gnu: Add git-issues.
  2021-09-18  8:31 ` [bug#49581] [PATCH v3] gnu: " phodina via Guix-patches via
@ 2021-09-22 22:14   ` Sarah Morgensen
  2021-09-23  7:15     ` Sarah Morgensen
  0 siblings, 1 reply; 10+ messages in thread
From: Sarah Morgensen @ 2021-09-22 22:14 UTC (permalink / raw)
  To: phodina; +Cc: Tobias Geerinckx-Rice, 49581

Hello Petr,

Thanks for your updated patch.  This looks like a great tool.  After
making the changes below, I gave it a try, and I might use it myself
when I can't use fossil!

I was unable to apply your patch with `git am'; I had to guess which
commit it was based on and manually apply it.  In the future, please
configure your git to include the base commit with

  git config --local format.useautobase whenAble

or use the `--base' command line option:

  git format-patch --base=a916d50566

phodina <phodina@protonmail.com> writes:

> * gnu/packages/version-control.scm (git-issues): New variable.
>
> diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
> index 7c1dbe8b26..cff1190094 100644
> --- a/gnu/packages/version-control.scm
> +++ b/gnu/packages/version-control.scm
> @@ -39,6 +39,7 @@
>  ;;; Copyright © 2021 LibreMiami <packaging-guix@libremiami.org>
>  ;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
>  ;;; Copyright © 2021 François J. <francois-oss@avalenn.eu>
> +;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -1267,6 +1268,36 @@ subcommands helps automate some parts of the flow to make working with it a
>  lot easier.")
>      (license license:bsd-2)))
>
> +(define-public git-issues

The name should be "git-issue" since that's the name of the project and
the command.

> +  (let ((commit "67aacad35888b4c51e2d7be35c86fef137874f12")
> +        (revision "1"))
> +    (package
> +      (name "git-issues")
> +      (version commit)
> +      (source (origin
> +                (method git-fetch)
> +                (uri
> +                 (git-reference
> +                  (url "https://github.com/dspinellis/git-issue")
> +                  (commit version)))
> +                (file-name (git-file-name name version))
> +                (sha256
> +                 (base32
> +                  "1z6dpwbikmiq5acpbji4kvmxqc2jw995rfk5703k5mvp5ps9a29q"))))
> +      (build-system gnu-build-system)
> +      (arguments
> +       '(#:tests? #f

Please add a comment explaining why tests are disabled.  For example, I
attempted to run the tests and found that they must be run in a git
repository, and that a global user.name and user.email must be
configured.

> +         #:make-flags (list (string-append "PREFIX="(assoc-ref %outputs "out")))

Please add a space after "PREFIX=" and wrap the line.

> +         #:phases (modify-phases %standard-phases
> +                    (delete 'configure)
> +                    (delete 'build))))
> +      (synopsis "Git-based decentralized issue management")
> +      (description "Git-issues provide a minimalist decentralized issue
> +management system based on Git, offering (optional) bidirectional integration
> +with GitHub and GitLab issue management.")

This is a bit short.  How about:

--8<---------------cut here---------------start------------->8---
      (description "@command{git-issue} provides a minimalist decentralized
issue management system based on Git, offering (optional) bidirectional
integration with GitHub and GitLab issue management.  Issues are stored as
simple text files, so no special tools are required to access your data, and
issues are changed and shared through Git, so no special infrastructure is
necessary to manage your data.")
--8<---------------cut here---------------end--------------->8---


> +      (home-page "https://github.com/dspinellis/git-issue")
> +      (license license:gpl3+))))
> +
>  (define-public stgit
>    (package
>      (name "stgit")
> --
> 2.32.0

Additionally, it looks like git-issue depends on several tools: cat,
curl, grep, git, find, jq, and sed, at least.  These should probably be
included in inputs and substituted in the script, perhaps with:

--8<---------------cut here---------------start------------->8---
(add-before 'install 'patch-paths
  (lambda* (#:key inputs #:allow-other-keys)
    (define (input-file input file)
      (string-append (assoc-ref inputs input) "/" file))

    (substitute* '("git-issue.sh"
                   "lib/git-issue/import-export.sh"
                   "scripts/replacerefs.sh")
      (("\\bcat\\b") (input-file "coreutils" "bin/cat"))
      (("\\bcurl\\b") (input-file "curl" "bin/curl"))
      (("\\bdate\\b") (input-file "coreutils" "bin/date"))
      (("\\bgit\\b") (input-file "git-minimal" "bin/git"))
      (("\\bgrep\\b") (input-file "grep" "bin/grep"))
      (("\\bfind\\b") (input-file "findutils" "bin/find"))
      (("\\bjq\\b") (input-file "jq" "bin/jq"))
      (("\\bsed\\b") (input-file "sed" "bin/sed"))
      ;; Substitute back any usage examples.
      (("((usage|Example): )/gnu/store/[^/]+/bin/(\\w+)"
        all start exec)
       (string-append start exec)))))
--8<---------------cut here---------------end--------------->8---

I may have missed a few utilities, though.

Thank you!

--
Sarah




^ permalink raw reply	[flat|nested] 10+ messages in thread

* [bug#49581] [PATCH v3] gnu: Add git-issues.
  2021-09-22 22:14   ` Sarah Morgensen
@ 2021-09-23  7:15     ` Sarah Morgensen
  0 siblings, 0 replies; 10+ messages in thread
From: Sarah Morgensen @ 2021-09-23  7:15 UTC (permalink / raw)
  To: phodina; +Cc: Tobias Geerinckx-Rice, 49581

Hi again,

Sarah Morgensen <iskarian@mgsn.dev> writes:

> Additionally, it looks like git-issue depends on several tools: cat,
> curl, grep, git, find, jq, and sed, at least.  These should probably be
> included in inputs and substituted in the script, perhaps with:
>
> (add-before 'install 'patch-paths
>   (lambda* (#:key inputs #:allow-other-keys)
>     (define (input-file input file)
>       (string-append (assoc-ref inputs input) "/" file))
>
>     (substitute* '("git-issue.sh"
>                    "lib/git-issue/import-export.sh"
>                    "scripts/replacerefs.sh")
>       (("\\bcat\\b") (input-file "coreutils" "bin/cat"))
>       (("\\bcurl\\b") (input-file "curl" "bin/curl"))
>       (("\\bdate\\b") (input-file "coreutils" "bin/date"))
>       (("\\bgit\\b") (input-file "git-minimal" "bin/git"))
>       (("\\bgrep\\b") (input-file "grep" "bin/grep"))
>       (("\\bfind\\b") (input-file "findutils" "bin/find"))
>       (("\\bjq\\b") (input-file "jq" "bin/jq"))
>       (("\\bsed\\b") (input-file "sed" "bin/sed"))
>       ;; Substitute back any usage examples.
>       (("((usage|Example): )/gnu/store/[^/]+/bin/(\\w+)"
>         all start exec)
>        (string-append start exec)))))
>
> I may have missed a few utilities, though.

I belatedly realized you could also use 'wrap-program', which is
probably less error-prone.  For example (untested, and not very pretty):

--8<---------------cut here---------------start------------->8---
(let ((out (assoc-ref outputs "out"))
      (paths (map
              (lambda (input)
                (string-append (assoc-ref inputs input) "/bin"))
              '("coreutils" "curl" "findutils"
                "git-minimal" "grep" "jq" "sed")))
  (for-each
    (lambda (program)
      (wrap-program
       (string-append out "/" program)
       `("PATH" prefix ,paths)))
    '("bin/git-issue" "lib/git-issue/import-export.sh"))))
--8<---------------cut here---------------end--------------->8---

Thinking about it, I'm not sure if the bash autocompletion script
("etc/bash_completion.d/git-issue") should be wrapped as well.

Hope that helps,
--
Sarah




^ permalink raw reply	[flat|nested] 10+ messages in thread

* [bug#49581] [PATCH v4] gnu: Add git-issues.
  2021-07-15 17:01 [bug#49581] [PATCH] Add git-issues phodina via Guix-patches via
                   ` (2 preceding siblings ...)
  2021-09-18  8:31 ` [bug#49581] [PATCH v3] gnu: " phodina via Guix-patches via
@ 2021-11-01 20:21 ` phodina via Guix-patches via
  2022-11-22 17:38   ` Giovanni Biscuolo
  2023-05-29 14:35 ` [bug#49581] [PATCH v5] gnu: Add git-issue jlicht
  4 siblings, 1 reply; 10+ messages in thread
From: phodina via Guix-patches via @ 2021-11-01 20:21 UTC (permalink / raw)
  To: Sarah Morgensen; +Cc: Tobias Geerinckx-Rice, 49581

Hi,

Thanks Sarah for the feedback and tips on how to wrap the programs in the shell script.

In fact the patch is almost done, but I couldn't figure out the correct procedure for the map on line 1324. I get that the list of strings should be mapped into paths to the binaries, but after struggling I gave up and found book about Scheme to learn first.

So here is the patch with the minor issue.

Hope this utility helps.

--8<---------------cut here---------------start------------->8---

Subject: [PATCH v4] gnu: Add git-issue.

* gnu/packages/version-control.scm (git-issue): New variable.

diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 064212db9f..c685f2f4b5 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -41,6 +41,7 @@
 ;;; Copyright © 2021 François J. <francois-oss@avalenn.eu>
 ;;; Copyright © 2021 Julien Lepiller <julien@lepiller.eu>
 ;;; Copyright © 2021 jgart <jgart@dismail.de>
+;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -96,6 +97,7 @@ (define-module (gnu packages version-control)
   #:use-module (gnu packages groff)
   #:use-module (gnu packages guile)
   #:use-module (gnu packages guile-xyz)
+  #:use-module (gnu packages haskell-apps)
   #:use-module (gnu packages image)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages mail)
@@ -1277,6 +1279,75 @@ (define-public git-flow
 lot easier.")
     (license license:bsd-2)))

+(define-public git-issue
+  (let ((commit "67aacad35888b4c51e2d7be35c86fef137874f12")
+        (revision "1"))
+    (package
+      (name "git-issue")
+      (version (git-version "0.0" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri
+                 (git-reference
+                  (url "https://github.com/dspinellis/git-issue")
+                  (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "1z6dpwbikmiq5acpbji4kvmxqc2jw995rfk5703k5mvp5ps9a29q"))))
+      (build-system gnu-build-system)
+      (arguments
+       '(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
+         #:phases
+         (modify-phases %standard-phases
+           (delete 'configure)
+           (delete 'build)
+           (add-before 'check 'setup-env
+             (lambda _
+               (setenv "HOME" (getenv "TMPDIR"))
+               (invoke "git" "config" "--global" "user.email" "test")
+               (invoke "git" "config" "--global" "user.name" "Test")
+               (substitute* "test.sh"
+                 (("! git diff") "git diff")
+                 (("#!/bin/sh") (string-append "#!" (which "bash")))
+                 (("gi=.*") (string-append "gi=" (getcwd) "/git-issue.sh\n")))
+               (substitute* "Makefile"
+                 (("shellcheck -x") "shellcheck --exclude=SC2001,SC3043,SC3003 -x"))))
+           (replace 'check
+             (lambda* (#:key tests? #:allow-other-keys)
+               (when tests?
+                 (invoke "make" "test"))))
+           (add-before 'install 'patch-paths
+             (lambda* (#:key build-inputs #:allow-other-keys)
+               (let ((out (assoc-ref %outputs "out"))
+                     (paths (map
+                             (lambda (input)
+                               (string-append (assoc-ref build-inputs input) "/bin"))
+                             '("coreutils" "curl" "findutils"
+                               "git-minimal" "grep" "jq" "sed"))))
+                 (for-each
+                  (lambda (program)
+                    (wrap-program
+                        (string-append out "/" program)
+                      `("PATH" prefix ,paths)))
+                  '("bin/git-issue" "lib/git-issue/import-export.sh"))))))))
+      (native-inputs `(("shellcheck" ,shellcheck)))
+      (inputs `(("bash-minimal" ,bash-minimal)
+                ("git" ,git)
+                ("coreutils" ,coreutils)
+                ("grep" ,grep)
+                ("curl" ,curl)
+                ("findutils" ,findutils)
+                ("sed" ,sed)
+                ("util-linux" ,util-linux)
+                ("jq" ,jq)))
+      (synopsis "Git-based decentralized issue management")
+      (description "Git-issue provide a minimalist decentralized issue
+management system based on Git, offering (optional) bidirectional
+integration with GitHub and GitLab issue management.")
+      (home-page "https://github.com/dspinellis/git-issue")
+      (license license:gpl3+))))
+
 (define-public stgit
   (package
     (name "stgit")
--
2.33.1






^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [bug#49581] [PATCH v4] gnu: Add git-issues.
  2021-11-01 20:21 ` [bug#49581] [PATCH v4] " phodina via Guix-patches via
@ 2022-11-22 17:38   ` Giovanni Biscuolo
  0 siblings, 0 replies; 10+ messages in thread
From: Giovanni Biscuolo @ 2022-11-22 17:38 UTC (permalink / raw)
  To: phodina, Sarah Morgensen; +Cc: Tobias Geerinckx-Rice, 49581

[-- Attachment #1: Type: text/plain, Size: 275 bytes --]

Hello phodina and Sarah,

please do you have some updates on this patch?

I can help testing if needed, tomorrow I'm going to test the v4 (the
last one) of your patch and will provide some feedback

Thanks! Gio'

-- 
Giovanni Biscuolo

Xelera IT Infrastructures

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 849 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [bug#49581] [PATCH v5] gnu: Add git-issue.
  2021-07-15 17:01 [bug#49581] [PATCH] Add git-issues phodina via Guix-patches via
                   ` (3 preceding siblings ...)
  2021-11-01 20:21 ` [bug#49581] [PATCH v4] " phodina via Guix-patches via
@ 2023-05-29 14:35 ` jlicht
  4 siblings, 0 replies; 10+ messages in thread
From: jlicht @ 2023-05-29 14:35 UTC (permalink / raw)
  To: 49581; +Cc: Jelle Licht, phodina

From: phodina <phodina@protonmail.com>

* gnu/packages/version-control.scm (git-issue): New variable.

Co-authored-by: Jelle Licht <jlicht@fsfe.org>

---

Changes in v5:
- Update to latest commit of upstream
- Use gexp-style inputs
- Pass custom #:test-target instead of replacing check phase
- Use search-input-file where possible
- Autoload shellcheck to prevent module import cycle
- Use user-installed git, instead of hardcoding reference

 gnu/packages/version-control.scm | 68 ++++++++++++++++++++++++++++++++
 1 file changed, 68 insertions(+)

diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 1db0931ac3..4eff59e516 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -42,6 +42,7 @@
 ;;; Copyright © 2021 Julien Lepiller <julien@lepiller.eu>
 ;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
 ;;; Copyright © 2021 jgart <jgart@dismail.de>
+;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
 ;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
 ;;; Copyright © 2022 Jai Vetrivelan <jaivetrivelan@gmail.com>
 ;;; Copyright © 2022 Maxime Devos <maximedevos@telenet.be>
@@ -140,6 +141,8 @@ (define-module (gnu packages version-control)
   #:use-module (gnu packages textutils)
   #:use-module (gnu packages time)
   #:use-module (gnu packages tls)
+  ;; Using autoload to avoid a cycle.
+  #:autoload   (gnu packages haskell-apps) (shellcheck)
   #:use-module (gnu packages)
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1)
@@ -1365,6 +1368,71 @@ (define-public git-flow
 lot easier.")
     (license license:bsd-2)))
 
+(define-public git-issue
+  (let ((commit "4d2bc4173bf803d74bf2ae54f892bd08754f1b48")
+        (revision "1"))
+    (package
+      (name "git-issue")
+      (version (git-version "0.0" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri
+                 (git-reference
+                  (url "https://github.com/dspinellis/git-issue")
+                  (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "0jmx8wjvvxkd3y5im2h96d13dnbpds66djf96b6s23jwfbr7dlsz"))))
+      (build-system gnu-build-system)
+      (arguments
+       (list
+        #:make-flags #~(list (string-append "PREFIX=" #$output))
+        #:test-target "test"
+        #:phases
+        #~(modify-phases %standard-phases
+           (delete 'configure)
+           (delete 'build)
+           (add-before 'check 'setup-env
+             (lambda* (#:key inputs native-inputs #:allow-other-keys)
+               (setenv "HOME" (getenv "TMPDIR"))
+               (invoke "git" "config" "--global" "user.email" "test")
+               (invoke "git" "config" "--global" "user.name" "Test")
+               (substitute* "test.sh"
+                 (("! git diff") "false")
+                 (("#!/bin/sh")
+                  (string-append
+                   "#!"
+                   (search-input-file (or native-inputs inputs) "/bin/sh"))))
+               (substitute* "Makefile"
+                 (("shellcheck -x")
+                  "shellcheck --exclude=SC2001,SC2294,SC3043,SC3003 -x"))))
+           (add-after 'install 'patch-paths
+             (lambda* (#:key inputs outputs #:allow-other-keys)
+               (let ((path (map
+                            (lambda (program)
+                              (dirname
+                               (search-input-file inputs
+                                                  (string-append "/bin/" program))))
+                            '("jq" "curl" "grep" "cat" "find"))))
+                 (wrap-program (search-input-file outputs "bin/git-issue")
+                   `("PATH" prefix ,path))))))))
+      (native-inputs (list shellcheck git-minimal bash-minimal util-linux))
+      (inputs (list bash-minimal
+                    coreutils
+                    curl
+                    findutils
+                    grep
+                    jq
+                    sed))
+      (synopsis
+       "Git-based decentralized issue management")
+      (description "Git-issue provide a minimalist decentralized issue
+management system based on Git, offering (optional) bidirectional
+integration with GitHub and GitLab issue management.")
+      (home-page "https://github.com/dspinellis/git-issue")
+      (license license:gpl3+))))
+
 (define-public stgit
   (package
     (name "stgit")

base-commit: cf78f5b54975679df97c3015a541114d8278f417
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-05-29 14:36 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-15 17:01 [bug#49581] [PATCH] Add git-issues phodina via Guix-patches via
2021-07-17  9:39 ` Giovanni Biscuolo
2021-07-17 10:23 ` Tobias Geerinckx-Rice via Guix-patches via
2021-07-17 12:25   ` phodina via Guix-patches via
2021-09-18  8:31 ` [bug#49581] [PATCH v3] gnu: " phodina via Guix-patches via
2021-09-22 22:14   ` Sarah Morgensen
2021-09-23  7:15     ` Sarah Morgensen
2021-11-01 20:21 ` [bug#49581] [PATCH v4] " phodina via Guix-patches via
2022-11-22 17:38   ` Giovanni Biscuolo
2023-05-29 14:35 ` [bug#49581] [PATCH v5] gnu: Add git-issue jlicht

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.