[PATCH] gnu: Add git-open.

  • Done
  • quality assurance status badge
Details
2 participants
  • EuAndreh
  • Leo Famulari
Owner
unassigned
Submitted by
EuAndreh
Severity
normal
E
E
EuAndreh wrote on 23 Nov 2020 02:17
(address . guix-patches@gnu.org)(name . EuAndreh)(address . eu@euandre.org)
20201123011708.3436-1-eu@euandre.org
* gnu/packages/version-control.scm (git-open): New variable.
---
gnu/packages/version-control.scm | 34 +++++++++++++++++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)

Toggle diff (54 lines)
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 1842528ff6..43085744eb 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -14,7 +14,7 @@
;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2017 Vasile Dumitrascu <va511e@yahoo.com>
;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
-;;; Copyright © 2017 André <eu@euandre.org>
+;;; Copyright © 2017, 2020 EuAndreh <eu@euandre.org>
;;; Copyright © 2017, 2018, 2020 Marius Bakke <mbakke@fastmail.com>
;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
;;; Copyright © 2017, 2020 Oleg Pykhalov <go.wigust@gmail.com>
@@ -2718,6 +2718,38 @@ videos, datasets, and graphics with text pointers inside Git, while storing the
file contents on a remote server.")
(license license:expat)))
+(define-public git-open
+ (package
+ (name "git-open")
+ (version "2.1.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/paulirish/git-open")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "11n46bngvca5wbdbfcxzjhjbfdbad7sgf7h9gf956cb1q8swsdm0"))))
+ (build-system trivial-build-system)
+ (arguments
+ `(#:modules ((guix build utils))
+ #:builder
+ (begin
+ (use-modules (guix build utils))
+ (let ((source (assoc-ref %build-inputs "source"))
+ (out (assoc-ref %outputs "out")))
+ (mkdir-p (string-append out "/bin"))
+ (copy-file (string-append source "/git-open")
+ (string-append out "/bin/git-open"))
+ #t))))
+ (home-page "https://github.com/paulirish/git-open")
+ (synopsis "Shortcut for opening the repository's homepage on the browser")
+ (description
+ "@code{git open} opens the repository's website from the command-line,
+guessing the URL pattern from the 'origin' remote.")
+ (license license:expat)))
+
(define-public tla
(package
(name "gnu-arch")
--
2.29.2
E
E
EuAndreh wrote on 23 Nov 2020 12:44
(address . 44810@debbugs.gnu.org)(name . EuAndreh)(address . eu@euandre.org)
20201123114435.32490-1-eu@euandre.org
* gnu/packages/version-control.scm (git-open): New variable.
---
Fixed warning given by "guix lint" on quotes in description field.

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

Toggle diff (54 lines)
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 1842528ff6..34b35d1c94 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -14,7 +14,7 @@
;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2017 Vasile Dumitrascu <va511e@yahoo.com>
;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
-;;; Copyright © 2017 André <eu@euandre.org>
+;;; Copyright © 2017, 2020 EuAndreh <eu@euandre.org>
;;; Copyright © 2017, 2018, 2020 Marius Bakke <mbakke@fastmail.com>
;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
;;; Copyright © 2017, 2020 Oleg Pykhalov <go.wigust@gmail.com>
@@ -2718,6 +2718,38 @@ videos, datasets, and graphics with text pointers inside Git, while storing the
file contents on a remote server.")
(license license:expat)))
+(define-public git-open
+ (package
+ (name "git-open")
+ (version "2.1.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/paulirish/git-open")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "11n46bngvca5wbdbfcxzjhjbfdbad7sgf7h9gf956cb1q8swsdm0"))))
+ (build-system trivial-build-system)
+ (arguments
+ `(#:modules ((guix build utils))
+ #:builder
+ (begin
+ (use-modules (guix build utils))
+ (let ((source (assoc-ref %build-inputs "source"))
+ (out (assoc-ref %outputs "out")))
+ (mkdir-p (string-append out "/bin"))
+ (copy-file (string-append source "/git-open")
+ (string-append out "/bin/git-open"))
+ #t))))
+ (home-page "https://github.com/paulirish/git-open")
+ (synopsis "Shortcut for opening the repository's homepage on the browser")
+ (description
+ "@code{git open} opens the repository's website from the command-line,
+guessing the URL pattern from the @code{origin} remote.")
+ (license license:expat)))
+
(define-public tla
(package
(name "gnu-arch")
--
2.29.2
E
E
EuAndreh wrote on 23 Nov 2020 20:44
[PATCH v3] gnu: Add git-open.
(address . 44810@debbugs.gnu.org)(name . EuAndreh)(address . eu@euandre.org)
20201123194439.23444-1-eu@euandre.org
* gnu/packages/version-control.scm (git-open): New variable.
---
Now also add missing xdg-utils propagated input.

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

Toggle diff (64 lines)
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 1842528ff6..622e046e03 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -14,7 +14,7 @@
;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2017 Vasile Dumitrascu <va511e@yahoo.com>
;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
-;;; Copyright © 2017 André <eu@euandre.org>
+;;; Copyright © 2017, 2020 EuAndreh <eu@euandre.org>
;;; Copyright © 2017, 2018, 2020 Marius Bakke <mbakke@fastmail.com>
;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
;;; Copyright © 2017, 2020 Oleg Pykhalov <go.wigust@gmail.com>
@@ -74,6 +74,7 @@
#:use-module (gnu packages ed)
#:use-module (gnu packages file)
#:use-module (gnu packages flex)
+ #:use-module (gnu packages freedesktop)
#:use-module (gnu packages gettext)
#:use-module (gnu packages gl)
#:use-module (gnu packages golang)
@@ -2718,6 +2719,40 @@ videos, datasets, and graphics with text pointers inside Git, while storing the
file contents on a remote server.")
(license license:expat)))
+(define-public git-open
+ (package
+ (name "git-open")
+ (version "2.1.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/paulirish/git-open")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "11n46bngvca5wbdbfcxzjhjbfdbad7sgf7h9gf956cb1q8swsdm0"))))
+ (build-system trivial-build-system)
+ (propagated-inputs
+ `(("xdg-utils" ,xdg-utils)))
+ (arguments
+ `(#:modules ((guix build utils))
+ #:builder
+ (begin
+ (use-modules (guix build utils))
+ (let ((source (assoc-ref %build-inputs "source"))
+ (out (assoc-ref %outputs "out")))
+ (mkdir-p (string-append out "/bin"))
+ (copy-file (string-append source "/git-open")
+ (string-append out "/bin/git-open"))
+ #t))))
+ (home-page "https://github.com/paulirish/git-open")
+ (synopsis "Shortcut for opening the repository's homepage on the browser")
+ (description
+ "@code{git open} opens the repository's website from the command-line,
+guessing the URL pattern from the @code{origin} remote.")
+ (license license:expat)))
+
(define-public tla
(package
(name "gnu-arch")
--
2.29.2
L
L
Leo Famulari wrote on 26 Nov 2020 00:01
Re: [bug#44810] [PATCH] gnu: Add git-open.
(name . EuAndreh via Guix-patches via)(address . guix-patches@gnu.org)
20201125230116.GA2093@jasmine.lan
On Mon, Nov 23, 2020 at 08:44:35AM -0300, EuAndreh via Guix-patches via wrote:
Toggle quote (4 lines)
> * gnu/packages/version-control.scm (git-open): New variable.
> ---
> Fixed warning given by "guix lint" on quotes in description field.

Thanks! I tweaked the synopsis and pushed as ddb75ef55e151f1db87021891663a5a9f6766928
L
L
Leo Famulari wrote on 26 Nov 2020 00:06
Re: [bug#44810] [PATCH v3] gnu: Add git-open.
(name . EuAndreh via Guix-patches via)(address . guix-patches@gnu.org)
20201125230610.GB2093@jasmine.lan
On Mon, Nov 23, 2020 at 04:44:39PM -0300, EuAndreh via Guix-patches via wrote:
Toggle quote (4 lines)
> * gnu/packages/version-control.scm (git-open): New variable.
> ---
> Now also add missing xdg-utils propagated input.

I didn't notice this v3 patch, and also didn't notice that pushing the
v2 failed.

It might cause trouble for users to propagate xdg-utils, but we'll cross
that bridge when we come to it. Guix isn't really that convenient for
shell scripts.

Anyways, really pushed as d6d5a67e759075cddd0c0075740ea5628fc8c0d1
E
E
EuAndreh wrote on 26 Nov 2020 16:17
(address . 44810@debbugs.gnu.org)
871rggno4z.fsf@euandre.org
Leo Famulari <leo@famulari.name> writes:

Toggle quote (4 lines)
> It might cause trouble for users to propagate xdg-utils, but we'll cross
> that bridge when we come to it. Guix isn't really that convenient for
> shell scripts.

Why is that? If more than one package propagates xdg-utils, won't they
all share the same xdg-utils?

It would be a problem when to different builds of xdg-utils are
propagated, and they become conflicting. Is that what you're referring
to?

Toggle quote (2 lines)
> Anyways, really pushed as d6d5a67e759075cddd0c0075740ea5628fc8c0d1

Thanks!
L
L
Leo Famulari wrote on 26 Nov 2020 20:00
(name . EuAndreh)(address . eu@euandre.org)
X7/7P77e9vdqfOtD@jasmine.lan
On Thu, Nov 26, 2020 at 12:17:32PM -0300, EuAndreh wrote:
Toggle quote (9 lines)
> Leo Famulari <leo@famulari.name> writes:
>
> > It might cause trouble for users to propagate xdg-utils, but we'll cross
> > that bridge when we come to it. Guix isn't really that convenient for
> > shell scripts.
>
> Why is that? If more than one package propagates xdg-utils, won't they
> all share the same xdg-utils?

Yes, if the entire profile was based on a Guix version that used the
same xdg-utils. But it's a design goal of Guix to allow profiles that
are a "mix" of versions.

Toggle quote (4 lines)
> It would be a problem when to different builds of xdg-utils are
> propagated, and they become conflicting. Is that what you're referring
> to?

Yes. Sometimes this limitation is difficult to work around, especially
if the programming language of the packages in question doesn't easily
permit referring to dependencies — like the Unix shell language.
?