Commit graph

11 commits

Author SHA1 Message Date
Aurélien Rainone 683db00eb2
Bump deps and go version (#126)
* Bump dependencies and go version

* Cosmetics
2025-07-28 20:57:31 +02:00
Aurélien Rainone 595c9fde2f
Issue 82/comment default config (#87)
* 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
2023-02-18 02:39:56 +01:00
Aurélien Rainone 22e1642285
Code gardening (#65)
* Use flag.Duration instead roll-your-own duration

* Remove deprecated cli flags (-q and --fmt)

* parseOptions returns context cancellation function

* In config_test.go do not import embed package anymore

* Cosmetics

* Cosmetics
2022-03-11 12:46:38 +01:00
Aurélien Rainone e614142f54
Issue 58/trim branch name right or left (#59)
* 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
2022-01-23 17:36:31 +01:00
Aurélien Rainone 98d8874553
format: remove empty package (#57) 2021-10-15 12:20:20 +02:00
Aurélien Rainone 3983d85658
Issue 37/second try (#42)
* Bump gitstatus to v0.4.3 (NewWithContext)

* Pass -timeout as ctx to gitstatus.NewWithContext
2020-09-02 15:25:59 +02:00
Aurélien Rainone 845f4165fe
Add -timeout option (#37)
`-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
2020-09-01 23:13:42 +02:00
Aurélien Rainone 247481f189
Linting (#36)
* lint: cosmetics

* lint: rename global variables

* gofmt

* lint: unchecked error

* lint: errcheck

* lint: cosmetics

* Specialize 'run' function to run 'git'
2020-09-01 23:01:30 +02:00
Aurélien Rainone c0b7b03325
Breakdown remote component (#27)
* 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
2020-06-07 20:07:02 +02:00
Aurélien Rainone 57f0f80cf0
Fix error check function (#15)
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.
2020-01-06 19:09:25 +01:00
Aurélien Rainone d9fc3d3d9e
Sensible defaults (#11)
* 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
2019-12-24 01:05:17 +01:00
Renamed from main.go (Browse further)