* Remove _ prefix to variables
* Update README.md: align with default config
* -printcfg shows commented configuration
* Remove unused formater.go
* Move config-related in config.go
* tmux: remove DefaultCfg variable
The default configuration is now defined in an embedded file
with comments.
Fixes#82
* Bump gopkg.in/yaml v2 -> v3
* Add branch_trim_direction (default to right)
* tmux: remove Formater.remote()
Formater.remote() is just remoteBranch() followed by divergence()
* tmux: implement and test branch_trim_direction (left|right)
* tmux: s/BranchTrimDirection/BranchTrim
* README.md: update and add branch_trim
* tmux: remove dependency to testify
* tmux: use io.Discard in test
`-timeout DUR` simply exist `gitmux` is it still running after DUR
amount of time.
DUR is parsed as a time.Duration with the special exception that 0
means no timeout.
Defaults to 0 = _no timeout_
Closes#35
* Cosmetics
* Add TestOutputNonRegression
This test ensures that new features do not change gitmux output
when used with a default configuration.
It loads a golden file ('testdata/default.output.golden') and
compares it with the actual output. -update updates the golden
file.
* format/tmux: breakdown `remote` into `remote-flags`+`divergence`
Currently the `remote` flags gets replaced by both the name of the
remote (e.g `origin`) and the divergence flags indicating whether the
local and the remote branch diverges and how much (e.g `↓·2↑·3`).
In order to allow user to skip the remote branch and to keep the
divergence flags, or the other way around, we add the `remote-branch` and
the `divergence` layout elements.
Also, to not break user configurations, we keep the 'remote' layout
element, and make it so that it's equivalent to setting `remote-flags`
and `divergence` consecutively.
Fixes#23
* format/tmux: replace `remote` with `branch+divergence` in default config
* Update README.md: improve the customizing section
Improve the Customizing section of the README
When current directory was not a Git working tree, git command
were failing, as expected. But a recent commit made a change in
the error check function, and the program was not exit anymore in
the event of an error. Instead it was continuing with a bogus
gitstatus varriable, leading to panics. Unless running in -dbg
mode, those panic had no effect whatsoever and gitmux was usable
as before. It's just that the program was silently crashing
instead of silently terminating.
* Change default options to more sensible ones
Remove `-quiet` and `-fmt` option, replace them with `-dbg` since they
were only meant to be used if something went wrong.
* In debug mod, prints errors on stderr
* cosmetics
* Keep -q -fmt deprecated/unused options
* Improve README.md