Skip to content

Commit

Permalink
🧽 Gitclean => 🗑 git-tidy (#21)
Browse files Browse the repository at this point in the history
* Updated readme

* renamed all references to go-tidy and ran “go mod tidy”

* updated goreleaser

- gitclean => gittidy
- formatting
  • Loading branch information
drewwyatt authored May 1, 2019
1 parent 03996a9 commit 5d66c0d
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 22 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
dist/
gitclean
git-tidy
8 changes: 4 additions & 4 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
project_name: gitclean
project_name: git-tidy
before:
hooks:
- go mod download
builds:
- env:
- CGO_ENABLED=0
- env:
- CGO_ENABLED=0
archive:
replacements:
darwin: Darwin
Expand All @@ -13,6 +13,6 @@ archive:
386: i386
amd64: x86_64
checksum:
name_template: 'checksums.txt'
name_template: "checksums.txt"
snapshot:
name_template: "{{ .Tag }}-next"
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 🧽 Gitclean
# 🗑 git-tidy

[![release](https://img.shields.io/github/release-pre/drewwyatt/gitclean.svg?style=for-the-badge)](https://github.com/drewwyatt/gitclean/releases)
[![release](https://img.shields.io/github/release-pre/drewwyatt/git-tidy.svg?style=for-the-badge)](https://github.com/drewwyatt/git-tidy/releases)

Delete local git branches that have a remote tracking branch that is `: gone`.

Expand All @@ -10,43 +10,43 @@ Delete local git branches that have a remote tracking branch that is `: gone`.

```bash
$ brew tap drewwyatt/tap
$ brew install gitclean
$ brew install git-tidy
```

## Usage

```bash
$ gitclean # executes "git branch -d" on ": gone" branches
$ git tidy # executes "git branch -d" on ": gone" branches
```

### With force delete

```bash
$ gitclean -f # same as above, but with "-D" instead of "-d"
$ git tidy -f # same as above, but with "-D" instead of "-d"
# or
$ gitclean --force
$ git tidy --force
```

### Interactive

Present all ": gone" branches in a checkbox list, allowing user to opt-in to deletions.

```bash
$ gitclean -i
$ git tidy -i
# or
$ gitclean --interactive
$ git tidy --interactive
# with force
$ gitclean -if
$ git tidy -if
# or
$ gitclean --interactive --force
$ git tidy --interactive --force
```

### Directory
### Path

By default, `gitclean` will execute all commands in the **current directory** (`.`), however, you can pass a path to another git repository after any/all other flags.
By default, `tidy` will execute all commands in the **current directory** (`.`), however, you can pass a path to another git repository after any/all other flags.

```bash
$ gitclean ../some/other/repo
$ git tidy ../some/other/repo
# with flags
$ gitclean -if ../some/other/repo
$ git tidy -if ../some/other/repo
```
5 changes: 3 additions & 2 deletions commands/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package commands

import (
"fmt"
"gopkg.in/AlecAivazis/survey.v1"
"regexp"

gUtils "github.com/drewwyatt/gitclean/git"
"gopkg.in/AlecAivazis/survey.v1"

gUtils "github.com/drewwyatt/git-tidy/git"
)

var goneBranch = regexp.MustCompile(`(?m)^(?:\*| ) ([^\s]+)\s+[a-z0-9]+ \[[^:\n]+: gone\].*$`)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/drewwyatt/gitclean
module github.com/drewwyatt/git-tidy

require (
github.com/ogier/pflag v0.0.1
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"github.com/drewwyatt/gitclean/commands"
"github.com/drewwyatt/git-tidy/commands"
flag "github.com/ogier/pflag"
)

Expand Down

0 comments on commit 5d66c0d

Please sign in to comment.