Comments (12)
The following patch seems to have been enough to get the software up and running for me, should anyone want a stopgap until a proper fix is available:
diff --git a/gitcommands.go b/gitcommands.go
index 50c1f2a..63d2ffa 100644
--- a/gitcommands.go
+++ b/gitcommands.go
@@ -116,7 +116,7 @@ func platformShell() (string, string) {
if runtime.GOOS == "windows" {
return "cmd", "/c"
}
- return "sh", "-c"
+ return "bash", "-c"
}
func runDirectCommand(command string) (string, error) {
from lazygit.
thanks @tswsl1989 :) I switched to sh thinking it would increase compatibility but it seems it's had the opposite effect! I've added that change to the PR that should fix the underlying issue here #60
Feel free to give it a review
from lazygit.
hmm, it shouldn't be showing that error like that anymore. It looks like you're up to date in terms of the lazygit repo. Could you try running go install github.com/jesseduffield/lazygit
to build the latest version?
from lazygit.
you shouldn't be using [[
bashism at all. its not posix.
from lazygit.
Seeing same issue on f8ca0dd with ubuntu 1804 (using fish shell, not zsh, but bash
doesn't work either).
from lazygit.
The culprit is this script here which gets your branches in reverse chronological order along with their relative last commit time.
set -e
git reflog -n100 --pretty='%cr|%gs' --grep-reflog='checkout: moving' HEAD | {
seen=":"
git_dir="$(git rev-parse --git-dir)"
while read line; do
date="${line%%|*}"
branch="${line##* }"
if ! [[ $seen == *:"${branch}":* ]]; then
seen="${seen}${branch}:"
if [ -f "${git_dir}/refs/heads/${branch}" ]; then
printf "%s\t%s\n" "$date" "$branch"
fi
fi
done \
| sed 's/ months /m /g' \
| sed 's/ month /m /g' \
| sed 's/ days /d /g' \
| sed 's/ day /d /g' \
| sed 's/ weeks /w /g' \
| sed 's/ week /w /g' \
| sed 's/ hours /h /g' \
| sed 's/ hour /h /g' \
| sed 's/ minutes /m /g' \
| sed 's/ minute /m /g' \
| sed 's/ seconds /s /g' \
| sed 's/ second /s /g' \
| sed 's/ago//g' \
| tr -d ' '
}
example output:
19h feature/better-file-opening
65m master
65m feature/use-dep
3h hotfix/windows-support
5h feature/fetching-without-checking-out
2w develop
24h feature/gpgsign-support
23h feature/no-panic-on-git-commit-error
9h hotfix/latency
30h feature/refactor-directory-structure
26h feature/better-contrast
2d feature/set-upstream-on-push
2d feature/testing-setting-upstream
2d feature/tutorial6
It's probably the weakest part of the codebase, not the least because it hasn't been written in go. If anybody can put up a PR that cleans this guy up or refactors it out into just git commands and Go, I would very much appreciate it! I'll spend some time right now seeing if I can refactor it
from lazygit.
Beware, the go installer still install the buggy version (I tried a few minutes ago).
And, going to sh
do improve portability (especially on plate-forms that do not have bash by default), but you have to care about the fact that all your shell commands are POSIX compliant (these [[
in place of test
have to be avoided).
from lazygit.
@perror I just merged the PR to master, that ugly bash script is now out of the codebase. Let me know if there are still any issues
from lazygit.
It works like a charm now! :) Just did a go get -u lazygit
and it was enough.
Thanks!
from lazygit.
you should revert to using sh
instead of bash
, unless you want to have hard dependency on bash. and from i can see you only use it as a command launcher so its redundant anyway.
from lazygit.
This issue seems to be resolved, tested on 16.04 after this referenced pull request merge.
from lazygit.
problem solved after update to latest version:) Thanks @jesseduffield !
from lazygit.
Related Issues (20)
- Discoverability
- More attention-grabbing inline loaders
- LazyGit does not open inside a symlink'ed dir (which is under git) HOT 1
- Wrong commit renamed when search pattern exists HOT 2
- Commit icon and Branch icon display wrong. HOT 2
- pre-commit not found even if present in python virtual environment
- Missing Linux_x86_64 release for v0.40.2 HOT 2
- Pasting multiple lines into commit summary field executes commands HOT 5
- bug: reflog timezone offset is wrong. HOT 2
- .SelectedFile.Name not recognized in commitFiles context HOT 14
- "Todo not found in git-rebase-todo" error when we try to drop merge commit HOT 2
- Save git.log.showGraph and git.log.order in state.yml instead of config.yml
- View stash creation date HOT 6
- Cherry picking specific files from a commit? HOT 2
- Broken interface in Konsole and Yakuake HOT 1
- Push progress
- Crash from lazygit with $GIT_DIR set and $GIT_WORK_TREE unset HOT 1
- Disable responding to keys when there is not enough space to render the UI HOT 1
- Remote tags HOT 3
- Pull doesn't work from v0.39.1 since fetchAll is enabled by default HOT 33
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lazygit.