diff --git a/.goreleaser.yml b/.goreleaser.yml index 659acf1..5bc28a5 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -34,7 +34,7 @@ archives: - git-get - git-list replacements: - darwin: macOS + darwin: MacOS linux: Linux windows: Windows 386: i386 @@ -42,7 +42,7 @@ archives: format_overrides: - goos: windows format: zip - # Don't include any additional files into the archive (such as README, CHANGELOG etc). + # Don't include any additional files into the archives (such as README, CHANGELOG etc). files: - none* @@ -68,7 +68,7 @@ brews: email: git-get@grdl.dev folder: Formula homepage: "https://github.com/grdl/git-get/" - description: "Better way to clone, organize and manage git repositories" + description: "Better way to clone, organize and manage multiple git repositories" test: | system "git-get --version" install: | diff --git a/README.md b/README.md index 1e1f8d3..7d98d38 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,51 @@ ![build](https://github.com/grdl/git-get/workflows/build/badge.svg) [![Go Report Card](https://goreportcard.com/badge/github.com/grdl/git-get)](https://goreportcard.com/report/github.com/grdl/git-get) -`git-get` is better way to clone, organize and manage git repositories. +`git-get` is a better way to clone, organize and manage multiple git repositories. + +It gives you two new git commands: +- **`git get`** clones repositories into an organized directory structure (like golang's [`go get`](https://golang.org/cmd/go/)). It's dotfiles friendly - you can clone multiple repositories listed in a file. +- **`git list`** shows status of all your git repositories and their branches. + +![Example](./docs/example.svg) + +## Installation + +Using Homebrew: +``` +brew install grdl/tap/git-get +``` + +Or grab the [latest release](https://github.com/grdl/git-get/releases) and put the binaries on your PATH. + +Each release contains two binaries: `git-get` and `git-list`. When put on PATH, git automatically recognizes them as custom commands and allows to call them as `git get` or `git list`. + +## Usage + + +## Configuration + + +## Features + +- statuses +- multiple outputs +- dotfiles friendly + + + +## Contributing + +Pull requests are welcome. The project is still very much work in progress. Here's some of the missing features planned to be fixed soon: +- improvements to the `git list` output +- submodules status +- info about stashes +- better recognition of different repo states: conflict, merging, rebasing, cherry picking etc. +- plenty of bugfixes and tests + +## Acknowledgments + +Inspired by: +- golang's [`go get`](https://golang.org/cmd/go/) command +- [x-motemen/ghq](https://github.com/x-motemen/ghq) +- [fboender/multi-git-status](https://github.com/fboender/multi-git-status) diff --git a/docs/example.svg b/docs/example.svg new file mode 100755 index 0000000..39c4216 --- /dev/null +++ b/docs/example.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + git get grdl/testsite git get grdl/testsite git get grdl/testsite Cloning into '/home/grdl/repos/github.com/grdl/testsite'...Enumerating objects: 45, done.Counting objects: 40% (18/45)Counting objects: 100% (45/45), done.Compressing objects: 100% (23/23), done.Total 45 (delta 17), reused 45 (delta 17), pack-reused 0 g git get grdl/testsite git get grdl/testsite git get grdl/testsite git get grdl/testsite git get grdl/testsite git get grdl/testsite git get grdl/testsite git l git list git list git list git list git list /home/grdl/repos├── github.com│   ├── fboender│   │   └── multi-git-status master ok│   ├── grdl│   │   ├── git-get master 1 ahead [ untracked ]│   │   │   └── development ok│   │   ├── homebrew-tap master ok│   │   ├── testflux master ok│   │   └── testsite master ok│   └── x-motemen│   └── ghq detached HEAD│   └── master ok└── gitlab.com └── grdl ├── dotfiles master 3 behind 1 ahead [ uncommitted ] └── gitlab-mirror-maker docs no upstream └── master ok + \ No newline at end of file diff --git a/pkg/get.go b/pkg/get.go index 4a15173..0c9584e 100644 --- a/pkg/get.go +++ b/pkg/get.go @@ -16,6 +16,8 @@ type GetCfg struct { // Get executes the "git get" command. func Get(c *GetCfg) error { + // TODO: show something when no args + if c.URL != "" { return cloneSingleRepo(c) } diff --git a/pkg/list.go b/pkg/list.go index 1f32b50..0b1f685 100644 --- a/pkg/list.go +++ b/pkg/list.go @@ -51,6 +51,7 @@ func List(c *ListCfg) error { case cfg.OutDump: printer = &print.DumpPrinter{} default: + // TODO: fix return fmt.Errorf("invalid --out flag; allowed values: %v", []string{cfg.OutFlat, cfg.OutTree, cfg.OutSmart}) }