diff mbox series

[bug#60905,08/25] gnu: go-github-com-pkg-diff: Update to 0.0.0-20210226163009-20ebb0f2a09e.

Message ID 20230118014510.19320-9-cox.katherine.e@gmail.com
State New
Headers show
Series gnu: golang: Add gopls | expand

Commit Message

Katherine Cox-Buday Jan. 18, 2023, 1:44 a.m. UTC
* gnu/packages/golang.scm (go-github-com-pkg-diff): Update to 0.0.0-20210226163009-20ebb0f2a09e.
---
 gnu/packages/golang.scm | 44 +++++++++++++++++++----------------------
 1 file changed, 20 insertions(+), 24 deletions(-)

Comments

Christopher Baines Feb. 6, 2023, 10:04 p.m. UTC | #1
Katherine Cox-Buday <cox.katherine.e@gmail.com> writes:

> * gnu/packages/golang.scm (go-github-com-pkg-diff): Update to 0.0.0-20210226163009-20ebb0f2a09e.
> ---
>  gnu/packages/golang.scm | 44 +++++++++++++++++++----------------------
>  1 file changed, 20 insertions(+), 24 deletions(-)
>
> diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
> index 9554234c7b..5e8159975f 100644
> --- a/gnu/packages/golang.scm
> +++ b/gnu/packages/golang.scm
> @@ -8736,30 +8736,26 @@ (define-public go-github-com-go-git-go-git-fixtures
>      (license license:asl2.0)))
>  
>  (define-public go-github-com-pkg-diff
> -  (let ((commit "531926345625d489a6b56f860a569e68245ace36")
> -        (revision "1"))
> -    (package
> -      (name "go-github-com-pkg-diff")
> -      (version (git-version "0.0.1" revision commit))
> -      (source (origin
> -                (method git-fetch)
> -                (uri (git-reference
> -                      (url "https://github.com/pkg/diff")
> -                      (commit commit)))
> -                (file-name (git-file-name name version))
> -                (sha256
> -                 (base32
> -                  "1770m7qhww6lm0wj1v3mhv6hwa2v92p4w2fqxj1xyrg5dd58d944"))))
> -      (build-system go-build-system)
> -      (arguments
> -       `(#:import-path "github.com/pkg/diff"))
> -      (native-inputs
> -       (list go-github-com-sergi-go-diff))
> -      (home-page "https://github.com/pkg/diff/")
> -      (synopsis "Create and print diffs")
> -      (description
> -       "This package provides a Go library to create and print diffs.")
> -      (license license:bsd-3))))
> +  (package
> +    (name "go-github-com-pkg-diff")
> +    (version "0.0.0-20210226163009-20ebb0f2a09e")
> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url "https://github.com/pkg/diff")
> +                    (commit "20ebb0f2a09e612109b224b32f79370409108bcc")))
> +              (file-name (git-file-name name version))
> +              (sha256
> +               (base32
> +                "1g3dzgwhz4fx3ddpsv7fsa4r1v5clsp2lbw2qrkdk9y1vc5gi8yi"))))
> +    (build-system go-build-system)
> +    (arguments
> +     `(#:import-path "github.com/pkg/diff"))
> +    (home-page "https://github.com/pkg/diff/")
> +    (synopsis "Create and print diffs")
> +    (description
> +     "This package provides a Go library to create and print diffs.")
> +    (license license:bsd-3)))
>  
>  (define-public go-github-com-twpayne-go-shell
>    (package

I'm not sure I prefer the longer version here, and also having the
commit in the origin but then part of it in the version makes this a
little harder to update since you have to update both bits.

What led you to change from using the (let ((... bit here?
\( Feb. 6, 2023, 10:20 p.m. UTC | #2
* gnu/packages/golang.scm (go-github-com-pkg-diff): Update to 0.0.0-20210226163009-20ebb0f2a09e.

> --- a/gnu/packages/golang.scm
> +++ b/gnu/packages/golang.scm

> @@ -8736,30 +8736,26 @@ (define-public go-github-com-go-git-go-git-fixtures

> +  (package
> +    (name "go-github-com-pkg-diff")
> +    (version "0.0.0-20210226163009-20ebb0f2a09e")

As Chris said, don't use this kind of version string :)

> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url "https://github.com/pkg/diff")
> +                    (commit "20ebb0f2a09e612109b224b32f79370409108bcc")))

And especially don't write the commit twice.

> +    (synopsis "Create and print diffs")

  (synopsis "Generate and print diffs in Go")

> +    (description
> +     "This package provides a Go library to create and print diffs.")

  (description
   "This package provides a Go library to generate and print file
  differences in the @code{diff} format.")

    -- (
Katherine Cox-Buday Feb. 7, 2023, 5:04 p.m. UTC | #3
"( via Guix-patches" via <guix-patches@gnu.org> writes:

> * gnu/packages/golang.scm (go-github-com-pkg-diff): Update to
> 0.0.0-20210226163009-20ebb0f2a09e.
>
>> --- a/gnu/packages/golang.scm
>> +++ b/gnu/packages/golang.scm
>
>> @@ -8736,30 +8736,26 @@ (define-public go-github-com-go-git-go-git-fixtures
>
>> +  (package
>> +    (name "go-github-com-pkg-diff")
>> +    (version "0.0.0-20210226163009-20ebb0f2a09e")
>
> As Chris said, don't use this kind of version string :)

Ah, I actually have (what I think) is a valid reason for this. In Go,
when a module is in development, this long string, including the SHA, is
the actual version[1] of the module, and carries semantics for Go developers, i.e. "Signals that the module is still in development and unstable. The release carries no backwards compatibility or stability guarantees."

It's how it will be referenced by other Go modules, and so I thought it
best to make the version field reflect the actual version. The previous
iteration of this package had an incorrect version: upstream did not
assign it a 0.0.1 version; that's something we did.

I agree that this is confusing for Guix maintainers, and causes
duplicate information in the version and commit fields.

What are your opinions on this?

>> +    (source (origin
>> +              (method git-fetch)
>> +              (uri (git-reference
>> +                    (url "https://github.com/pkg/diff")
>> +                    (commit "20ebb0f2a09e612109b224b32f79370409108bcc")))
>
> And especially don't write the commit twice.
>
>> +    (synopsis "Create and print diffs")
>
>   (synopsis "Generate and print diffs in Go")

I only bumped the version here; the synopsis was pre-existing. But: is the language important? Do we say "Diff creates and prints diffs in
C"?

>> +    (description
>> +     "This package provides a Go library to create and print diffs.")
>
>   (description
>    "This package provides a Go library to generate and print file
>   differences in the @code{diff} format.")

[1] https://go.dev/doc/modules/version-numbers#in-development
\( Feb. 7, 2023, 5:48 p.m. UTC | #4
On Tue Feb 7, 2023 at 5:04 PM GMT, Katherine Cox-Buday wrote:
> What are your opinions on this?

Hmm, interesting.  I think this would be better answered by more experienced
contributors.
>
> >> +    (source (origin
> >> +              (method git-fetch)
> >> +              (uri (git-reference
> >> +                    (url "https://github.com/pkg/diff")
> >> +                    (commit "20ebb0f2a09e612109b224b32f79370409108bcc")))
> >
> > And especially don't write the commit twice.

I should've elaborated: use GO-VERSION->GIT-REF here :)

> I only bumped the version here; the synopsis was pre-existing. But: is the language important? Do we say "Diff creates and prints diffs in
> C"?

Isn't this also a Go library?  If it isn't, then yeah, it's not important,
but if it is, I'd say you should add "in Go".

    -- (
Christopher Baines Feb. 8, 2023, 11:47 a.m. UTC | #5
Katherine Cox-Buday <cox.katherine.e@gmail.com> writes:

> "( via Guix-patches" via <guix-patches@gnu.org> writes:
>
>> * gnu/packages/golang.scm (go-github-com-pkg-diff): Update to
>> 0.0.0-20210226163009-20ebb0f2a09e.
>>
>>> --- a/gnu/packages/golang.scm
>>> +++ b/gnu/packages/golang.scm
>>
>>> @@ -8736,30 +8736,26 @@ (define-public go-github-com-go-git-go-git-fixtures
>>
>>> +  (package
>>> +    (name "go-github-com-pkg-diff")
>>> +    (version "0.0.0-20210226163009-20ebb0f2a09e")
>>
>> As Chris said, don't use this kind of version string :)
>
> Ah, I actually have (what I think) is a valid reason for this. In Go,
> when a module is in development, this long string, including the SHA, is
> the actual version[1] of the module, and carries semantics for Go
> developers, i.e. "Signals that the module is still in development and
> unstable. The release carries no backwards compatibility or stability
> guarantees."
>
> It's how it will be referenced by other Go modules, and so I thought it
> best to make the version field reflect the actual version. The previous
> iteration of this package had an incorrect version: upstream did not
> assign it a 0.0.1 version; that's something we did.
>
> I agree that this is confusing for Guix maintainers, and causes
> duplicate information in the version and commit fields.
>
> What are your opinions on this?

I guess I'm not that fussed if a long version has some use.

What I would say is that as long as the version incorporates the commit
in some way and the commit is used in the package source bit, I'd use
the (let ((commit ... pattern to avoid duplicating bits of the commit
hash and make tweaking the commit easier.
diff mbox series

Patch

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 9554234c7b..5e8159975f 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -8736,30 +8736,26 @@  (define-public go-github-com-go-git-go-git-fixtures
     (license license:asl2.0)))
 
 (define-public go-github-com-pkg-diff
-  (let ((commit "531926345625d489a6b56f860a569e68245ace36")
-        (revision "1"))
-    (package
-      (name "go-github-com-pkg-diff")
-      (version (git-version "0.0.1" revision commit))
-      (source (origin
-                (method git-fetch)
-                (uri (git-reference
-                      (url "https://github.com/pkg/diff")
-                      (commit commit)))
-                (file-name (git-file-name name version))
-                (sha256
-                 (base32
-                  "1770m7qhww6lm0wj1v3mhv6hwa2v92p4w2fqxj1xyrg5dd58d944"))))
-      (build-system go-build-system)
-      (arguments
-       `(#:import-path "github.com/pkg/diff"))
-      (native-inputs
-       (list go-github-com-sergi-go-diff))
-      (home-page "https://github.com/pkg/diff/")
-      (synopsis "Create and print diffs")
-      (description
-       "This package provides a Go library to create and print diffs.")
-      (license license:bsd-3))))
+  (package
+    (name "go-github-com-pkg-diff")
+    (version "0.0.0-20210226163009-20ebb0f2a09e")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/pkg/diff")
+                    (commit "20ebb0f2a09e612109b224b32f79370409108bcc")))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1g3dzgwhz4fx3ddpsv7fsa4r1v5clsp2lbw2qrkdk9y1vc5gi8yi"))))
+    (build-system go-build-system)
+    (arguments
+     `(#:import-path "github.com/pkg/diff"))
+    (home-page "https://github.com/pkg/diff/")
+    (synopsis "Create and print diffs")
+    (description
+     "This package provides a Go library to create and print diffs.")
+    (license license:bsd-3)))
 
 (define-public go-github-com-twpayne-go-shell
   (package