summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorİbrahim Serdar Açıkgöz <serdaracikgoz86@gmail.com>2018-11-29 12:13:24 +0300
committerİbrahim Serdar Açıkgöz <serdaracikgoz86@gmail.com>2018-11-29 12:13:24 +0300
commitf2e5ac67c0671ffcd8157039a064005435d3f054 (patch)
treeadbf5697b88ca5cc8965c086b684614bc5368987
parentMerge pull request #12 from isacikgoz/develop (diff)
downloadgitbatch-f2e5ac67c0671ffcd8157039a064005435d3f054.tar.gz
update readme
-rw-r--r--README.md55
-rw-r--r--pkg/gui/keybindings.go32
-rw-r--r--pkg/gui/textstyle.go3
3 files changed, 80 insertions, 10 deletions
diff --git a/README.md b/README.md
index 15550cd..597ac18 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
## gitbatch
Aim of this tool to make your local repositories synchronized with remotes easily. Since my daily work is tied to many repositories I often end up walking on many directories and manually pulling updates etc. To make this routine more elegant, I made a decision to create a simple tool to handle this job in a seamless way. Actually I am not a golang developer but I thought it would be cool to create this tool with a new language for me. While developing this project, I am getting experience with golang. As a result, I really enjoy working on this project and I hope it will be a useful tool. I hope this tool can be useful for others too.
-**Disclamier**
+**Disclamier**
- This is still a work in progress project.
- Authentication reuqired repostires are **NOT SUPPORTED** using ssh is recommended if you need to authenticate to fetch/pull
- [Connecting to GitHub with SSH](https://help.github.com/articles/connecting-to-github-with-ssh/)
@@ -11,22 +11,59 @@ Aim of this tool to make your local repositories synchronized with remotes easil
- [BitBucket Set up an SSH key](https://confluence.atlassian.com/bitbucket/set-up-ssh-for-git-728138079.html)
- This project is not widely tested in various environments. (macOS and Ubuntu is okay but didn't tried on Windows)
-Here is the initial look of the project:
+Here is the initial look of the project:
[![asciicast](https://asciinema.org/a/qmZDhmUjwWmZvdpZGYIRW56h7.svg)](https://asciinema.org/a/qmZDhmUjwWmZvdpZGYIRW56h7)
-### Use
-run the command the parent of your git repositories. Or simply:
-`gitbatch --help`
-
## installation
-the project is at very very early version but if you like new adventures;
-```
+the project is at very early version but it can be tested;
+```bash
go get github.com/isacikgoz/gitbatch
-gitbatch # whereever your git root is
```
+## Use
+run the command the parent of your git repositories. For start-up options simply:
+`gitbatch --help`
+
+### Controls
+
+- **tab**: Switch mode
+- **↑** or **k**: Up
+- **↓** or **j**: Down
+- **b**: Iterate over branches
+- **r**: Iterate over remotes
+- **e**: Iterate over remote branches
+- **s**: Iterate over commits
+- **d**: Show commit diff
+- **c**: Controls or close windows if a pop-up window opened
+- **enter**: Start queue
+- **space**: Add to queue
+- **ctrl + c**: Force application to quit
+- **q**: Quit
+
+### Modes
+
+- **FETCH**: fetches the selected **remote** e.g. *Origin*, *Upstream*, etc.
+- **PULL**: fetches the selected **remote** and merges selected **remote branch** into **active branch** e.g. origin/master → master
+- **MERGE**: merges the selected **remote branch** into **active branch** e.g. origin/master → master
+
+### Display
+
+#### Repository Screen
+↖ 0 ↘ 0 → master ✗ ips.server.slave.native •
+↖ (pushables) ↘ (pullables) → (branch) (✗ if dirty) (repository folder name) (• if queued)
+
+- if pushables or pullables appear to be "**?**", that means no upstream configured for the active branch
+- the queued indicator color represents the operation same as mode color
+
+#### Commit Screen
+- if hash color is cyan it means that commit is a local commit, if yellow it means it is a commit that will merge in to your active branch if you pull or merge
+- you can see the diff by simply pressing **d** on the selected commit
+
## Further goals
+- add testing, currently this is the M.V.P. so that people can swiftly get hands on
- select all feature
+- arrange repositories to an order e.g. alphabetic, last modified, etc.
+- shift keys, i.e. **s** for iterate **shift + s** for reverse iteration
- binary distrubiton over [homebrew](https://github.com/Homebrew/brew) or similar
- recursive repository search from the filesystem
- full src-d/go-git integration (*waiting for merge abilities*)
diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go
index 1d3b8d8..e2b20b3 100644
--- a/pkg/gui/keybindings.go
+++ b/pkg/gui/keybindings.go
@@ -60,6 +60,22 @@ func (gui *Gui) generateKeybindings() error {
Vital: false,
}, {
View: mainViewFeature.Name,
+ Key: 'k',
+ Modifier: gocui.ModNone,
+ Handler: gui.cursorUp,
+ Display: "k",
+ Description: "Up",
+ Vital: false,
+ }, {
+ View: mainViewFeature.Name,
+ Key: 'j',
+ Modifier: gocui.ModNone,
+ Handler: gui.cursorDown,
+ Display: "j",
+ Description: "Down",
+ Vital: false,
+ }, {
+ View: mainViewFeature.Name,
Key: 'b',
Modifier: gocui.ModNone,
Handler: gui.nextBranch,
@@ -147,6 +163,22 @@ func (gui *Gui) generateKeybindings() error {
Description: "Page down",
Vital: true,
}, {
+ View: commitdetailViewFeature.Name,
+ Key: 'k',
+ Modifier: gocui.ModNone,
+ Handler: gui.commitCursorUp,
+ Display: "k",
+ Description: "Page up",
+ Vital: false,
+ }, {
+ View: commitdetailViewFeature.Name,
+ Key: 'j',
+ Modifier: gocui.ModNone,
+ Handler: gui.commitCursorDown,
+ Display: "j",
+ Description: "Page down",
+ Vital: false,
+ }, {
View: cheatSheetViewFeature.Name,
Key: 'c',
Modifier: gocui.ModNone,
diff --git a/pkg/gui/textstyle.go b/pkg/gui/textstyle.go
index 6820f1c..8bee560 100644
--- a/pkg/gui/textstyle.go
+++ b/pkg/gui/textstyle.go
@@ -55,7 +55,8 @@ func (gui *Gui) displayString(entity *git.RepoEntity) string {
prefix = prefix + pushable + ws + entity.Branch.Pushables + ws +
pullable + ws + entity.Branch.Pullables + ws + confidentArrow + ws
} else {
- prefix = prefix + unkown + ws + unconfidentArrow + ws
+ prefix = prefix + pushable + ws + yellow.Sprint(entity.Branch.Pushables) + ws +
+ pullable + ws + yellow.Sprint(entity.Branch.Pullables) + ws + unconfidentArrow + ws
}
branch := adjustTextLength(entity.Branch.Name, maxBranchLength)