unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / 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

end of thread, other threads:[~2020-06-20 10:00 UTC | newest]

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

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).