summaryrefslogtreecommitdiff
path: root/etc/committer.scm.in
Commit message (Expand)AuthorAgeFilesLines
* committer: Fix for inputs that are lists by using object->string.•••* etc/committer.scm.in (change-commit-message): Use object->string to deal with more complex dependency specifications. Change-Id: Ieee39709fd3eb26368df400a9228d77aa97a9d9d Signed-off-by: Ludovic Courtès <ludo@gnu.org> Attila Lendvai2024-10-151-2/+3
* committer: Avoid // in xpath.•••When using // we assume that the package definition's S-expression is a nesting of proper lists. This is not guaranteed to be true, because a package definition may contain alists. By using an explicit path to the field of interest we avoid recursion through all child nodes, thus avoiding child nodes that are more likely to contain improper lists. * etc/committer.scm.in (change-commit-message): Replace // with a path for the PACKAGE symbol. Change-Id: Idefaec9f5c3538484432e15a5865a68fc16e7369 Ricardo Wurmus2024-08-261-4/+16
* etc/committer: Speed up surrounding-sexp.•••The old surrounding-sexp procedure would read all S-expressions from the beginning of the file up to the given line number and then return the last encountered S-expression. This is quite wasteful. Instead we can record all lines that begin with an S-expression and jump straight to the offset closest to the desired line number to read the S-expression there. * etc/committer.scm.in (lines+offsets-with-opening-parens): New procedure. (surrounding-sexp): Use it. Ricardo Wurmus2023-09-241-14/+32
* etc/committer: Avoid reading original files more than once.•••* etc/committer.scm.in (%original-file-cache): New variable. (read-original-file): New procedure. (read-original-file*): New procedure. (old-sexp): Use it. Ricardo Wurmus2023-09-241-11/+24
* etc/committer: Do not record positions when reading from git files.•••This gives us a slight performance boost. * etc/committer.scm.in (main): Disable recording of positions. Ricardo Wurmus2023-09-241-0/+1
* etc/committer: Do not recompute changes when there are no definitions.•••* etc/committer.scm.in (main): Reuse previously computed changes if there are no changes to the number of definitions. Ricardo Wurmus2023-09-241-35/+40
* etc/committer: Teach it how to commit package removal.•••* etc/committer.scm.in (hunk-types): New variable. (<hunk>): Rename hunk-definition? getter to 'hunk-type'. (diff-info): Mute a git warning by separating file names from arguments with '--'. Rename the 'definitions?' variable to 'type'. Use the 'addition type when a new package addition is detected, 'removal when removed else #f. (add-commit-message): Re-indent. (remove-commit-message): New procedure. (main)[definitions]: Make commit message conditional depending on whether it is an addition or removal. [changes]: Adjust indentation. Maxim Cournoyer2022-05-311-73/+91
* etc/committer: Prefix (sxml xpath) symbols to avoid name conflict.•••This avoids a naming conflict for 'filter', provided by both (srfi srfi-1) and (sxml xpath). * etc/committer.scm.in: Use 'use-modules' instead of 'import', and use a prefix for the (sxml xpath) module. (new-sexp): Adjust accordingly. (change-commit-message): Likewise. Maxim Cournoyer2022-05-311-16/+17
* etc: committer: Support plain input lists.•••* etc/committer.scm.in (change-commit-message): Support new-style plain list inputs in addition to old-style inputs with labels. Ricardo Wurmus2022-01-231-1/+6
* etc: committer: Amend previous commit if a copyright line was added.•••Previously, the script would raise an error if a copyright line was added to a file in gnu/packages/. With this change, it will amend the previous commit whenever a copyright line is added, and add the copyright line to the commit. * etc/committer.scm.in (add-copyright-line): New procedure. (main): Check if a copyright line was added and call ‘add-copyright-line’ if necessary. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Xinglu Chen2021-09-211-4/+22
* etc/committer: Pass command-line arguments to main.•••* etc/committer.scm.in: Call main with command line arguments. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Sarah Morgensen2021-08-101-1/+1
* etc/committer: Support custom commit messages.•••Allow custom change commit messages by supplying a commit message and optionally a changelog message as arguments. * etc/committer.scm.in (break-string-with-newlines) (custom-commit-message): New procedures. (main)[change-commit-message*]: New sub-procedure. Use them. (main): Use it. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Sarah Morgensen2021-08-101-6/+49
* etc: committer: Support reading G-expressions.•••Some package definitions use G-expressions (see, e.g., chez-scheme). Import (guix gexp) such that Guile knows how to read those. Otherwise, an exception such as the following might be raised: ERROR: In procedure read: In procedure scm_lreadr: gnu/services/networking.scm:480:16: Unknown # object: #\~ * etc/committer.scm.in: Import (guix gexp). Signed-off-by: Ricardo Wurmus <rekado@elephly.net> Maxime Devos2021-08-071-1/+2
* etc: Break long lines in commit messages.•••* etc/committer.scm.in (break-string): New procedure. (change-commit-message): Use it. Ricardo Wurmus2021-05-041-12/+40
* etc/committer: Add missing newline.•••* etc/committer.scm.in (main): Add newline to message. Signed-off-by: Ricardo Wurmus <rekado@elephly.net> Morgan Smith2021-04-121-1/+1
* etc/committer: Use git plumbing instead of porcelain.•••* etc/committer.scm.in (diff-info): Use "git diff-files" instead of "git diff". (old-sexp): Use "git cat-file" instead of "git show". Signed-off-by: Ricardo Wurmus <rekado@elephly.net> Morgan Smith2021-04-121-4/+4
* etc/committer: Disable diff colors.•••Reported by: morgansmith on IRC. * etc/committer.scm.in (diff-info): Invoke "git diff" with "--no-color". Ricardo Wurmus2021-04-081-0/+1
* etc/committer: Recompute hunks before processing changes.•••* etc/committer.scm.in (main): Re-evaluate diff-info after processing insertions. Ricardo Wurmus2021-04-081-1/+3
* etc/committer: Record minimal context for hunks to avoid problems.•••With zero context new definitions would be applied to the wrong location in the file. More context lines lead to larger hunks, though, so we use just one line of context. * etc/committer.scm.in (diff-info): Invoke "git diff" with one line of context. [info]: Merge line break and first line. (lines-to-first-change): New procedure. (old-sexp, new-sexp): Use it. Ricardo Wurmus2021-04-081-7/+19
* etc/committer: Define delay duration as a variable.•••* etc/committer.scm.in (%delay): New variable. (main): Use it. Ricardo Wurmus2021-04-081-4/+6
* etc/committer: Handle package additions.•••* etc/committer.scm.in (<hunk>)[diff]: Rename this field... [diff-lines]: ...to this. [definition?]: New field. (hunk->patch): Join diff lines. (diff-info): Do not join diff lines; record whether a hunk is a new definition. (commit-message): Rename this procedure... (change-commit-message): ...to this. (add-commit-message): New procedure. (main): Handle new package definitions before changes. Ricardo Wurmus2021-04-081-33/+80
* etc: committer: Use EQUAL? instead of EQ? for differences.•••* etc/committer.scm.in (commit-message): Use EQUAL? instead of EQ? to compute differences because not all inputs may be symbols; some could be expressions. Ricardo Wurmus2020-10-061-2/+2
* etc: Add committer script.•••* etc/committer.scm.in: New file. * configure.ac: Configure it. Ricardo Wurmus2020-06-161-0/+250