From 6cb0a14f33e7ebbbc248d35af1aa99cf124809c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Borbo=C3=ABn?= Date: Tue, 7 Aug 2018 16:11:53 +0200 Subject: [PATCH 01/12] Add build date to build cmd --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 81ad1a800..0e240ed32 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ script: # - go get -v ./... # - diff -u <(echo -n) <(gofmt -d .) # can't make gofmt ignore vendor directory # - go vet $(go list ./... | grep -v /vendor/) - - if [ "${LATEST}" = "true" ]; then gox -os="linux darwin windows" -arch="amd64" -output="lazygit.." -ldflags "-X main.Rev=`git rev-parse --short HEAD`" -verbose ./...; fi + - if [ "${LATEST}" = "true" ]; then gox -os="linux darwin windows" -arch="amd64" -output="lazygit.." -ldflags "-X main.Rev=`git rev-parse --short HEAD` -X main.builddate=`date -u +%Y%m%d.%H%M%S`" -verbose ./...; fi deploy: provider: releases skip_cleanup: true From 4d9d2b134f7578cc5ff394956f9ecf5ccaf03566 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Borbo=C3=ABn?= Date: Tue, 7 Aug 2018 16:15:23 +0200 Subject: [PATCH 02/12] Add `lazygit --v` version * Recover Rev and Build Date from build args * Moved `debuggingPointer` and `versionFlag` to `var()` * Print version and exit in case of `-v` or `--v` --- main.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index b3586b04e..bcbce909a 100644 --- a/main.go +++ b/main.go @@ -14,6 +14,10 @@ import ( var ( startTime time.Time debugging bool + Rev string + builddate string + debuggingPointer = flag.Bool("debug", false, "a boolean") + versionFlag = flag.Bool("v", false, "Print the current version") ) func homeDirectory() string { @@ -58,11 +62,14 @@ func navigateToRepoRootDirectory() { } func main() { - debuggingPointer := flag.Bool("debug", false, "a boolean") - flag.Parse() + startTime = time.Now() debugging = *debuggingPointer devLog("\n\n\n\n\n\n\n\n\n\n") - startTime = time.Now() + flag.Parse() + if *versionFlag { + fmt.Printf("rev=%s, build date=%s", Rev, builddate) + os.Exit(0) + } verifyInGitRepo() navigateToRepoRootDirectory() run() From 411c02324fcbb8185216202ec972ac1eb4e37e32 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Wed, 8 Aug 2018 07:54:11 +1000 Subject: [PATCH 03/12] use gox default output --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c55390b48..d4f76e1c6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,8 @@ script: # - go get -v ./... # - diff -u <(echo -n) <(gofmt -d .) # can't make gofmt ignore vendor directory # - go vet $(go list ./... | grep -v /vendor/) - - if [ "${LATEST}" = "true" ]; then gox -os="linux darwin windows" -arch="amd64" -output="lazygit.." -ldflags "-X main.Rev=`git rev-parse --short HEAD`" -verbose ./...; fi + - if [ "${LATEST}" = "true" ]; then gox -os="linux darwin windows" -arch="amd64" -ldflags "-X main.Rev=`git rev-parse --short HEAD`" -verbose ./...; fi + - ls - ls */* deploy: provider: releases From 2a25ce014b6ca4132b2af58434368266edd5e8a5 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Wed, 8 Aug 2018 07:56:55 +1000 Subject: [PATCH 04/12] use correct filenames --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index d4f76e1c6..fc6620603 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,9 +36,9 @@ deploy: api_key: secure: TnB8I+swjicHuGTXk3ncm1Aaa12eIJqWV/Lhcnbb01i39p6+fyn3vDMdWPcejt3R8gcJqv4wyP8UQVO9G1qkLppt6V/qAuY5x6nX0MgEa3t+8JLJnGYHZYsuIgan/ecAmeu5+6dgUhr9Oq6zQOEv/O88NsALzMlqnEQNXI8XSoScfhkiVDIp3zWov0vBizCdThnNgTx9zRpJVoqxmhWvgt+me2+fOhSx1Y+3ZA2gE7zq8IFAbxp36d0rsR5lKqmTuF+YsF9iQ7Ar+xCjbRunLsZx+VwGqGfpS/qS7EwsEqBI0vEO76eFJkwEsIzOvJiFNhBDUu3upquBFMT4uzxRxH3eV+J4mZtu29UDLdvKI5Q730Lk9AgmH4now+RmP08M0SEXJa+AnHeuBv2u1iU5bu+sI6CORVQzKQwOph9AABDjSZ54wrXIpYEeIW2sz8nx+hiG6QL1mqfM/l+55BR69u3vxKYMryQBxPuzhZCTOqqI4uahlb6GIUNZJ9vGZeIA9HFJq3ymW8cdrpYzhKf3Nx9jK+Yb81h5/AHq9iChXEC63VPCDXXGRllh2UYWNYCaAdtk+ekpLR8299e4CaEregy6g5U2S3/xrBKl87miu1uJ/fquXoxGdSU+JcmsmXZ26sGIU2TCYdNjSfIgpOyfMmB4JNtKHqWRHA9Fe42CRpA= file: - - lazygit.windows.amd64.exe - - lazygit.darwin.amd64 - - lazygit.linux.amd64 + - lazygit_windows_amd64.exe + - lazygit_darwin_amd64 + - lazygit_linux_amd64 on: repo: jesseduffield/lazygit tags: true From 8cc444182fe70d2e1425cc50c7dc5e67cbbd335a Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Wed, 8 Aug 2018 08:02:33 +1000 Subject: [PATCH 05/12] make binaries executable --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index fc6620603..90468ea42 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,10 @@ script: # - go get -v ./... # - diff -u <(echo -n) <(gofmt -d .) # can't make gofmt ignore vendor directory # - go vet $(go list ./... | grep -v /vendor/) - - if [ "${LATEST}" = "true" ]; then gox -os="linux darwin windows" -arch="amd64" -ldflags "-X main.Rev=`git rev-parse --short HEAD`" -verbose ./...; fi + - gox -os="linux darwin windows" -arch="amd64" -ldflags "-X main.Rev=`git rev-parse --short HEAD`" -verbose ./... + - chmod +x ./lazygit_windows_amd64.exe + - chmod +x ./lazygit_darwin_amd64 + - chmod +x ./lazygit_linux_amd64 - ls - ls */* deploy: From 2853aba951b18034b62a3430888199a1319523ca Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Wed, 8 Aug 2018 08:07:43 +1000 Subject: [PATCH 06/12] appending version number to binaries --- .travis.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 90468ea42..baca9494c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,9 +28,12 @@ script: # - diff -u <(echo -n) <(gofmt -d .) # can't make gofmt ignore vendor directory # - go vet $(go list ./... | grep -v /vendor/) - gox -os="linux darwin windows" -arch="amd64" -ldflags "-X main.Rev=`git rev-parse --short HEAD`" -verbose ./... - - chmod +x ./lazygit_windows_amd64.exe - - chmod +x ./lazygit_darwin_amd64 - - chmod +x ./lazygit_linux_amd64 + - mv lazygit_windows_amd64.exe lazygit_windows_amd64_${TRAVIS_TAG}.exe + - mv lazygit_darwin_amd64 lazygit_darwin_amd64_${TRAVIS_TAG} + - mv lazygit_linux_amd64 lazygit_linux_amd64_${TRAVIS_TAG} + - chmod +x ./lazygit_windows_amd64_${TRAVIS_TAG}.exe + - chmod +x ./lazygit_darwin_amd64_${TRAVIS_TAG} + - chmod +x ./lazygit_linux_amd64_${TRAVIS_TAG} - ls - ls */* deploy: @@ -39,9 +42,9 @@ deploy: api_key: secure: TnB8I+swjicHuGTXk3ncm1Aaa12eIJqWV/Lhcnbb01i39p6+fyn3vDMdWPcejt3R8gcJqv4wyP8UQVO9G1qkLppt6V/qAuY5x6nX0MgEa3t+8JLJnGYHZYsuIgan/ecAmeu5+6dgUhr9Oq6zQOEv/O88NsALzMlqnEQNXI8XSoScfhkiVDIp3zWov0vBizCdThnNgTx9zRpJVoqxmhWvgt+me2+fOhSx1Y+3ZA2gE7zq8IFAbxp36d0rsR5lKqmTuF+YsF9iQ7Ar+xCjbRunLsZx+VwGqGfpS/qS7EwsEqBI0vEO76eFJkwEsIzOvJiFNhBDUu3upquBFMT4uzxRxH3eV+J4mZtu29UDLdvKI5Q730Lk9AgmH4now+RmP08M0SEXJa+AnHeuBv2u1iU5bu+sI6CORVQzKQwOph9AABDjSZ54wrXIpYEeIW2sz8nx+hiG6QL1mqfM/l+55BR69u3vxKYMryQBxPuzhZCTOqqI4uahlb6GIUNZJ9vGZeIA9HFJq3ymW8cdrpYzhKf3Nx9jK+Yb81h5/AHq9iChXEC63VPCDXXGRllh2UYWNYCaAdtk+ekpLR8299e4CaEregy6g5U2S3/xrBKl87miu1uJ/fquXoxGdSU+JcmsmXZ26sGIU2TCYdNjSfIgpOyfMmB4JNtKHqWRHA9Fe42CRpA= file: - - lazygit_windows_amd64.exe - - lazygit_darwin_amd64 - - lazygit_linux_amd64 + - lazygit_windows_amd64_${TRAVIS_TAG}.exe + - lazygit_darwin_amd64_${TRAVIS_TAG} + - lazygit_linux_amd64_${TRAVIS_TAG} on: repo: jesseduffield/lazygit tags: true From 7add598235a48217a68ed41a1b6023ca21fa4239 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Wed, 8 Aug 2018 08:13:40 +1000 Subject: [PATCH 07/12] give everybody permission --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index baca9494c..a606e42f2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,9 +31,9 @@ script: - mv lazygit_windows_amd64.exe lazygit_windows_amd64_${TRAVIS_TAG}.exe - mv lazygit_darwin_amd64 lazygit_darwin_amd64_${TRAVIS_TAG} - mv lazygit_linux_amd64 lazygit_linux_amd64_${TRAVIS_TAG} - - chmod +x ./lazygit_windows_amd64_${TRAVIS_TAG}.exe - - chmod +x ./lazygit_darwin_amd64_${TRAVIS_TAG} - - chmod +x ./lazygit_linux_amd64_${TRAVIS_TAG} + - chmod a+x ./lazygit_windows_amd64_${TRAVIS_TAG}.exe + - chmod a+x ./lazygit_darwin_amd64_${TRAVIS_TAG} + - chmod a+x ./lazygit_linux_amd64_${TRAVIS_TAG} - ls - ls */* deploy: From 3b264806ef14dcdddaa429acc2bcc10cc37cd9cb Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Wed, 8 Aug 2018 08:32:52 +1000 Subject: [PATCH 08/12] add version number --- gui.go | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/gui.go b/gui.go index 7c5344dd8..5ff2eeeb2 100644 --- a/gui.go +++ b/gui.go @@ -16,6 +16,9 @@ import ( "github.com/jesseduffield/gocui" ) +// Rev is the release version +var Rev string + // OverlappingEdges determines if panel edges overlap var OverlappingEdges = false @@ -225,14 +228,28 @@ func layout(g *gocui.Gui) error { v.FgColor = gocui.ColorWhite } - if v, err := g.SetView("options", -1, optionsTop, width, optionsTop+2, 0); err != nil { + version := Rev + if version == "" { + version = "unversioned" + } + + if v, err := g.SetView("options", -1, optionsTop, width-len(version)-2, optionsTop+2, 0); err != nil { if err != gocui.ErrUnknownView { return err } v.BgColor = gocui.ColorDefault v.FgColor = gocui.ColorBlue v.Frame = false - v.Title = "Options" + } + + if v, err := g.SetView("version", width-len(version)-1, optionsTop, width, optionsTop+2, 0); err != nil { + if err != gocui.ErrUnknownView { + return err + } + v.BgColor = gocui.ColorDefault + v.FgColor = gocui.ColorGreen + v.Frame = false + renderString(g, "version", version) // these are only called once handleFileSelect(g, filesView) From 456c593c725768a1f04f609e223e23a95ba4f846 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Wed, 8 Aug 2018 08:49:37 +1000 Subject: [PATCH 09/12] Update README.md --- README.md | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index ab93f89bc..cf98e035c 100644 --- a/README.md +++ b/README.md @@ -9,16 +9,20 @@ Are YOU tired of typing every git command directly into the terminal, but you're ![Gif](https://image.ibb.co/mmeXho/optimisedgif.gif) ## Installation + +### Via binary release +You can download a binary release [here](https://github.com/jesseduffield/lazygit/releases) +You may need to grant execute permission via `chmod +x ./`. +You can move this file to your local /bin directory and rename to `lazygit` so that you can run it anywhere +(Easier-install coming soon) + +### Via Go In a terminal call this command: `go get github.com/jesseduffield/lazygit` (if you don't have Go installed, you can follow the installation guide [here](https://golang.org/doc/install). -Then just call `lazygit` in your terminal inside a git repository. - -If you want, you can also add an alias for this with `echo "alias lg='lazygit'" >> ~/.zshrc` (or whichever rc file you're using). - Please note: -If you get an error claiming that lazygit cannot be found or is not defined, you may need to add `~/go/bin` to your $PATH (MacOS/Linux), or `%HOME%\go\bin` (Windows) +If you get an error claiming that lazygit cannot be found or is not defined, you may need to add `~/go/bin` to your $PATH (MacOS/Linux), or `%HOME%\go\bin` (Windows). Not to be mistaked for `C:\Go\bin` (which is for Go's own binaries, not apps like Lazygit) ### Ubuntu Packages for Ubuntu 16.04 and up are available via Launchpad PPA. @@ -31,6 +35,13 @@ sudo apt-get update sudo apt-get install lazygit ``` + +## Usage +Call `lazygit` in your terminal inside a git repository. +If you want, you can also add an alias for this with `echo "alias lg='lazygit'" >> ~/.zshrc` (or whichever rc file you're using). +Basic tutorial [Here](https://www.youtube.com/watch?v=VDXvbHZYeKY) +[Keybindings](https://github.com/jesseduffield/lazygit/blob/master/docs/Keybindings.md) + ## Cool features - Adding files easily - Resolving merge conflicts @@ -45,14 +56,12 @@ sudo apt-get install lazygit ### Viewing commit diffs ![Viewing Commit Diffs](https://image.ibb.co/gPD02o/capture.png) -## Docs -[Keybindings](https://github.com/jesseduffield/lazygit/blob/master/docs/Keybindings.md) - ## Milestones - [ ] Easy Installation (homebrew, release binaries) - [ ] Configurable Keybindings - [ ] Configurable Color Themes - [ ] Spawning Subprocesses (help needed - have a look at https://github.com/jesseduffield/lazygit/pull/18) +- [ ] Maintainability - [ ] Performance - [ ] i18n From c4c27262f29925e3b9b01e02a845a5f3974f1c94 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Wed, 8 Aug 2018 18:02:18 +1000 Subject: [PATCH 10/12] allow go 1.7 to fail --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 808724b01..10c1fde1c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,7 @@ matrix: - go: tip allow_failures: - go: tip + - go: 1.7 before_install: # Download the binary to bin folder in $GOPATH # - curl -L -s https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-386 -o $GOPATH/bin/dep From c6aee678c0be1192f5d09a9346430b9e1c5f52ff Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Wed, 8 Aug 2018 18:57:03 +1000 Subject: [PATCH 11/12] bump dep --- Gopkg.lock | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index e6981327e..9a564e42a 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -2,10 +2,10 @@ [[projects]] - digest = "1:865079840386857c809b72ce300be7580cb50d3d3129ce11bf9aa6ca2bc1934a" + digest = "1:ade392a843b2035effb4b4a2efa2c3bab3eb29b992e98bacf9c898b0ecb54e45" name = "github.com/fatih/color" packages = ["."] - pruneopts = "UT" + pruneopts = "NUT" revision = "5b77d2a35fb0ede96d138fc9a99f5c9b6aef11b4" version = "v1.7.0" @@ -14,55 +14,55 @@ digest = "1:4a8ed9b8cf22bd03bee5d74179fa06a282e4a73b6de949f7a865ff56cd2537e0" name = "github.com/golang-collections/collections" packages = ["stack"] - pruneopts = "UT" + pruneopts = "NUT" revision = "604e922904d35e97f98a774db7881f049cd8d970" [[projects]] branch = "master" - digest = "1:f086cf183e423bf1926f4de05f47bf57132fe5db9c99e464f733ce925280fc81" + digest = "1:82b3bbc50ba7b6065b0229ebf0fc990a76e47410acd510294e435aeb3523293e" name = "github.com/jesseduffield/gocui" packages = ["."] - pruneopts = "UT" + pruneopts = "NUT" revision = "3c923f53ac9952af649af04a067405843558d56f" [[projects]] - digest = "1:c658e84ad3916da105a761660dcaeb01e63416c8ec7bc62256a9b411a05fcd67" + digest = "1:08c231ec84231a7e23d67e4b58f975e1423695a32467a362ee55a803f9de8061" name = "github.com/mattn/go-colorable" packages = ["."] - pruneopts = "UT" + pruneopts = "NUT" revision = "167de6bfdfba052fa6b2d3664c8f5272e23c9072" version = "v0.0.9" [[projects]] - digest = "1:d4d17353dbd05cb52a2a52b7fe1771883b682806f68db442b436294926bbfafb" + digest = "1:bc4f7eec3b7be8c6cb1f0af6c1e3333d5bb71072951aaaae2f05067b0803f287" name = "github.com/mattn/go-isatty" packages = ["."] - pruneopts = "UT" + pruneopts = "NUT" revision = "0360b2af4f38e8d38c7fce2a9f4e702702d73a39" version = "v0.0.3" [[projects]] - digest = "1:e2d1d410fb367567c2b53ed9e2d719d3c1f0891397bb2fa49afd747cfbf1e8e4" + digest = "1:cb591533458f6eb6e2c1065ff3eac6b50263d7847deb23fc9f79b25bc608970e" name = "github.com/mattn/go-runewidth" packages = ["."] - pruneopts = "UT" + pruneopts = "NUT" revision = "9e777a8366cce605130a531d2cd6363d07ad7317" version = "v0.0.2" [[projects]] branch = "master" - digest = "1:c9b6e36dbd23f8403a04493376916ca5dad8c01b2da5ae0a05e6a468eb0b6f24" + digest = "1:34d9354c2c5d916c05864327553047df59fc10e86ff1f408e4136eba0a25a5ec" name = "github.com/nsf/termbox-go" packages = ["."] - pruneopts = "UT" + pruneopts = "NUT" revision = "5c94acc5e6eb520f1bcd183974e01171cc4c23b3" [[projects]] branch = "master" - digest = "1:9ec6ad2659635ba0974dd7e55bf84233523eb4e7535c9a2fddaefc4cc62a3eac" + digest = "1:4d8a79fbc6fa348fc94afa4235947c5196b7900ed71b94aa5fcbc7e273d150e1" name = "golang.org/x/sys" packages = ["unix"] - pruneopts = "UT" + pruneopts = "NUT" revision = "0ffbfd41fbef8ffcf9b62b0b0aa3a5873ed7a4fe" [solve-meta] From fbadbdd771985745f46406aaf5ce0ed4c7c35ff7 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Wed, 8 Aug 2018 18:57:27 +1000 Subject: [PATCH 12/12] version with tag --- .travis.yml | 2 +- gui.go | 11 +++-------- main.go | 14 ++++++++++---- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index 10c1fde1c..c85fc4806 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,7 +26,7 @@ script: # - go get -v ./... # - diff -u <(echo -n) <(gofmt -d .) # can't make gofmt ignore vendor directory # - go vet $(go list ./... | grep -v /vendor/) - - if [ "${LATEST}" = "true" ]; then gox -os="linux darwin windows" -arch="amd64" -ldflags "-X main.Rev=`git rev-parse --short HEAD` -X main.builddate=`date -u +%Y%m%d.%H%M%S`" -verbose ./...; fi + - if [ "${LATEST}" = "true" ]; then gox -os="linux darwin windows" -arch="amd64" -ldflags "-X main.Rev=`git rev-parse --short HEAD` -X main.builddate=`date -u +%Y%m%d.%H%M%S` -X main.Version=${TRAVIS_TAG}" -verbose ./...; fi - mv lazygit_windows_amd64.exe lazygit_windows_amd64_${TRAVIS_TAG}.exe - mv lazygit_darwin_amd64 lazygit_darwin_amd64_${TRAVIS_TAG} - mv lazygit_linux_amd64 lazygit_linux_amd64_${TRAVIS_TAG} diff --git a/gui.go b/gui.go index 0f9e93167..85614a14c 100644 --- a/gui.go +++ b/gui.go @@ -225,12 +225,7 @@ func layout(g *gocui.Gui) error { v.FgColor = gocui.ColorWhite } - version := Rev - if version == "" { - version = "unversioned" - } - - if v, err := g.SetView("options", -1, optionsTop, width-len(version)-2, optionsTop+2, 0); err != nil { + if v, err := g.SetView("options", -1, optionsTop, width-len(Version)-2, optionsTop+2, 0); err != nil { if err != gocui.ErrUnknownView { return err } @@ -239,14 +234,14 @@ func layout(g *gocui.Gui) error { v.Frame = false } - if v, err := g.SetView("version", width-len(version)-1, optionsTop, width, optionsTop+2, 0); err != nil { + if v, err := g.SetView("version", width-len(Version)-1, optionsTop, width, optionsTop+2, 0); err != nil { if err != gocui.ErrUnknownView { return err } v.BgColor = gocui.ColorDefault v.FgColor = gocui.ColorGreen v.Frame = false - renderString(g, "version", version) + renderString(g, "version", Version) // these are only called once handleFileSelect(g, filesView) diff --git a/main.go b/main.go index ba3a55d9e..f900bb051 100644 --- a/main.go +++ b/main.go @@ -12,9 +12,15 @@ import ( ) var ( - startTime time.Time - debugging bool - Rev string + startTime time.Time + debugging bool + + // Rev - Git Revision + Rev string + + // Version - Version number + Version = "unversioned" + builddate string debuggingPointer = flag.Bool("debug", false, "a boolean") versionFlag = flag.Bool("v", false, "Print the current version") @@ -67,7 +73,7 @@ func main() { devLog("\n\n\n\n\n\n\n\n\n\n") flag.Parse() if *versionFlag { - fmt.Printf("rev=%s, build date=%s", Rev, builddate) + fmt.Printf("rev=%s, build date=%s, version=%s", Rev, builddate, Version) os.Exit(0) } verifyInGitRepo()