Releases: amtoine/nu-git-manager
0.8.0
With Nushell 0.92 comes a new release of NGM: version 0.8.0
🥳
fix a prompt bug when outside of a Git repo
PR: #192
previously, going into a non-repo directory would print the following error before every prompt...
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Full Changelog
0.7.0
With Nushell 0.91 comes a new release of NGM: version 0.7.0
🥳
New command to get the version of the installed package
PR: #182
NGM now comes with the new gm version
command that gives a record with information about the current installation of NGM:
gm version
───────┬────────────────────────────────────────
version│0.6.0+4
branch │main
commit │0617648aa1133be093cba825487aec938f899cf7
date │2024-03-06 22:54:59
───────┴────────────────────────────────────────
More completion support
PR: #186
The gm repo compare
now ships with completion support for the two Git branches parameters.
Full Changelog
0.6.0
With Nushell 0.90 comes a new release of NGM: version 0.6.0
🥳
New command to bisect repositories
The nu-git-manager-sugar
module now ships a new gm repo bisect
command.
The idea is that: when you have to bisect a Git repo and the compilation is long and you have a simple piece of code that can tell you right away if the current revision is good or bad, then it's pretty tideous to do it by hand...
This is why i wrote gm repo bisect
: you give it a closure that will give a non-zero exit-code for any bad revision, a first known good revision and a first known bad one and the command will run on its own and give you the first bad revision without any further intervention!
Documentation
The documentation now features a few new niceties:
- the commands link to their first line in the source code, e.g. here
- the command parameters should be a bit prettier now, e.g. here as compared to there
- the modules now have a proper documentation, e.g. here
Contributing
PR: #167
i have added a simple CONTRIBUTING.md
document...
just in case...
New module to interact with dotfiles
PR: #177
This new release of NGM ships a new sugar module called dotfiles
.
This module ships two new commands to interact with dotfiles managed manually through a bare repository:
gm cfg
: a thin wrapper around the Git command, e.g. you can do things likegm cfg status --short
orgm cfg log --graph --oneline
and it will run the same commands as in a normal repository but with your setup bare repo of dotfiles.gm cfg edit
: a command to list all the tracked dotfiles and open one of them in the$env.EDITOR
.
Full Changelog
- 28f1fa2 add
gm repo bisect
(#158) - 5044035 fix the table of content (#161)
- 625dc10 fix the Nushell version in the README (#162)
- 1f4153d fix spreading of arguments to externals in toolkit (#163)
- 60f6b86 link to the source of each command in the doc (#166)
- 99a5ef9 add contributing document (#167)
- d1ecc77 checkout back when good or bad are invalid in
gm repo bisect
(#165) - b11f787 define a Nupm workspace (#168)
- c1016e9 make the command parameters in the documentation pretty (#169)
- dad619b add log statements to
toolkit doc
(#170) - 67ecfaf add documentation to the modules (#171)
- 72a7920 update link to
tmux-sessionizer
in the README (#174) - 0e2538f add a new
dotfiles
module tosugar
withgm cfg
commands (#177) - 567ff2b (origin/main, origin/HEAD, main) give an error when removing a repo the user is in (#180)
0.5.0
With Nushell 0.89 comes a new release of NGM: version 0.5.0
🥳
A new segment to the Git prompt: changes
PR: #133
The Git prompt of NGM now features a new "changes" segment. When there are changes to the local index, they will show up just after the "branch" segment inside [ ... ]
.
There are three symbols:
?
which means there are 1 or more untracked changes!
which means there are 1 or more unstaged changes_
which means there are 1 or more staged changes, ready to be commited
Brand new static documentation
PR: #128
NGM now ships a static documentation that is automatically generated from command and module documentation written in Markdown.
This should hopefully help users have a look at all NGM has to offer without installing anything of running help
manually :)
New command: gm repo query
PR: #127
A new command has appeared!!
gm repo query
is a new sweet command that uses a slightly modified version of nu_plugin_query
written by @fdncred.
it allows to query the Git .git/
directory as a database and wraps the plugin to return nice tables.
New completion: gm repo fetch branch
PR: #138
Completion has been added to the sweet gm repo fetch branch
command.
A fresh module structure
With recent changes to the module system of Nushell and how it's used by Nupm, NGM had to adapt completely.
In a nutshell, NGM
- uses
nupm.nuon
instead ofpackage.nuon
as before - manually exports internal modules to make them public
For the interested readers, below are the directory structures of the nu-git-manager
and nu-git-manager-sugar
modules in 0.4.0
vs now in 0.5.0
:
src
├── nu-git-manager
│ ├── completions
│ │ └── nu-complete.nu
│ ├── error
│ │ └── error.nu
│ ├── fs
│ │ ├── cache.nu
│ │ ├── dir.nu
│ │ ├── path.nu
│ │ └── store.nu
│ ├── git
│ │ ├── repo.nu
│ │ └── url.nu
│ └── mod.nu
└── nu-git-manager-sugar
├── extra.nu
├── git
│ ├── lib
│ │ ├── lib.nu
│ │ ├── prompt.nu
│ │ └── style.nu
│ ├── mod.nu
│ └── prompt.nu
├── github.nu
└── mod.nu
pkgs/
├── nu-git-manager
│ ├── nu-git-manager
│ │ ├── completions.nu
│ │ ├── error.nu
│ │ ├── fs
│ │ │ ├── cache.nu
│ │ │ ├── dir.nu
│ │ │ ├── mod.nu
│ │ │ ├── path.nu
│ │ │ └── store.nu
│ │ ├── git
│ │ │ ├── mod.nu
│ │ │ ├── repo.nu
│ │ │ └── url.nu
│ │ └── mod.nu
│ ├── nupm.nuon
│ └── tests
│ ├── gm.nu
│ └── mod.nu
└── nu-git-manager-sugar
├── nu-git-manager-sugar
│ ├── completions.nu
│ ├── extra.nu
│ ├── git
│ │ ├── lib
│ │ │ ├── git.nu
│ │ │ ├── mod.nu
│ │ │ ├── prompt.nu
│ │ │ └── style.nu
│ │ ├── mod.nu
│ │ └── prompt.nu
│ ├── github.nu
│ └── mod.nu
├── nupm.nuon
└── tests
├── git.nu
└── mod.nu
Full Changelog
- b333280 test the Git prompt (#122)
- 2dc21d5 add a "Git changes" segment to the prompt (#133)
- 1a9c0d9 generate and check documentation (#128)
- 0c17038 add
gm repo query
(#127) - 3c67d27 fix the documentation (#137)
- 0e54f60 add completions to
gm repo fetch branch
(#138) - 9118490 use
github.base_ref
to get the target branch in the CI (#139) - 6d2d176 use the toolkit in the CI (#135)
- 529ff39 bump Nushell and Nupm (#140)
- 96bb3a7 rename
package.nuon
tonupm.nuon
(#141) - 1262909 fix the export of modules (#134)
- 2d0e2c0 fix CI (#142)
- dcb5140 thanks Bash (missing quotes in boolean tests for undefined variables) (#143)
- d31ed97 fix the workflow dispatch to run tests (#144)
- 5c173bb bump
amtoine/setup-nupm-action
to 0.2.0 (#145) - 9555b25 remove quotes from
NU_VERSION
andNUPM_REVISION
(#146) - 8dd94f3 fix module exports (#147)
- cb591b8 refactor internal modules (#149)
- d7f3141 check the documentation in PRs against
nightly
(#150) - 3afdf90 dispatch the documentation CI (#152)
- 0d45894 return nothing from
test
/install
in toolkit (#153) - 3d970c5 remove deprecated
--switch: bool
(#154) - 937f4a8 fix
gm repo branches clean
when HEAD is detached (#155) - 471c7fb fix spreading of arguments to externals (#156)
- 8b01fff fix nightly types (#160)
- ba3a88d bump to 0.5.0 (#159)
0.4.0
With Nushell 0.88 comes a new release of NGM: version 0.4.0
🥳
Brand new sugar
- the
nu-git-manager-sugar extra
module: defines extensions to the maingm
command shipped in
nu-git-manager
gm report
- the
nu-git-manager-sugar git
module: defines thegm repo
command which contains a bunch of
helpers to interact with a single repository, e.g. listing branches, fetching remotes, ...gm repo branch interactive-delete
gm repo branch wipe
gm repo branches
gm repo compare
gm repo fetch branch
gm repo get commit
gm repo goto root
gm repo is-ancestor
gm repo ls
gm repo remote list
gm repo switch
Note
thegit
submodule also defines and exports theprompt setup
command, see the next section for
details about the Git prompt of NGM
- the
nu-git-manager-sugar github
module: defines thegm gh
command which is a wrapper around
thegh
tool of GitHub, e.g. fuzzy-checkout a PR and query the GitHub APIgm gh pr checkout
gm gh query-api
gm gh query-releases
gm gh query-user
Adding a new Git prompt
PR: #119
This new release of NGM comes with a pretty cool addition: a Git prompt!
This prompt is part of the nu-git-manager-sugar git
module and can be used as follows:
use nu-git-manager-sugar git prompt setup
setup --duration-threshold 10sec --indicators {
vi: {
insert: "> "
normal: "> "
}
}
Below are some examples of what the prompt might look like:
Note
the example above also shows how the prompt looks when the last command exceeded the
--duration-threshold
and when the last exit code is not equal to 0
- let's go inside a Git repository, e.g.
nu-git-manager/
- the prompt looks similar when checking out another branch
- the style changes when the HEAD is detached...
- ... or when the checked out revision is a tag
- being in the middle of a Git action such as a rebase will be shown as well
- and finally, going into a subdirectory will show it as dimmed
Some improvements in the dev department
For devs wanting to get involved and people wanting to try out the modules, the following options
and switches have been added to the run
command of the toolkit.nu
module:
--interactive
: opens an interactive REPL to run commands manually and play with thegm
commands--sugar
: allows to specify a list of extra sugar modules to use in therun
environment--personal
: runsgm
commands or the REPL with the real store of repositories (might be
dangerous if the commands are not ready)
Full changelog
- 96800e8 use external action to merge branches (#99)
- 638e05d use external action to setup Nupm (#98)
- 25b7c03 refactor the test dir setup in
tests/common/setup.nu
(#103) - bbd2a9e use
generate
instead ofunfold
(#102) - 7d30c11 refactor duplicate root stripping (#100)
- b9a2786 use
^git
instead ofgit
(#105) - c3ad086 clean sugar git (#104)
- a3ca2a1 add a few examples to
nu-git-manager-sugar git
commands (#107) - 803915f use
nupm install --no-confirm
intests install-package
(#108) - 8ebdc1b collect the output of
git rev-parse
(#109) - 5463513 clean sugar
github
(#31) - 72f2b03 fix
gm gh pr checkout
: user quit and no PR (#111) - 30064ba add some sugar (#30)
- e91ba6a add a new
--interactive
switch totoolkit.nu run
(#112) - 96c468a more granular and complete user import tests (#113)
- 6efdd44 add type annotations to
toolkit.nu
and fix a bug (#114) - 8cc131e add
get-ignored-tests
totoolkit.nu
(#115) - efbd878 better live environment in the toolkit (#117)
- f34e550 format (#118)
- 4ad4958 add
git-prompt
module (#119) - ad37e5b remove the
gist
module fromsugar
(#120) - 9359ac6 refactor
git
andgit-prompt
modules insugar
to allow testing (#121) - 1a23238 fix export use in the tests (#123)
- e28d9cd REFACTOR (#125)
- f91b743 test imports exactly (#126)
- ea478a9 trim PR title when too large for terminal in
gm gh pr checkout
(#129) - adca8cb fix
gm repo branches
failing on checked out branch (#131) - c2242b4 add
--personal
torun
intoolkit.nu
(#132) - dddc16d bump to 0.4.0 (#136)
0.3.0
With Nushell 0.87.0 comes a new release of nu-git-manager
: version 0.3.0
🥳
Architecture of the project
With the newest advancements on Nupm, we have decided to refactor a bit the structure of the package!
From now on and with #50, nu-git-manager
will be split into two modules:
nu-git-manager
: the main module containing the coregm
commandsnu-git-manager-sugar
: the extra commands thatnu-git-manager
ships
Note
Nupm will still install both modules when runningnupm install --path --force nu-git-managerwhat changes really is the granularity of the imports that can be performed: see usage
Introducing a new nightly channel
Because Nushell is a fast moving target, we wanted to be able to use nu-git-manager
with both the
latest stable release, e.g. 0.87.0, and the latest revisions, i.e. when building from source or using
the nightly builds of Nushell.
#82 introduces a new nightly
branch to the project 🥳
main
will be focused on the current latest stable releasenightly
will contain new features and fixes that are only available on the nightly builds of
Nushell
Before installing nu-git-manager
, you just have to git checkout
the main
or the nightly
branch
and you'll be good to go.
Detecting and squashing forks
When cloning forks, i.e. repos that share the same root commit, nu-git-manager
and in particular
gm clone
won't check for that forking property and clone the repos in separate directories.
This is mostly fine but it would be great to have gm clone
detect these cases and a command to
squash forks together, leaving a single repo with multiple remotes, right? 😏
#63 adds precisely that in this new release 🚀
First, gm clone
will warn you if you just cloned a fork of another locally managed repo.
Note
gm clone
will still clone the repo and won't perform any squashing of forks
Then, a new gm squash-forks
command has been added to actually perform the squash of detected
forks interactively.
"gm squash-forks" [ --non-interactive-preselect: record = {} ]: nothing -> nothing
Cleaning the store after removing projects
When gm remove
is called, the directory of one project is removed.
This can cause an issue and leave a dirty store when the parent directory is empty, e.g. when the
GitHub user did not have any other repo cloned locally, because gm remove
did not clean these
empty directory.
In this release, #77 adds a new command that will take care of listing the empty directories in the
store and remove them and their empty parents recursively until the store is clean again.
"gm clean" [ --list ]: nothing -> list<path>
Note
gm remove
will invoke the same cleaning step for you,gm clean
is here if you manage some
part of the store manually- empty directories that are inside repos managed by
nu-git-manager
won't be removed
Cloning big repositories
A new option has been added to the gm clone
command in #49. Big repositories can be cloned at a certain smaller depth with --depth: int
. This option is a strictly positive integer and, when set, gm clone
will clone only the last $depth
commit and graft the most recent one:
gm clone https://github.com/neovim/neovim --depth 1
Configuring nu-git-manager
With #39, the location of the cache of the store of repositories can now be configured via the $env.GIT_REPOS_CACHE
environment variable.
Supporting more hosts
Suckless software is now supporter as a host thanks to #34 and the git
protocol, e.g.
gm clone https://git.suckless.org/st/log.html --fetch git --push git
Tests
Thanks to #48, all the gm
commands are now tested 👍
This should help catch bugs in the public API of the nu-git-manager
module.
Full changelog
- 8feef80 feat: read cache from env (#39)
- 852502f remove debug prints (#41)
- 6f29aa8 add a "bug report" issue template (#42)
- 5d30fba support Suckless as a host (#34)
- f9464f3 extract cache logic out of
gm
itself (#44) - ce0f9c3 add a starter toolkit to run the tests (#47)
- 58b9217 fix the config snippet in the README (#46)
- b361bf4 use the latest stable version of Nushell in the CI (#37)
- 8aec003 add
--depth: int
togm clone
(#49) - 2a2dfc0 split the package into two modules (#50)
- 225380a fix the TOC in the README (#51)
- cf23585 clone the Nupm repo with a single depth (#54)
- 32f6c61 add a feature request template (#55)
- 0375379 fix the feature request template (#56)
- 33ffb98 chore: test the nupm installation (#53)
- 757cd06 add missing tests (#59)
- 4935705 add internal documentation (#58)
- a360ea9 refactor the
error make
s inerror/error.nu
(#60) - 8504306 use
^git
in the tests (#64) - 4af2634 add expected
assert error
to the tests (#67) - 0ba1c02 ci: show the stdout of the tests (#65)
- 0a7e901 test
gm
commands end to end (#48) - d9caab8 add install command to the toolkit (#72)
- a4f06f5 add run command to toolkit (#73)
- 45ebe0a update the
gm
examples (#74) - 938fddb refactor: move completions to their own module (#75)
- ea557bb allow to filter tests in
toolkit test
(#79) - 390d25d feat: setup nightly flow (#82)
- e4d9e33 trigger the CI (empty) (#86)
- a127fe7 show the Git config and the worktree in the sync CI (#87)
- 88d508e fix sync CI by cloning the repo (#88)
- 805867a push with SSH (#89)
- 4c00a45 fix sync CI by giving SSH token to
actions/checkout
(#90) - 60361d5 ci: explicit permissions (#91)
- 3be66db ci: fix permissions issues (#92)
- 69618bd fix: do not allow invalid user-package import in the tests (#84)
- b946cab fix: use def --env
- 3524ec5 check if output of
input list
isnull
(#62) - 0ce47bb fix
$.span
inerror make
(#61) - ab9fdc6 add a command to clean the store from empty directories (#77)
- cedd3d2 use
glob --exclude
instead ofglob --not
(#38) - 137dbfa allow to merge forks (#63)
- 0406711 mention the nightly branch in the readme (#94)
- 3fb5c89 bump the version to 0.3.0 (#95)
0.2.0
this release comes with a full rewrite and simplification of the package 🥳
changelog
- some sugar such as the Git completions have been removed
- the API of
gm
has changedgm
is now a command and not a module- see the full command API below
- tests and a CI have been added thanks to Nupm
gm
command API
"gm" []: nothing -> nothing
"gm clone"
url: string
--remote: string = "origin"
--ssh
--fetch: string
--push: string
--bare
]: nothing -> nothing
"gm list" [
--full-path
]: nothing -> list<path>
"gm status" []: nothing -> record<root: record<path: path, exists: bool>, missing: list<path>, cache: record<path: path, exists: bool>, should_update_cache: bool>
"gm update-cache" []: nothing -> nothing
"gm remove" [
pattern?: string
--fuzzy
]: nothing -> nothing
0.1.0
The first release of nu-git-manager
! 🥳
please have a look at the README
for a tour of the library 😌
the currently available commands and items
- the main
gm
module - the
sugar
extra modulegit
custom commandsgh
commands around the GitHub CLI- completions for
git
insugar completions git
- more sweet commands