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

Overview

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)
  [email protected]:db/astrid.git
  [email protected]
fev ~ /home/neloth/src/fev
  bare (issue2277)
  none
  [email protected]
gb ~ /home/neloth/src/gb
  unpushed (dev)
  https://github.com/hrothgar/gb.git
  [email protected]
pam ~ /home/neloth/src/pam
  clean (main)
  https://github.com/onc/pam.git
  [email protected]

Want the classic display mode? Use -d classic.

% gfold -d classic
another-day     unclean   main     [email protected]:motm3/another-day.git
beautiful-trip  bare      dev      none
damaged         unpushed  dev      https://github.com/motm3/damaged.git
dive            unclean   patch    [email protected]:motm3/dive.git
solo-dolo       clean     main     https://github.com/motm3/solo-dolo.git
tpm             clean     issue15  [email protected]: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.

Downloading and Installing the Binary

If you would prefer to use a convenience script over downloading directly from the aforementioned releases page, we have one! You can execute the installation helper script on a compatible system with bash installed (e.g. macOS and Linux).

curl -s https://raw.githubusercontent.com/nickgerace/gfold/main/scripts/install.sh | bash

Note: the installation convenience script does not verify the binary with a checksum. Discretion is advised, including downloading and reading the script before execution.

Uninstalling the Downloaded Binary

To uninstall gfold fully after using the above installation method, execute the following script:

curl -s https://raw.githubusercontent.com/nickgerace/gfold/main/scripts/uninstall.sh | bash

The uninstall script can also be used for cleanup in the event of a failed install.

Build From Source Locally

If you want to install from source locally, and not from crates.io, you can clone the repository and build gfold.

(
    git clone https://github.com/nickgerace/gfold.git
    cargo install --locked --path gfold
)

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)
Comments
  • Error: no reference found for shorthand 'origin/HEAD'

    Error: no reference found for shorthand 'origin/HEAD'

    After updating to 4.0 recently I started experiencing this issue.

    Error: no reference found for shorthand 'origin/HEAD'; class=Reference (4); code=NotFound (-3)

    image

    Downgrading back to 3.0 doesn't show the same issue image

    I saw there was a PR for a similar issue that was merged in quite some time ago. Did that not make it into the new release?

    opened by BerkeleyTrue 8
  • There are no results to display

    There are no results to display

    Describe the issue.

    It's weird, I don't seem to see any results. with strace I see that some git files are read.

    ~/dev
    ❯ gfold
    There are no results to display.
    

    gfold 0.8.0

    Is this a bug report, feature request, or another type of issue?

    bug

    Are you using Windows, macOS, Linux, or another OS?

    Linux

    Are you using a pre-built binary? If not, how did you obtain gfold?

    cargo install gfold

    opened by bbigras 8
  • Arch Linux (AUR) Packages

    Arch Linux (AUR) Packages

    Hi, I came across your project and I liked it. It looks promising for sure. 🚀 I'm also a Rust developer and I maintain AUR packages in my spare time. So I created the following packages for the installation of gfold on Arch Linux and other distributions that support installing packages from AUR:

    Installation can be made simply by a AUR helper such as yay. (e.g: yay -S gfold)

    Feel free to update your documentation regarding to the AUR packages and installation. (I would propose a PR if requested)

    Take care, orhun.

    opened by orhun 8
  • brew upgrade fails for 4.0.0

    brew upgrade fails for 4.0.0

    Upgrading fails via brew on macOS 12.13.1 (M1)

    $ cargo --version
    cargo 1.59.0
    
    $ brew upgrade
    ==> Upgrading 1 outdated package:
    nickgerace/nickgerace/gfold 3.0.0 -> 4.0.0
    ==> Downloading https://github.com/nickgerace/gfold/archive/refs/tags/4.0.0.tar.gz
    Already downloaded: /Users/madeyoulook/Library/Caches/Homebrew/downloads/6cce67192febbafd684b46630662298e7cb5606c2eee8968621c887d340fbf78--gfold-4.0.0.tar.gz
    ==> Upgrading nickgerace/nickgerace/gfold
      3.0.0 -> 4.0.0
    
    ==> cargo install
    Last 15 lines from /Users/madeyoulook/Library/Logs/Homebrew/gfold/01.cargo:
    cargo
    install
    --locked
    --root
    /opt/homebrew/Cellar/gfold/4.0.0
    --path
    .
    
      Installing gfold v4.0.0 (/private/tmp/gfold-20220511-36324-uas33a/gfold-4.0.0)
        Updating crates.io index
    error: failed to select a version for the requirement `libgit2-sys = "^0.13.3"`
    candidate versions found which didn't match: 0.13.2+1.4.2, 0.13.1+1.4.2, 0.13.0+1.4.1, ...
    location searched: crates.io index
    required by package `git2 v0.14.3`
        ... which satisfies dependency `git2 = "^0"` (locked to 0.14.3) of package `gfold v4.0.0 (/private/tmp/gfold-20220511-36324-uas33a/gfold-4.0.0)`
    
    If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
      https://github.com/nickgerace/homebrew-nickgerace/issues
    

    Also, that last link for reporting issues does not work -- issues are turned off for that repo.

    opened by patryk-s 7
  • Add `AckslD/nvim-gfold.lua` link to repository

    Add `AckslD/nvim-gfold.lua` link to repository

    This will likely be in the README.

    Link to project: https://github.com/AckslD/nvim-gfold.lua Reddit post: https://www.reddit.com/r/neovim/comments/t209wy/introducing_nvimgfoldlua/ Original comment: https://github.com/nickgerace/gfold/issues/176#issuecomment-1050675223

    Great project @AcksID :)

    opened by nickgerace 5
  • Add Cargo.lock to workspace root

    Add Cargo.lock to workspace root

    Describe the issue.

    According to the cargo workspace documentation, all packages should share a common Cargo.lock file which should be present in the workspace root.

    All packages share a common Cargo.lock file which resides in the workspace root.

    Also AUR packages will become non-reproducible due to this issue since --locked flag causes the build to fail. (because Cargo.lock doesn't exist in the workspace root)

    ==> Starting build()...
    warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
    package:   /build/gfold/src/gfold-1.0.0/gfld/Cargo.toml
    workspace: /build/gfold/src/gfold-1.0.0/Cargo.toml
        Updating crates.io index
    error: the lock file /build/gfold/src/gfold-1.0.0/Cargo.lock needs to be updated but --locked was passed to prevent this
    If you want to try to generate the lock file without accessing the network, use the --offline flag.
    ==> ERROR: A failure occurred in build().
    

    Solution is simply removing Cargo.lock from .gitignore and pushing it.

    Is this about gfold, gfld, or both?

    Both, about Cargo workspaces.

    Is this a bug report, feature request, or another type of issue?

    Bug report.

    Paste the output of the relevant application(s).

    # to reproduce the build error
    git clone "https://aur.archlinux.org/gfold-git"
    cd gfold-git/
    extra-x86_64-build
    
    opened by orhun 4
  • test: add failing test for #202

    test: add failing test for #202

    This adds a failing tests for #202. Might not be the best test case and my rust skill is not that high but hopefully it can help find out the issue :)

    opened by AckslD 3
  • Json output

    Json output

    Really great project! :)

    What do you think about having an option to output as json. This would make it easy/ier to integrate with other tools/scripts.

    opened by AckslD 3
  • Panics on Bare Repo

    Panics on Bare Repo

    Hey! I came to your tool from 📝 How I Read "The Rust Programming Language".

    I noticed that the binary panics on bare repositories.

    image

    ➜  tmp RUST_BACKTRACE=full /Users/kyle/.cargo/bin/gfold
    thread 'main' panicked at 'failed get statuses: cannot status. This operation is not allowed against bare repositories.; class=Repository (6); code=BareRepo (-8)', src/gfold.rs:71:27
    stack backtrace:
       0:        0x1067e61fe - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h13e6f26430148ff2
       1:        0x1068038cc - core::fmt::write::h45a9bd04db15c24f
       2:        0x1067e3629 - std::io::Write::write_fmt::h8ae61696f13218d5
       3:        0x1067e7e75 - std::panicking::default_hook::{{closure}}::hc98fe2390b6284e5
       4:        0x1067e7bb2 - std::panicking::default_hook::h9a63cea866a4c14a
       5:        0x1067e83d5 - std::panicking::rust_panic_with_hook::h4d446ca45c8e1faa
       6:        0x1067e7fa2 - rust_begin_unwind
       7:        0x10680f1db - std::panicking::begin_panic_fmt::h0f7b83f993394bc5
       8:        0x1066fedb0 - gfold::gfold::walk_dir::h7ce7a797048a9dd9
       9:        0x1066fc1b9 - gfold::main::h9a34aaa0573dc180
      10:        0x1066fc4e6 - std::rt::lang_start::{{closure}}::h1185fef6ccb1df63
      11:        0x1067e86a9 - std::rt::lang_start_internal::hecbcda5e1a75a865
      12:        0x1066fc4d9 - main
    

    Steps to reproduce

    $ mkdir repos
    $ cd repos
    $ git clone --bare https://github.com/octocat/Spoon-Knife
    $ gfold
    
    opened by kylemacey 3
  •  [Feature Request]

    [Feature Request]

    • in the table rows, one could have a clickable repository url
    • and of course a state against the local repo : upgradable (5 commits)

    with colors, in term of importance (new version > commits > minor commit > ...)

    my 2 cents, I wanted to build the same tool, and I'm surprised how compact the code is, bravo!

    opened by barzilouik 3
  • Switch to cargo workspace

    Switch to cargo workspace

    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: https://github.com/rust-lang/git2-rs/pull/854
    • Remove "rustfmt.toml"

    Fixes #207

    opened by nickgerace 2
  • Add submodules information to a new or existing display mode other than `json`

    Add submodules information to a new or existing display mode other than `json`

    As of 5c297ad, display submodule information is only included in the json display mode. It should be added to a new or existing display mode.

    Previous issue: https://github.com/nickgerace/gfold/issues/177

    opened by nickgerace 0
  • Unsupported extension name

    Unsupported extension name

    Hi

    I'm running into this on 4.0.1 with git version 2.37.0.windows.1. The stuff befor this looks good, and I can't figure out, which repo issues this, and if its related to #202

    ...
    [2022-07-28T12:22:46Z DEBUG gfold::report] finalized report collection for repository at path: "\\\\?\\C:\\Users\\**
    Error: unsupported extension name extensions.worktreeconfig; class=Repository (6)
       0: <unknown>
       1: git_trace_set
       3: <unknown>
       4: <unknown>
       5: <unknown>
       6: <unknown>
       7: git_trace_set
       8: <unknown>
       9: <unknown>
      10: <unknown>
      11: BaseThreadInitThunk
      12: RtlUserThreadStart
    
    Dependent on upstream fix 
    opened by petrisch 14
  • How would TUI mode fit in this project?

    How would TUI mode fit in this project?

    Just thinking about how TUI mode would fit in this project. We can do some operations on the TUI as such: jump, delete, sync, fetch, copy path, rename, move, etc.

    Wdyt?

    opened by Dentrax 4
  • feature request: integrate with fzf  & jump to dir

    feature request: integrate with fzf & jump to dir

    Thanks for such a great tool!


    Currently, it's a bit hard to use without selective mode. I still want to use fzf git repo search and jumping to dir by pressing ENTER.

    atuin would be a great benchmark for this feature.

    Screen Shot 2022-01-12 at 15 13 13

    What do you think?

    opened by Dentrax 9
Releases(4.2.0)
Helps you keep track of time for team members across different time zones & DST changes

Teamdate Helps you keep track of time for team members across different timezones and other daylight saving changes based off their location. Because

Alex Snaps 7 Jan 9, 2023
A Rust CLI tool that helps you enforce Git policies through Git hooks both server and client side

GitPolicyEnforcer This is a command line utility written in Rust, that helps you utilize Git hooks, to enforce various policies. It currently supports

Vagelis Prokopiou 4 Aug 14, 2022
A Yocto setup and management tool that helps you keep your environment up-to-date and in-sync with your team

yb (Yocto Buddy) yb is designed to make it easy to setup and (perhaps more importantly) keep Yocto environments up-to-date and in-sync with your team.

null 13 Oct 31, 2022
Gix is a command-line interface (CLI) to access git repositories

gix is a command-line interface (CLI) to access git repositories. It's written to optimize the user-experience, and perform as good or better than the

Sebastian Thiel 5.2k Jan 5, 2023
A command-line tool and Docker image to automatically backup Git repositories from GitHub or anywhere

A command-line tool and Docker image to automatically backup Git repositories from GitHub or anywhere

Jake Wharton 256 Dec 27, 2022
A tool to dump exposed .git repositories

git-dumper This repository houses a tool to dump exposed .git repositories. This is a rewrite from the original GitTools's Dumper project, but in a re

HoLLy 10 Dec 13, 2022
A tool to dump exposed .git repositories

git-dumper This repository houses a tool to dump exposed .git repositories. This is a rewrite from the original GitTools's Dumper project, but in a re

HoLLy 8 Nov 1, 2022
Check a folder for dirty git repositories, forgotten branches and commits

dg - find dirty git repos Ever forgot to push a commit or lost your work because you assumed it was pushed to Github but it wasn't? dg finds local git

Dotan J. Nahum 11 Mar 19, 2023
🌌⭐cosmo is a wrapper for Git essentially, allowing you to compress multiple commands into one

❯ Cosmo Git tooling of the future New feature: Cosmo hooks! Click here for more info! ❯ ?? Features Config files (with defaults!) Fast Easy to use Fri

Jack 1 Oct 31, 2021
Sleek is a CLI tool for formatting SQL. It helps you maintain a consistent style across your SQL code, enhancing readability and productivity.

Sleek: SQL Formatter ✨ Sleek is a CLI tool for formatting SQL. It helps you maintain a consistent style across your SQL code, enhancing readability an

Nick Rempel 40 Apr 20, 2023
A Turing-complete but dead-simple spaced repetition CLI that helps you learn stuff.

Forne — Learn Stuff Forne is a Turing-complete spaced repetition engine to help you learn stuff your way. What does that mean? Well, there are a few p

Sam Brew 9 May 12, 2023
Yet Another Texture Packer - a small and simple CLI application to pack multiple textures/sprites into a texture atlas/sprite sheet

YATP (Yet Another Texture Packer) A small and simple CLI application to pack multiple textures/sprites into a texture atlas/sprite sheet. Installation

Petar Petrov 2 Sep 11, 2022
Scouty is a command-line interface (CLI) to keep an eye on substrate-based chains and hook things up

scouty is a command-line interface (CLI) to keep an eye on substrate-based chains and hook things up

TurboFlakes 15 Aug 6, 2022
A rust-cli to track and practise all your DSA links :)

Abhyas Abhyas is a Rust command-line application for managing and interacting with a database of links. Features Check Status: Get the total, complete

Harshal Jadhav 3 Nov 25, 2023
Dura - You shouldn't ever lose your work if you're using Git

Dura Dura is a background process that watches your Git repositories and commits your uncommitted changes without impacting HEAD, the current branch,

Tim Kellogg 4.1k Jan 8, 2023
git-cliff can generate changelog files from the Git history by utilizing conventional commits as well as regex-powered custom parsers.⛰️

git-cliff can generate changelog files from the Git history by utilizing conventional commits as well as regex-powered custom parsers. The changelog template can be customized with a configuration file to match the desired format.

Orhun Parmaksız 5k Jan 9, 2023
A git sub-command to view your git repository in the web browser

git-view A git sub-command to view your git repository in the web browser! About Are you also frustrated from moving your hands away from the keyboard

Hamothy 5 Sep 26, 2022
Git Explorer: cross-platform git workflow improvement tool inspired by Magit

Gex Git workflow improvement CLI tool inspired by Magit. This project is still under initial development, but I am actively dogfooding it and features

Peter Hebden 204 Jan 6, 2023
🔣 nerdfix helps you to find/fix obsolete Nerd Font icons in your project.

?? nerdfix nerdfix helps you to find/fix obsolete Nerd Font icons in your project. ?? Why Nerd Fonts is used in many projects for a beautiful UI. It p

Loi Chyan 80 Apr 8, 2023