unofficial mirror of guix-devel@gnu.org 
 help / color / Atom feed
* generate commit messages for package updates
@ 2020-06-12 22:40 Ricardo Wurmus
  2020-06-13  6:31 ` Edouard Klein
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Ricardo Wurmus @ 2020-06-12 22:40 UTC (permalink / raw)
  To: guix-devel

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

Hi Guix,

I’m currently working on upgrading all Bioconductor packages to the 3.11
release.  The hardest work here is to write commit messages for the 200+
packages that have changed.  Even with the “update” yasnippet and magit
this takes a very long time.

I wrote a little tool to reduce the amount of time needed to create
commits.  It is not fully automatic yet as it requires my input to stage
hunks, but the commit messages it produces take all input changes into
account, which is something the “update” yasnippet does not do.

After “guix refresh -t bioconductor -u”, manually verifying and
implementing the suggested changes, and building all packages, I run
“git add -p” to stage hunks that belong to the same package definition.
Then I run the attached tool to make a commit:

    ./committer.scm | git commit -F -

The tool works by looking at the unified diff in the staging area and
generating two S-expressions corresponding to the original package
definition and the changed package definition, respectively.  It then
looks at the inputs, propagated-inputs, and native-inputs fields and
generates a GNU ChangeLog-style commit message describing the changes.

Here’s an example diff:

--8<---------------cut here---------------start------------->8---
modified   gnu/packages/bioconductor.scm
@@ -2701,29 +2701,32 @@ gene and isoform level using RNA-seq data")
 (define-public r-karyoploter
   (package
     (name "r-karyoploter")
-    (version "1.12.4")
+    (version "1.14.0")
     (source (origin
               (method url-fetch)
               (uri (bioconductor-uri "karyoploteR" version))
               (sha256
                (base32
-                "03jmfgmw35hrgn3pc5lq6pblzhfx9fp4l6dx50rp303lr7kjxp9v"))))
+                "0h0gk4xd95k5phy6qcsv7j931d7gk3p24i2fg4mz5dsk110lpifs"))))
     (build-system r-build-system)
     (propagated-inputs
-     `(("r-regioner" ,r-regioner)
+     `(("r-annotationdbi" ,r-annotationdbi)
+       ("r-bamsignals" ,r-bamsignals)
+       ("r-bezier" ,r-bezier)
+       ("r-biovizbase" ,r-biovizbase)
+       ("r-digest" ,r-digest)
+       ("r-genomeinfodb" ,r-genomeinfodb)
+       ("r-genomicfeatures" ,r-genomicfeatures)
        ("r-genomicranges" ,r-genomicranges)
        ("r-iranges" ,r-iranges)
-       ("r-rsamtools" ,r-rsamtools)
        ("r-memoise" ,r-memoise)
+       ("r-regioner" ,r-regioner)
+       ("r-rsamtools" ,r-rsamtools)
        ("r-rtracklayer" ,r-rtracklayer)
-       ("r-genomeinfodb" ,r-genomeinfodb)
        ("r-s4vectors" ,r-s4vectors)
-       ("r-biovizbase" ,r-biovizbase)
-       ("r-digest" ,r-digest)
-       ("r-bezier" ,r-bezier)
-       ("r-bamsignals" ,r-bamsignals)
-       ("r-annotationdbi" ,r-annotationdbi)
        ("r-variantannotation" ,r-variantannotation)))
+    (native-inputs
+     `(("r-knitr" ,r-knitr)))
     (home-page "https://bioconductor.org/packages/karyoploteR/")
     (synopsis "Plot customizable linear genomes displaying arbitrary data")
     (description "This package creates karyotype plots of arbitrary genomes and
--8<---------------cut here---------------end--------------->8---

…and this is the generated commit message:

--8<---------------cut here---------------start------------->8---
gnu: r-karyoploter: Update to 1.14.0.

* gnu/packages/bioconductor.scm (r-karyoploter): Update to 1.14.0.
[propagated-inputs]: Add r-genomicfeatures.
[native-inputs]: Add r-knitr.
--8<---------------cut here---------------end--------------->8---

Obviously, this can be improved by avoiding the staging area and
operating on all hunks in all selected files, so that more than one
commit can be made at a time.  But I thought I’d share this hack anyway,
crude as it is.

-- 
Ricardo


[-- Attachment #2: committer.scm --]
[-- Type: application/x-scheme, Size: 5829 bytes --]

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

* Re: generate commit messages for package updates
  2020-06-12 22:40 generate commit messages for package updates Ricardo Wurmus
@ 2020-06-13  6:31 ` Edouard Klein
  2020-06-13  7:47 ` Hartmut Goebel
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: Edouard Klein @ 2020-06-13  6:31 UTC (permalink / raw)
  To: guix-devel

Thank you Ricardo !

Writing commit messages by hand is a major pain, especially for
newcommers like me. For simple commits it took me more time to write the
message than to write the code. The mistakes I made writing the commit
messages made the reviewers lose time correcting them. Automating this
task away is exactly what we need :)


Ricardo Wurmus writes:

> Hi Guix,
>
> I’m currently working on upgrading all Bioconductor packages to the 3.11
> release.  The hardest work here is to write commit messages for the 200+
> packages that have changed.  Even with the “update” yasnippet and magit
> this takes a very long time.
>
> I wrote a little tool to reduce the amount of time needed to create
> commits.  It is not fully automatic yet as it requires my input to stage
> hunks, but the commit messages it produces take all input changes into
> account, which is something the “update” yasnippet does not do.
>
> After “guix refresh -t bioconductor -u”, manually verifying and
> implementing the suggested changes, and building all packages, I run
> “git add -p” to stage hunks that belong to the same package definition.
> Then I run the attached tool to make a commit:
>
>     ./committer.scm | git commit -F -
>
> The tool works by looking at the unified diff in the staging area and
> generating two S-expressions corresponding to the original package
> definition and the changed package definition, respectively.  It then
> looks at the inputs, propagated-inputs, and native-inputs fields and
> generates a GNU ChangeLog-style commit message describing the changes.
>
> Here’s an example diff:
>
> --8<---------------cut here---------------start------------->8---
> modified   gnu/packages/bioconductor.scm
> @@ -2701,29 +2701,32 @@ gene and isoform level using RNA-seq data")
>  (define-public r-karyoploter
>    (package
>      (name "r-karyoploter")
> -    (version "1.12.4")
> +    (version "1.14.0")
>      (source (origin
>                (method url-fetch)
>                (uri (bioconductor-uri "karyoploteR" version))
>                (sha256
>                 (base32
> -                "03jmfgmw35hrgn3pc5lq6pblzhfx9fp4l6dx50rp303lr7kjxp9v"))))
> +                "0h0gk4xd95k5phy6qcsv7j931d7gk3p24i2fg4mz5dsk110lpifs"))))
>      (build-system r-build-system)
>      (propagated-inputs
> -     `(("r-regioner" ,r-regioner)
> +     `(("r-annotationdbi" ,r-annotationdbi)
> +       ("r-bamsignals" ,r-bamsignals)
> +       ("r-bezier" ,r-bezier)
> +       ("r-biovizbase" ,r-biovizbase)
> +       ("r-digest" ,r-digest)
> +       ("r-genomeinfodb" ,r-genomeinfodb)
> +       ("r-genomicfeatures" ,r-genomicfeatures)
>         ("r-genomicranges" ,r-genomicranges)
>         ("r-iranges" ,r-iranges)
> -       ("r-rsamtools" ,r-rsamtools)
>         ("r-memoise" ,r-memoise)
> +       ("r-regioner" ,r-regioner)
> +       ("r-rsamtools" ,r-rsamtools)
>         ("r-rtracklayer" ,r-rtracklayer)
> -       ("r-genomeinfodb" ,r-genomeinfodb)
>         ("r-s4vectors" ,r-s4vectors)
> -       ("r-biovizbase" ,r-biovizbase)
> -       ("r-digest" ,r-digest)
> -       ("r-bezier" ,r-bezier)
> -       ("r-bamsignals" ,r-bamsignals)
> -       ("r-annotationdbi" ,r-annotationdbi)
>         ("r-variantannotation" ,r-variantannotation)))
> +    (native-inputs
> +     `(("r-knitr" ,r-knitr)))
>      (home-page "https://bioconductor.org/packages/karyoploteR/")
>      (synopsis "Plot customizable linear genomes displaying arbitrary data")
>      (description "This package creates karyotype plots of arbitrary genomes and
> --8<---------------cut here---------------end--------------->8---
>
> …and this is the generated commit message:
>
> --8<---------------cut here---------------start------------->8---
> gnu: r-karyoploter: Update to 1.14.0.
>
> * gnu/packages/bioconductor.scm (r-karyoploter): Update to 1.14.0.
> [propagated-inputs]: Add r-genomicfeatures.
> [native-inputs]: Add r-knitr.
> --8<---------------cut here---------------end--------------->8---
>
> Obviously, this can be improved by avoiding the staging area and
> operating on all hunks in all selected files, so that more than one
> commit can be made at a time.  But I thought I’d share this hack anyway,
> crude as it is.



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

* Re: generate commit messages for package updates
  2020-06-12 22:40 generate commit messages for package updates Ricardo Wurmus
  2020-06-13  6:31 ` Edouard Klein
@ 2020-06-13  7:47 ` Hartmut Goebel
  2020-06-13  7:54   ` Pierre Neidhardt
  2020-06-14  6:56 ` Ricardo Wurmus
  2020-06-20 10:00 ` Alex Sassmannshausen
  3 siblings, 1 reply; 11+ messages in thread
From: Hartmut Goebel @ 2020-06-13  7:47 UTC (permalink / raw)
  To: guix-devel

Hi Ricardo,
> I wrote a little tool to reduce the amount of time needed to create
> commits.  It is not fully automatic yet as it requires my input to stage
> hunks, but the commit messages it produces take all input changes into
> account, which is something the “update” yasnippet does not do.

Great! I wished such a tool since long!

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |



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

* Re: generate commit messages for package updates
  2020-06-13  7:47 ` Hartmut Goebel
@ 2020-06-13  7:54   ` Pierre Neidhardt
  0 siblings, 0 replies; 11+ messages in thread
From: Pierre Neidhardt @ 2020-06-13  7:54 UTC (permalink / raw)
  To: Hartmut Goebel, guix-devel

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

Same here!  Thanks!

-- 
Pierre Neidhardt
https://ambrevar.xyz/

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

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

* Re: generate commit messages for package updates
  2020-06-12 22:40 generate commit messages for package updates Ricardo Wurmus
  2020-06-13  6:31 ` Edouard Klein
  2020-06-13  7:47 ` Hartmut Goebel
@ 2020-06-14  6:56 ` Ricardo Wurmus
  2020-06-14  9:26   ` Pierre Neidhardt
  2020-06-20 10:00 ` Alex Sassmannshausen
  3 siblings, 1 reply; 11+ messages in thread
From: Ricardo Wurmus @ 2020-06-14  6:56 UTC (permalink / raw)
  To: guix-devel

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


Ricardo Wurmus <rekado@elephly.net> writes:

> It is not fully automatic yet as it requires my input to stage
> hunks, but the commit messages it produces take all input changes into
> account, which is something the “update” yasnippet does not do.

Attached is the fully automatic version.

You just make your changes and run the tool.  It will stage all diffs
that are associated with the same S-expression, generate the commit
message, and make the commit for each S-expression.

Note that it probably doesn’t do the right thing when something other
than a package expression is modified (e.g. a copyright line).

-- 
Ricardo


[-- Attachment #2: committer.scm --]
[-- Type: application/octet-stream, Size: 8286 bytes --]

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

* Re: generate commit messages for package updates
  2020-06-14  6:56 ` Ricardo Wurmus
@ 2020-06-14  9:26   ` Pierre Neidhardt
  2020-06-14 12:22     ` Ricardo Wurmus
  2020-06-14 15:17     ` Ludovic Courtès
  0 siblings, 2 replies; 11+ messages in thread
From: Pierre Neidhardt @ 2020-06-14  9:26 UTC (permalink / raw)
  To: Ricardo Wurmus, guix-devel

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

Is it worth including in guix/etc?

-- 
Pierre Neidhardt
https://ambrevar.xyz/

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

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

* Re: generate commit messages for package updates
  2020-06-14  9:26   ` Pierre Neidhardt
@ 2020-06-14 12:22     ` Ricardo Wurmus
  2020-06-14 15:17     ` Ludovic Courtès
  1 sibling, 0 replies; 11+ messages in thread
From: Ricardo Wurmus @ 2020-06-14 12:22 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: guix-devel


Pierre Neidhardt <mail@ambrevar.xyz> writes:

> Is it worth including in guix/etc?

In my biased opinion: yes.  I’d like to improve it a little more and
handle more changes, but I think the general approach isn’t going to
change much.

-- 
Ricardo


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

* Re: generate commit messages for package updates
  2020-06-14  9:26   ` Pierre Neidhardt
  2020-06-14 12:22     ` Ricardo Wurmus
@ 2020-06-14 15:17     ` Ludovic Courtès
  2020-06-16  9:38       ` Ricardo Wurmus
  1 sibling, 1 reply; 11+ messages in thread
From: Ludovic Courtès @ 2020-06-14 15:17 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: guix-devel

Pierre Neidhardt <mail@ambrevar.xyz> skribis:

> Is it worth including in guix/etc?

I think it’d be nice!

Ludo’.


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

* Re: generate commit messages for package updates
  2020-06-14 15:17     ` Ludovic Courtès
@ 2020-06-16  9:38       ` Ricardo Wurmus
  2020-06-19 20:43         ` Ludovic Courtès
  0 siblings, 1 reply; 11+ messages in thread
From: Ricardo Wurmus @ 2020-06-16  9:38 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel


Ludovic Courtès <ludo@gnu.org> writes:

> Pierre Neidhardt <mail@ambrevar.xyz> skribis:
>
>> Is it worth including in guix/etc?
>
> I think it’d be nice!

I fixed a bug and added etc/committer.scm.in.

-- 
Ricardo


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

* Re: generate commit messages for package updates
  2020-06-16  9:38       ` Ricardo Wurmus
@ 2020-06-19 20:43         ` Ludovic Courtès
  0 siblings, 0 replies; 11+ messages in thread
From: Ludovic Courtès @ 2020-06-19 20:43 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

Hi,

Ricardo Wurmus <rekado@elephly.net> skribis:

> Ludovic Courtès <ludo@gnu.org> writes:
>
>> Pierre Neidhardt <mail@ambrevar.xyz> skribis:
>>
>>> Is it worth including in guix/etc?
>>
>> I think it’d be nice!
>
> I fixed a bug and added etc/committer.scm.in.

Yay!  Consider adding a line in “Contributing” to mention its existence.

Thank you,
Ludo’.


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

* Re: generate commit messages for package updates
  2020-06-12 22:40 generate commit messages for package updates Ricardo Wurmus
                   ` (2 preceding siblings ...)
  2020-06-14  6:56 ` Ricardo Wurmus
@ 2020-06-20 10:00 ` Alex Sassmannshausen
  3 siblings, 0 replies; 11+ messages in thread
From: Alex Sassmannshausen @ 2020-06-20 10:00 UTC (permalink / raw)
  To: guix-devel

Hi Ricardo,

Just used your committer tool for the first time and it's bloody lovely.

Thank you for sharing it :-)

Alex

Ricardo Wurmus <rekado@elephly.net> writes:

> Hi Guix,
>
> I’m currently working on upgrading all Bioconductor packages to the 3.11
> release.  The hardest work here is to write commit messages for the 200+
> packages that have changed.  Even with the “update” yasnippet and magit
> this takes a very long time.
>
> I wrote a little tool to reduce the amount of time needed to create
> commits.  It is not fully automatic yet as it requires my input to stage
> hunks, but the commit messages it produces take all input changes into
> account, which is something the “update” yasnippet does not do.
>
> After “guix refresh -t bioconductor -u”, manually verifying and
> implementing the suggested changes, and building all packages, I run
> “git add -p” to stage hunks that belong to the same package definition.
> Then I run the attached tool to make a commit:
>
>     ./committer.scm | git commit -F -
>
> The tool works by looking at the unified diff in the staging area and
> generating two S-expressions corresponding to the original package
> definition and the changed package definition, respectively.  It then
> looks at the inputs, propagated-inputs, and native-inputs fields and
> generates a GNU ChangeLog-style commit message describing the changes.
>
> Here’s an example diff:
>
> --8<---------------cut here---------------start------------->8---
> modified   gnu/packages/bioconductor.scm
> @@ -2701,29 +2701,32 @@ gene and isoform level using RNA-seq data")
>  (define-public r-karyoploter
>    (package
>      (name "r-karyoploter")
> -    (version "1.12.4")
> +    (version "1.14.0")
>      (source (origin
>                (method url-fetch)
>                (uri (bioconductor-uri "karyoploteR" version))
>                (sha256
>                 (base32
> -                "03jmfgmw35hrgn3pc5lq6pblzhfx9fp4l6dx50rp303lr7kjxp9v"))))
> +                "0h0gk4xd95k5phy6qcsv7j931d7gk3p24i2fg4mz5dsk110lpifs"))))
>      (build-system r-build-system)
>      (propagated-inputs
> -     `(("r-regioner" ,r-regioner)
> +     `(("r-annotationdbi" ,r-annotationdbi)
> +       ("r-bamsignals" ,r-bamsignals)
> +       ("r-bezier" ,r-bezier)
> +       ("r-biovizbase" ,r-biovizbase)
> +       ("r-digest" ,r-digest)
> +       ("r-genomeinfodb" ,r-genomeinfodb)
> +       ("r-genomicfeatures" ,r-genomicfeatures)
>         ("r-genomicranges" ,r-genomicranges)
>         ("r-iranges" ,r-iranges)
> -       ("r-rsamtools" ,r-rsamtools)
>         ("r-memoise" ,r-memoise)
> +       ("r-regioner" ,r-regioner)
> +       ("r-rsamtools" ,r-rsamtools)
>         ("r-rtracklayer" ,r-rtracklayer)
> -       ("r-genomeinfodb" ,r-genomeinfodb)
>         ("r-s4vectors" ,r-s4vectors)
> -       ("r-biovizbase" ,r-biovizbase)
> -       ("r-digest" ,r-digest)
> -       ("r-bezier" ,r-bezier)
> -       ("r-bamsignals" ,r-bamsignals)
> -       ("r-annotationdbi" ,r-annotationdbi)
>         ("r-variantannotation" ,r-variantannotation)))
> +    (native-inputs
> +     `(("r-knitr" ,r-knitr)))
>      (home-page "https://bioconductor.org/packages/karyoploteR/")
>      (synopsis "Plot customizable linear genomes displaying arbitrary data")
>      (description "This package creates karyotype plots of arbitrary genomes and
> --8<---------------cut here---------------end--------------->8---
>
> …and this is the generated commit message:
>
> --8<---------------cut here---------------start------------->8---
> gnu: r-karyoploter: Update to 1.14.0.
>
> * gnu/packages/bioconductor.scm (r-karyoploter): Update to 1.14.0.
> [propagated-inputs]: Add r-genomicfeatures.
> [native-inputs]: Add r-knitr.
> --8<---------------cut here---------------end--------------->8---
>
> Obviously, this can be improved by avoiding the staging area and
> operating on all hunks in all selected files, so that more than one
> commit can be made at a time.  But I thought I’d share this hack anyway,
> crude as it is.



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

end of thread, back to index

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-12 22:40 generate commit messages for package updates Ricardo Wurmus
2020-06-13  6:31 ` Edouard Klein
2020-06-13  7:47 ` Hartmut Goebel
2020-06-13  7:54   ` Pierre Neidhardt
2020-06-14  6:56 ` Ricardo Wurmus
2020-06-14  9:26   ` Pierre Neidhardt
2020-06-14 12:22     ` Ricardo Wurmus
2020-06-14 15:17     ` Ludovic Courtès
2020-06-16  9:38       ` Ricardo Wurmus
2020-06-19 20:43         ` Ludovic Courtès
2020-06-20 10:00 ` Alex Sassmannshausen

unofficial mirror of guix-devel@gnu.org 

Archives are clonable:
	git clone --mirror https://yhetil.org/guix-devel/0 guix-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 guix-devel guix-devel/ https://yhetil.org/guix-devel \
		guix-devel@gnu.org
	public-inbox-index guix-devel

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.gnu.guix.devel
	nntp://news.gmane.io/gmane.comp.gnu.guix.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git