Skip to content

Releases: amtoine/nu-git-manager

0.8.0

12 Apr 16:45
0.8.0
b0d7195
Compare
Choose a tag to compare

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

  • 9dfcc83 make sure Git does not give an error in the prompt (#192)

0.7.0

06 Mar 22:06
0.7.0
c44b7c2
Compare
Choose a tag to compare

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

07 Feb 21:52
0.6.0
763f769
Compare
Choose a tag to compare

With Nushell 0.90 comes a new release of NGM: version 0.6.0 🥳

New command to bisect repositories

PR: #158 | #165

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

PRs: #166 | #169 | #171

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 like gm cfg status --short or gm 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 to sugar with gm cfg commands (#177)
  • 567ff2b (origin/main, origin/HEAD, main) give an error when removing a repo the user is in (#180)

0.5.0

21 Jan 08:58
0.5.0
ba3a88d
Compare
Choose a tag to compare

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

PRs: #141 | #134 | #147 | #149

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 of package.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

0.4.0

13 Dec 15:53
0.4.0
dddc16d
Compare
Choose a tag to compare

With Nushell 0.88 comes a new release of NGM: version 0.4.0 🥳

Brand new sugar

PRs: #104 | #30 | #120

  • the nu-git-manager-sugar extra module: defines extensions to the main gm command shipped in
    nu-git-manager
    • gm report
  • the nu-git-manager-sugar git module: defines the gm 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
the git submodule also defines and exports the prompt setup command, see the next section for
details about the Git prompt of NGM

  • the nu-git-manager-sugar github module: defines the gm gh command which is a wrapper around
    the gh tool of GitHub, e.g. fuzzy-checkout a PR and query the GitHub API
    • gm 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:

  • let's start from outside a Git repository, the prompt will show the full path
    ngm-prompt-non-git

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/
    ngm-prompt-git
  • the prompt looks similar when checking out another branch
    ngm-prompt-git-branch
  • the style changes when the HEAD is detached...
    ngm-prompt-git-headless
  • ... or when the checked out revision is a tag
    ngm-prompt-git-tag
  • being in the middle of a Git action such as a rebase will be shown as well
    ngm-prompt-git-action
  • and finally, going into a subdirectory will show it as dimmed
    ngm-prompt-git-subdir

Some improvements in the dev department

PRs: #112 | #117 | #132

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 the gm
    commands
  • --sugar: allows to specify a list of extra sugar modules to use in the run environment
  • --personal: runs gm commands or the REPL with the real store of repositories (might be
    dangerous if the commands are not ready)

Full changelog

0.3.0

18 Nov 12:50
0.3.0
3fb5c89
Compare
Choose a tag to compare

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 core gm commands
  • nu-git-manager-sugar: the extra commands that nu-git-manager ships

Note
Nupm will still install both modules when running

nupm install --path --force nu-git-manager

what 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 release
  • nightly 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

  1. gm remove will invoke the same cleaning step for you, gm clean is here if you manage some
    part of the store manually
  2. 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

0.2.0

25 Oct 15:02
0.2.0
2409fa4
Compare
Choose a tag to compare

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 changed
    • gm 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

16 May 17:55
0.1.0
15bfa9d
Compare
Choose a tag to compare

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 module
    • git custom commands
    • gh commands around the GitHub CLI
    • completions for git in sugar completions git
    • more sweet commands