Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswalz committed Oct 10, 2020
1 parent 09c6ea1 commit c3b9823
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 19 deletions.
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
src="https://user-images.githubusercontent.com/6971318/95147815-cd1d6a80-074f-11eb-8265-56466ac628f8.gif"
width="600px" border="0" alt="bit">
<br>
<a href="https://github.com/chriswalz/bit/tags"><img src="https://img.shields.io/badge/version-v0.4.10-brightgreen.svg?style=flat-square" alt="Version"></a>
<a href="https://goreportcard.com/report/github.com/chriswalz/bit"><img src="https://goreportcard.com/badge/github.com/chriswalz/bit" alt="Version"></a>
<a href="#"><img src="https://img.shields.io/github/go-mod/go-version/chriswalz/bit" alt="Version"></a>
<a href="#"><img src="https://img.shields.io/github/stars/chriswalz/bit?style=social" alt="Version"></a>
<a href="https://github.com/chriswalz/bit/tags"><img src="https://img.shields.io/github/v/tag/chriswalz/bit?sort=semver" alt="Version"></a>
</p>


`bit` is an experimental modernized git CLI built on top of git that provides happy defaults and other niceties:

- command and **flag suggestions** to help you navigate the plethora of options git provides you
Expand Down Expand Up @@ -39,6 +40,7 @@ export GOBIN=$(go env GOPATH)/bin
```


Enable GO Modules (Windows: `go env -w GO111MODULE=on`)
```shell script
GO111MODULE=on go get github.com/chriswalz/bit@latest;
GO111MODULE=on go get github.com/chriswalz/bit/bitcomplete@latest;
Expand Down Expand Up @@ -163,14 +165,16 @@ Thanks to [Gitless](https://gitless.com/), [git-extras](https://github.com/tj/gi
## Changelog
v0.5

-[x] `bit switch`, `bit co`, `bit checkout` will show prompt
-[x] fix bit tab completion (bitcomplete)
-[x] various minor fixes
- [X] `bit switch`, `bit co`, `bit checkout` will show prompt
- [X] fix bit tab completion (bitcomplete)
- [X] fix edge case where there is an invalid ref
- [X] various minor fixes
- [X] Deployment: automatic versioning

v0.4

-[x] multiline support with Go Survey Library
-[x] color mitigation to have roughly similar colors across OSs
-[x] fix README go get installation instructions
-[x] QOL improvements for `bit sync`
- [X] multiline support with Go Survey Library
- [X] color mitigation to have roughly similar colors across OSs
- [X] fix README go get installation instructions
- [X] QOL improvements for `bit sync`

3 changes: 1 addition & 2 deletions cmd/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func TestBranchList(t *testing.T) {
func TestToStructuredBranchList(t *testing.T) {
expects :=
[]struct {
raw string
raw string
expectedFirstBranchName string
}{
{
Expand All @@ -79,7 +79,6 @@ func TestToStructuredBranchList(t *testing.T) {
}
}


// Tests AllBitAndGitSubCommands has common commands, git sub commands, git aliases, git-extras and bit commands
func TestAllBitAndGitSubCommands(t *testing.T) {
expects := []string{"pull --rebase origin master", "commit -a --amend --no-edit", "add", "push", "fetch", "pull", "co", "lg", "release", "info", "save", "sync"}
Expand Down
8 changes: 3 additions & 5 deletions cmd/rootShell.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ func shellCommandCompleter(suggestionMap map[string][]prompt.Suggest) func(d pro

func branchCommandCompleter(suggestionMap map[string][]prompt.Suggest) func(d prompt.Document) []prompt.Suggest {
return func(d prompt.Document) []prompt.Suggest {
return promptCompleter(suggestionMap, "checkout " + d.Text)
return promptCompleter(suggestionMap, "checkout "+d.Text)
}
}

func promptCompleter(suggestionMap map[string][]prompt.Suggest, text string) []prompt.Suggest{
func promptCompleter(suggestionMap map[string][]prompt.Suggest, text string) []prompt.Suggest {
var suggestions []prompt.Suggest
split := strings.Split(text, " ")
filterFlags := make([]string, 0, len(split))
Expand All @@ -116,8 +116,6 @@ func promptCompleter(suggestionMap map[string][]prompt.Suggest, text string) []p
return prompt.FilterContains(suggestions, curr, true)
}



func RunGitCommandWithArgs(args []string) {
var err error
err = RunInTerminalWithColor("git", args)
Expand All @@ -140,7 +138,7 @@ func GitCommandsPromptUsed(args []string, suggestionMap map[string][]prompt.Sugg
if sub == "checkout" || sub == "switch" || sub == "co" {
branchName := ""
if len(args) < 2 {
branchName = SuggestionPrompt("> bit " + sub + " ", branchCommandCompleter(suggestionMap))
branchName = SuggestionPrompt("> bit "+sub+" ", branchCommandCompleter(suggestionMap))
} else {
branchName = strings.TrimSpace(args[len(args)-1])
}
Expand Down
8 changes: 4 additions & 4 deletions cmd/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

func RunInTerminalWithColor(cmdName string, args []string) error {
dir ,err := os.Getwd()
dir, err := os.Getwd()
if err != nil {
return err
}
Expand Down Expand Up @@ -375,8 +375,8 @@ func AllGitAliases() (cc []*cobra.Command) {
continue
}
c := cobra.Command{
Use: split[0],
Short: strings.Join(split[1:], " "),
Use: split[0],
Short: strings.Join(split[1:], " "),
}
cc = append(cc, &c)
}
Expand Down Expand Up @@ -436,7 +436,7 @@ func FlagSuggestionsForCommand(gitSubCmd string, flagtype string) []prompt.Sugge
"status": statusFlagsStr,
"commit": commitFlagsStr,
"branch": branchFlagsStr,
"tag": tagFlagsStr,
"tag": tagFlagsStr,
"checkout": checkoutFlagsStr,
"merge": mergeFlagsStr,
"pull": pullFlagsStr,
Expand Down

0 comments on commit c3b9823

Please sign in to comment.