This repository is no longer maintained but will remain opened to anyone interested in the code.
GRM : A light git repository manager written in Rust for use in terminal
Available with :
- Bash
- Powershell (work in progress)
- Zsh
USAGE:
grm(.exe) [SUBCOMMAND]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
SUBCOMMANDS:
add Search and add your git repositories for a given path; default path is the current directory
goto Go to the repository directory
help Prints this message or the help of the given subcommand(s)
list List your saved repositories for the given pattern
rm Remove a git repository from the list
Waiting the final installation process, you can use the following steps to install GRM :
Clone the repository and build the project (with cargo or rustc, it's up to you) :
git clone git@github.com:theredfish/git-repo-manager.git
cd git-repo-manager
cargo build --release
mkdir ~/.grm
cd git-repo-manager
# Copy the bash wrapper and the completion file
cp wrapper_scripts/grm.sh ~/.grm
cp completion_scripts/grm.bash-completion.sh ~/.grm
# Copy the binary
cp target/release/grm ~/.grm
mkdir ~/.grm
Copy the powershell wrapper
cp grm.ps1 ~/.grm
# Copy the binary
cp target/release/grm.exe ~/.grm
# Edit your ~/.bashrc or your ~/.bash_aliases with these lines
source ~/.grm/grm.bash-completion.sh
alias grm='source ~/.grm/grm.sh'
# Reload your bashrc
source ~/.bashrc
More information here.
First you need to change your execution policy :
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
Next, create your Windows Powershell profile if doesn't exist :
# Microsoft.PowerShell_profile.ps1 already exists
cd $env:USERPROFILE\Documents
md WindowsPowerShell
cd WindowsPowerShell
New-Item Microsoft.PowerShell_profile.ps1 -ItemType "file"
Then edit Microsoft.PowerShell_profile.ps1
to add your alias :
# You must split args one by one, grm can handle two arguments
function GrmCall {
~/.grm/grm.ps1 $args[0] $args[1]
}
Set-Alias grm GrmCall
Finally source your profile :
. $PROFILE
- Rust 1.37
Install the following dependencies (it may change depending of your distribution):
# OS dependencies
sudo apt-get install libsqlite3-dev
# Diesel CLI with sqlite only
cargo install diesel_cli --no-default-features --features sqlite
Or avoid installing OS dependencies by playing with the bundled libsqlite3-sys in diesel_cli.
TODO
This project is work in progress, here the list of expected features :
- add repositories
- list repositories
- change directory for a given repository name
- remove repository
- refresh repositories (delete dead ones and add new ones)
- list repositories with filters / pattern
- parallelized search
- categorize repositories
- installation script
- automatic migrations
- always make a save of
grm.db
before a migration - if a migration fails, restore the previous version
- grm powershell script wrapper for built-in commands
- grm bash script wrapper for built-in commands
- bash auto-completion
- powershell auto-completion
- zsh auto-completion
- use r2d2 : set of open db connections for repeated use
- implement tui-rs or termion : wait for a Windows implementation (see termion issue "interest in windows port")