NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
11.92k stars 1.46k forks source link

Allow to specify/edit commit message when using `nix flake update --commit-lock-file` #6941

Open NobbZ opened 2 years ago

NobbZ commented 2 years ago

Is your feature request related to a problem? Please describe.

I always have to ammend a commit made by nix flake update --commit-lock-file or create a manual commit to get the message in the shape I want it to have.

Describe the solution you'd like

Instead I'd like to be able to specify flags that allow me to pass a message directly or to open an editor. For scripting AND non scripting purposes implementing both flags would be ideal.

eg.

$ nix flake update --update-lock-file --message "chore: update flake.lock"
# or
$ nix flake update --update-lock-file --edit # opens `EDITOR` (or `GIT_EDITOR`?)

Describe alternatives you've considered

Amending commits or tedious git add; git commit -m … after the update, which on its own can take a while and make me forget the steps while waiting for it.

Gerschtli commented 1 year ago

Have a look at commit-lockfile-summary option in nix.conf or use

nix --option commit-lockfile-summary "chore: update flake.lock" flake update --update-lock-file
NobbZ commented 1 year ago

The option is nice, I was not aware of it.

Still having to go through --option is tedious. A more direct option would be nice, similar to how we also can set --max-jobs directly.

Also that option still does not cover the --edit

joscha commented 2 months ago

Have a look at commit-lockfile-summary option in nix.conf or use

nix --option commit-lockfile-summary "chore: update flake.lock" flake update --update-lock-file

This only worked for me via:

nix --option commit-lockfile-summary "chore: update flake.lock" flake update --commit-lock-file