Skip to content

nickgerace/gfold

main
Switch branches/tags
Code

Latest commit

206: Switch to cargo workspace r=nickgerace a=nickgerace

Primary:
- Switch to cargo workspace to replace xtask, make, etc.
- Add debug symbol stripping

Misc:
- Upgrade all packages
- Replace entries iterator with "next" due to the following PR:
  rust-lang/git2-rs#854
- Remove "rustfmt.toml"

Fixes #207

Co-authored-by: Nick Gerace <nickagerace@gmail.com>
9f27d8b

Git stats

Files

Permalink
Failed to load latest commit information.

gfold

latest release tag crates.io version license build status bors enabled

gfold is a CLI-driven application that helps you keep track of multiple Git repositories.

% gfold
astrid ~ /home/neloth/src/astrid
  unclean (main)
  git@github.com:db/astrid.git
  neloth@housetelvanni.dev
fev ~ /home/neloth/src/fev
  bare (issue2277)
  none
  neloth@housetelvanni.dev
gb ~ /home/neloth/src/gb
  unpushed (dev)
  https://github.com/hrothgar/gb.git
  neloth@housetelvanni.dev
pam ~ /home/neloth/src/pam
  clean (main)
  https://github.com/onc/pam.git
  neloth@solstheimcommunityserver.org

Want the classic display mode? Use -d classic.

% gfold -d classic
another-day     unclean   main     git@github.com:motm3/another-day.git
beautiful-trip  bare      dev      none
damaged         unpushed  dev      https://github.com/motm3/damaged.git
dive            unclean   patch    git@github.com:motm3/dive.git
solo-dolo       clean     main     https://github.com/motm3/solo-dolo.git
tpm             clean     issue15  git@github.com:motm3/the-pale-moonlight.git

If you'd prefer to use the classic display mode by default, and avoid setting the flag every time, you can set it in the config file (see Usage section).

Description

This app displays relevant information for multiple Git repositories in one to many directories. While this tool might seem limited in scope and purpose, that is by design.

By default, gfold looks at every Git repository via traversal from the current working directory. If you would like to target another directory, you can pass its path (relative or absolute) as the first argument or change the default path in the config file.

After traversal, gfold leverages rayon to perform concurrent, read-only analysis of all Git repositories detected. Analysis is performed by leveraging the git2-rs library.

Usage

Pass in --help flag to see all the options for using this application.

gfold
gfold ..
gfold $HOME
gfold ~/
gfold /this/is/an/absolute/path
gfold ../../this/is/a/relative/path

Config File

Upon execution, gfold will look for a config file at the following path on macOS, Linux and similar operating systems:

$HOME/.config/gfold.toml

On Windows, the lookup path will be in a similar location.

{FOLDERID_Profile}\.config\gfold.toml

Creating and using the config file is entirely optional.

For config file creation, you can use the --dry-run flag to print valid TOML. Here is an example config file creation workflow on macOS, Linux and similar platforms:

gfold -d classic -c never ~/ --dry-run > $HOME/.config/gfold.toml

Here are the contents of the resulting config file:

path = '/home/neloth'
display_mode = 'Classic'
color_mode = 'Never'

Let's say you created a config file, but wanted to execute gfold with entirely different settings and you want to ensure that you do not accidentally inherit options from the config file. In that scenario you can ignore your config file by using the -i flag.

gfold -i

You can restore the config file to its defaults by using the same flag.

gfold -i > $HOME/.config/gfold.toml

In addition, you can ignore the existing config file, configure specific options, and use defaults for unspecified options all at once. Here is an example where we want to use the classic display mode and override all other settings with their default values:

gfold -i -d classic > $HOME/.config/gfold.toml

You can back up a config file and track its history with git. On macOS, Linux, and most systems, you can link the file back to a git repository.

ln -s path/to/repository/gfold.toml $HOME/.config/gfold.toml

Now, you can update the config file within your repository and include the linking as part of your environment setup workflow.

Installation

Packaging status

Homebrew Install (macOS only)

You can use Homebrew to install the tap.

brew install nickgerace/nickgerace/gfold

Note: the tap may not work with Linuxbrew.

Arch Linux

arch linux

You can use pacman to install gfold from the community repository.

pacman -S gfold

Nix and NixOS

You can install gfold from nixpkgs:

nix-env --install gfold

Cargo Install

You can use cargo to install the crate on almost any platform.

cargo install gfold

Keeping the crate up to date is easy with cargo-update.

cargo install cargo-update
cargo install-update -a

Download a Binary

If you do not want to use one of the above installation methods and do not want to clone the repository, you can download a binary from the releases page. For an example on how to do that, refer to the manual install guide.

Build From Source

If you would like an example on how to build from source, refer to the manual install guide.

Preferred Installation Method Not Listed?

Please file an issue!

Compatibility

gfold is intended to be ran on any tier one Rust 🦀 target. Please file an issue if your platform is unsupported.

Troubleshooting

If you encounter unexpected behavior or a bug, please file an issue and debug locally with RUST_BACKTRACE=1 RUST_LOG=debug prepended when executing gfold. You can also adjust each variable, as needed, to aid investigation. Please attach relevant logs from execution with sensitive bits redacted in order to help resolve your issue.

Coreutils Collision on macOS

If fold from GNU Coreutils is installed on macOS via brew, it will be named gfold. You can avoid this collision with shell aliases, shell functions, and/or PATH changes. Here is an example with the o dropped from gfold:

alias gfld=$HOME/.cargo/bin/gfold

Community

For more information and thanks to contributors, users, and the "community" at large, please refer to the THANKS file.

Name Type Description
Arch Linux community repository packaging the gfold package (note: before moving to the community repository, the AUR was previously used for distribution)
"One Hundred Rust Binaries" article featured gfold
nixpkgs packaging the gfold package
nvim-gfold.lua project a neovim plugin for gfold (announcement Reddit post)