Releases: ejpcmac/git-z
Release list
0.2.4
Highlights
Adaptation to the size of the terminal
Before this version, selection prompts had a fixed size of 15 elements, regardless of the size of the terminal. This was a bit annoying in small terminals, as the rendering was likely to break.
Selection prompts now adapt their page size to the size of the terminal.
Experimental support for other VCS
This release introduces two new command line options to git z commit:
--topic <TOPIC>allows to set the topic from which a ticket number is extracted, instead of the current Git branch,--command <COMMAND>enables to use a custom command instead ofgit commit -em "$message".
The <COMMAND> argument value should contain a $message variable, which is replaced by git z commit to the actual commit message.
These options can be used to integrate git-z with other VCS such as Jujutsu. For instance, we can define a jj-z-describe shell function like this:
jj-z-describe() {
# First, get the closest bookmarks on top of which we are working.
local bookmarks="$(
jj log --no-graph -r 'heads(::@ & bookmarks())' -T 'self.bookmarks()'
)"
# Then, call `git z commit` with the `--topic` and `--command` options. Note
# that we are piping the message through `sed` to change any `#` Git comment
# marker to `JJ:`.
git z commit \
--topic "$bookmarks" \
--command "sh -c \"\
echo -n '\$message' \
| sed 's/^#\(.*\)/JJ:\1/' \
| jj describe $@ --edit --stdin\" \
"
}Please note that this support is experimental, and that git-z still has to be run from inside a Git repository. For using with Jujutsu, the repository must be configured in colocated mode.
Added
- [
git z commit] Add a--topic <TOPIC>option to pass the name of the current topic via the command line (#56). - [
git z commit] Add a--command <COMMAND>option to pass a custom command to call instead ofgit commit -em "$message"(#56).
Changed
- [
git z commit] Adapt the size of the page in selection prompts to the size of the terminal (#45). - [
git z commit] Ensure there are no more than two consecutive newlines in commit messages. - [Cargo] Update the dependencies.
- [Rust] Update from 1.84.1 to 1.86.0.
0.2.3
0.2.2
0.2.1
Added
- [
git z commit] Ask whether to reuse the previous answers or commit message when the operation has been aborted or has failed. - [CLI] Add a new global
-v...flag to control the log verbosity. By default, no logs are emitted. - [CLI] Add tracing logs in all layers.
- (unstable) [
git z commit] When compiling with theunstable-pre-commitfeature enabled, run thepre-commithook before the wizard if it exists. A new-n|--no-verifyoption is added to prevent the hook from running.
Changed
- [
git z commit] Use fuzzy-finding when selecting types and scopes. - [
git z commit] Pass the extra arguments togit commitbefore-em <message>. - [CLI] Provide more information in
git z --version. - [CLI] Use standard exit codes as defined in
sysexits.h. - [Config] Enhance the descriptions for the default types.
- [Config] Align error messages between the config and the updater.
- [Cargo] Update the dependencies.
- [Rust] Update from 1.74.1 to 1.81.0.
- (unstable) [
git z commit] When compiling with theunstable-pre-commitfeature enabled, passes--no-verifytogit commit. This is to avoid running thepre-commithook twice, but this also disables thecommit-msghook as an unwanted side-effect.
Removed
- [
git z update] Remove support for updating from0.2-dev.*versions. - [Config] Remove support for
0.2-dev.*versions.
Fixed
- [
git z commit] Use the proper configuration name in hints. - [Updater] Properly update the documentation for scopes. Previously, it was not updating the documentation above the
scopestable, keeping the one form version 0.1.
0.2.0
Highlights
New configuration format
The git-z.toml format has been updated to version 0.2 to provide a much better configurability. It is now possible to:
- allow scopes to be arbitrary, instead of a list;
- allow the ticket reference to be optional, or even not asked for;
After updating git-z, to update your git-z.toml to the new configuration format, you can run:
git z update
git-z 0.2.0 is still compatible with previous configurations, keeping their semantics. However, previous version of git-z cannot run with a configuration version 0.2.
Working in any repository
The default configuration without a git-z.toml has been updated to be much more sensible. You can then run git z commit without a configuration file and still get something usable.
In addition, a new git z init command has been added to create a git-z.toml in the current repository.
Added
- [
git z init] Add a command to create agit-z.tomlin the current repository. - [
git z update] Add a command to update the configuration file without loosing comments and formatting. - [Config] Add a
ticket.requiredfield: when set totrue, the ticket is required as in previous versions. When set tofalse, the ticket is still asked for but optional.
Changed
- BREAKING [Config] Update the configuration format to allow for more options.
- BREAKING [Config] Make the
ticketkey optional: when the ticket configuration is not present, no ticket will be asked for. - BREAKING [Config] Allow scopes to be arbitrary.
- BREAKING [CLI] Print errors, warnings and hints on
stderr. - [Config] Make the default configuration more sensible. It now has much more built-in types, accepts an optional arbitrary scope, and no ticket.
- [CLI] Print better messages for many usage errors.
- [CLI] Do not print an error on cancelled / interrupted operations.
- [
git z commit] Do not print an error ongit commitfailure. - [
git z commit] Check the commit template early and pretty-print any error mesasge. - [
git z commit] Consider#as a special ticket prefix: when matching in the branch name,#is omitted from the match so that branches likefeature/23-nameare valid, and#is then added to the matching ticket number. In this example it would extract#23as ticket number from the branch name. - [
git z commit] Enhance a bit the error message when failing to build a regex from the list of prefixes. - [Cargo] Exclude unneeded files from the package.
- [Cargo] Update the dependencies.
- [Rust] Update from 1.74.0 to 1.74.1.
Fixed
- [Config] Check the version before trying to parse using the latest configuration format. Previously, the configuration was parsed, then its
versionfield was checked. This led to parsing errors instead of reporting an out of date configuration.
0.1.0
Added
- Initial version, featuring:
git z commit, a wizard that helps to buid a commit message by asking:- a type,
- a optional scope,
- a commit message (5-50 characters),
- an optional breaking change,
- a ticket number, pre-filled from the branch name;
- a
git-z.tomlfile at the root of the current Git repository allowing to configure:- the valid commit types,
- the valid scopes,
- the valid ticket prefixes,
- the commit template.