Nix (home-manager) configurations for my computers
jj: Add "author" alias command
Jujutsu records incorrect author date—timestamp at when a commit became
non-empty. As there is no options to update author date on changes,
created a command to manually set current datetime to author date.
This problem was recognized in JJ issue tracker and a PR
<https://github.com./jj-vcs/jj/pull/3906> was created. However, the
direction went from "reset author on configurable revset" to "fix author
date on non-empty commit" due to simplicity concern.
An option for author reset revset option may or may not come in a
future, but hoping someone to tackle the problem is not a wise choice.
Alias is hacky and future JJ updates may conflict or break it. But this
incorrect author date is a real problem I have now, so, better than
nothing.
git = {
private-commits = "description(regex:'\\[WIP\\]')";
};
++ aliases = {
+ # JJ by default sets incorrect author date (when "a work started" instead of "authored",)
+ # because how it works internally (updating a git commit.) This command is to workaround
+ # that design flaw by manually mark author date, like "git commit".
+ author = [ "desc" "--no-edit" "--reset-author" ];
+ au = [ "author" ];
+ };
};
};