git-find 0.3.0

A tool (cli & lib) to find local git repositories.
Documentation

git-find

License: CC0-1.0 Build Status Crates.io Documentation

A tool (cli & lib) to find local git repositories.

Why

Because I need a tool to list and to reorg my local git repositories.

Usage Cli

$> git-find -h

git-find 0.2.0
davidB
A tool (cli & lib) to find local git repositories.

USAGE:
    git-find [FLAGS] [OPTIONS] [DIR]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information
    -v, --verbose    Verbose mode (-v, -vv, -vvv, etc.) print on stderr

OPTIONS:
    -t, --tmpl <format>    format of the output print on stdout [default: {{ .path.file_name }}    {{ .path.full }}]

ARGS:
    <DIR>    root directory of the search [default: .]
  • broadcast git status to every repositories
git find -t 'cd {{ .path.full }}; echo "\n\n---------------------------------------------\n$PWD"; git status' | sh

Template format

The template format is a subset of golang text/template.

Possibles values

!! Experimental: values could change with future release !!

  • .path
    • .file_name
    • .full
  • .remotes
    • .<name_of_remote> : eg 'origin'
      • .name
      • .url_full
      • .url_host
      • .url_path

Samples

  • to list local repository
{{ .path.file_name }}\t{{ .path.full }}
  • to list local repository with origin url
{{ .path.file_name }}\t{{ .path.full }}\t{{with .remotes.origin}} {{ .name }} {{.url_full}} {{.url_host}} {{.url_path}} {{end}}
  • to create a sh script to "git fetch" on every repository
cd {{ .path.full }}; echo "\n\n---------------------------------------------\n$PWD"; git fetch

Install

Via rust toolchain

cargo install git-find

Via pre-build binaries

!! Experimental !!

tar -xzvf git-find_0.2.2-linux.tar.gz
chmod a+x git-find
mv git-find $HOME/bin
rm git-find_0.2.2-linux.tar.gz

Related and similar

Some tools to help management of multi repository But not the same features, else no need to re-do.

Informations

Actions (broadcast)

TODO

  • find a rust template engine that support calling method (getter) on current field (or contribute to gtmpl as it's a feature of go template)
  • internally use stream / queue instead of Vector
  • build linux binary with musl (see https://github.com/emk/rust-musl-builder)
  • optimize