1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-12-02 09:21:40 +02:00
Commit Graph

358 Commits

Author SHA1 Message Date
Corentin Rossignon
bf946200e9 Fix OutOfBound array access when looking for ReflogCommits
refs #679
2020-02-27 09:34:40 +11:00
Jesse Duffield
890cc87724 fix bug where commits appeared as green despite not being pushed 2020-02-27 09:33:09 +11:00
Jesse Duffield
02c497fad6 show file list when diffing commits 2020-02-25 21:38:38 +11:00
Jesse Duffield
f94d0be2c9 refactor the way we render lists 2020-02-25 21:21:07 +11:00
Jesse Duffield
9fd9fd6816 better commit lines in fullscreen mode 2020-02-25 21:21:07 +11:00
Jesse Duffield
0034cfef5c show tags in commits panel 2020-02-24 23:13:54 +11:00
Jesse Duffield
370cec098b show diff stat 2020-02-24 09:20:50 +11:00
Jesse Duffield
fabdda0492 allow customizing background color in staging mode 2020-02-23 18:37:19 +11:00
Glenn Vriesman
6fc3290a05 Reflog: Use 20 sha digits instead of 7
Signed-off-by: Glenn Vriesman <glenn.vriesman@gmail.com>
2020-02-20 08:34:01 +11:00
Jesse Duffield
66e6369c28 allow fastforwarding the current branch 2020-02-18 23:07:38 +11:00
Jesse Duffield
71e018a3dd get whole commit SHA from rebase commits 2020-02-13 18:10:14 +11:00
Glenn Vriesman
d9eb6e2682 Fixed tests
Signed-off-by: Glenn Vriesman <glenn.vriesman@gmail.com>
2020-02-09 23:47:22 +11:00
Glenn Vriesman
b74107f2ba Use 8 instead of 7 digit long sha
Signed-off-by: Glenn Vriesman <glenn.vriesman@gmail.com>
2020-02-09 23:47:22 +11:00
Glenn Vriesman
0cd91a10c6 Increase internal sha size
This does not change the sha size that is displayed to the user

Signed-off-by: Glenn Vriesman <glenn.vriesman@gmail.com>
2020-02-09 23:47:22 +11:00
Glenn Vriesman
9f5397a2d4 Moved function to git.go
Signed-off-by: Glenn Vriesman <glenn.vriesman@gmail.com>
2020-02-06 23:19:29 +11:00
Glenn Vriesman
5f53d50492 Check cached when showing new file diffs
Signed-off-by: Glenn Vriesman <glenn.vriesman@gmail.com>
2020-02-04 08:41:41 +11:00
Chris Taylor
c6cb90e8ca verify that VISUAL,EDITOR,LGCC envvars are set for non-interactive commands 2020-02-02 11:29:22 +11:00
Chris Taylor
75ba2196ba perpetuate this style of dependency injection 2020-02-02 11:29:22 +11:00
Chris Taylor
4cb50b15e4 make amend more non-interactive 2020-02-02 11:29:22 +11:00
Jesse Duffield
44edb49a6e handle files that were deleted downstream but modified upstream 2020-01-29 19:07:47 +11:00
Jesse Duffield
c166c57c5d make use of branch config when pushing/pulling 2020-01-29 15:19:19 +11:00
Jesse Duffield
6b77e4ee4a fix comment 2020-01-28 22:18:55 +11:00
Jesse Duffield
e5534f060d use reflog timestamps rather than commit timestamps to show commit recency 2020-01-28 22:12:48 +11:00
Jesse Duffield
23bcc19180 allow fast flicking through any list panel
Up till now our approach to rendering things like file diffs, branch logs, and
commit patches, has been to run a command on the command line, wait for it to
complete, take its output as a string, and then write that string to the main
view (or secondary view e.g. when showing both staged and unstaged changes of a
file).

This has caused various issues. For once, if you are flicking through a list of
files and an untracked file is particularly large, not only will this require
lazygit to load that whole file into memory (or more accurately it's equally
large diff), it also will slow down the UI thread while loading that file, and
if the user continued down the list, the original command might eventually
resolve and replace whatever the diff is for the newly selected file.

Following what we've done in lazydocker, I've added a tasks package for when you
need something done but you want it to cancel as soon as something newer comes
up. Given this typically involves running a command to display to a view, I've
added a viewBufferManagerMap struct to the Gui struct which allows you to define
these tasks on a per-view basis.

viewBufferManagers can run files and directly write the output to their view,
meaning we no longer need to use so much memory.

In the tasks package there is a helper method called NewCmdTask which takes a
command, an initial amount of lines to read, and then runs that command, reads
that number of lines, and allows for a readLines channel to tell it to read more
lines. We read more lines when we scroll or resize the window.

There is an adapter for the tasks package in a file called tasks_adapter which
wraps the functions from the tasks package in gui-specific stuff like clearing
the main view before starting the next task that wants to write to the main
view.

I've removed some small features as part of this work, namely the little headers
that were at the top of the main view for some situations. For example, we no
longer show the upstream of a selected branch. I want to re-introduce this in
the future, but I didn't want to make this tasks system too complicated, and in
order to facilitate a header section in the main view we'd need to have a task
that gets the upstream for the current branch, writes it to the header, then
tells another task to write the branch log to the main view, but without
clearing inbetween. So it would get messy. I'm thinking instead of having a
separate 'header' view atop the main view to render that kind of thing (which
can happen in another PR)

I've also simplified the 'git show' to just call 'git show' and not do anything
fancy when it comes to merge commits.

I considered using this tasks approach whenever we write to a view. The only
thing is that the renderString method currently resets the origin of a view and
I don't want to lose that. So I've left some in there that I consider harmless,
but we should probably be just using tasks now for all rendering, even if it's
just strings we can instantly make.
2020-01-12 11:17:20 +11:00
Jesse Duffield
282f08df36 lazyload commits 2020-01-12 10:10:56 +11:00
Jesse Duffield
9b32e99eb8 add reflog tab in commits panel 2020-01-09 22:36:07 +11:00
Jamie Brynes
aea4661be5 escape editor path 2020-01-08 22:24:36 +11:00
Jesse Duffield
09aabce3cd allow commits to be checked out 2020-01-07 20:43:01 +11:00
Jesse Duffield
eb2bfd3848 allow hard resetting to upstream branch 2020-01-07 20:26:01 +11:00
Jamie Brynes
5e45ae1584 fix applying patch on Windows machine
This bug was caused how the timestamp was formatted for the patch file.

On Windows machines, ":" is an invalid character for a filename, but the
`stampNano` format for time contains ":".

This fix adjusts the time format to be the `stampNano` format with "."
subsituted for ":".
2020-01-05 20:01:20 +00:00
Jesse Duffield
3f4613feb0 allow fetching remotes with 'f' 2019-12-07 16:23:04 +11:00
Jesse Duffield
339e1b5dcf lenient sorting of tags on startup 2019-11-26 21:39:40 +11:00
Jesse Duffield
7113ed73d4 support older versions of git when getting remote branches 2019-11-26 21:36:07 +11:00
Jesse Duffield
3dd1daacdc unescape another string 2019-11-21 22:17:18 +11:00
Jesse Duffield
e18e81f5eb don't pass single commands directly to RunCommand (or equivalent function)
when it contains percentages.

This is a really strange one. It's a linting warning in my editor
and it doesn't stop me from compiling, but it breaks `go test`.

A basic file to reproduce what I'm talking about:

package main

import "fmt"

func main() {
	notSprintf("test %s") // compiler complains here thinking %s needs a corresponding argument
}

func notSprintf(formatStr string, formatArgs ...interface{}) string {
	if formatArgs != nil {
		return formatStr
	}
	return fmt.Sprintf(formatStr, formatArgs...)
}
2019-11-21 22:07:14 +11:00
Jesse Duffield
67a446234c fix specs 2019-11-21 22:07:14 +11:00
Jesse Duffield
f905b27b00 couple of things to clean up after rebasing onto master 2019-11-21 22:07:14 +11:00
Jesse Duffield
e36ee0b4f1 give RunCommand the same input signature as fmt.Sprintf 2019-11-21 22:07:14 +11:00
Jesse Duffield
3c13229145 add tags panel 2019-11-21 22:07:14 +11:00
Jesse Duffield
cea24c2cf9 allow editing remotes 2019-11-21 22:07:14 +11:00
Jesse Duffield
07cbae4019 support setting upstream 2019-11-21 22:07:14 +11:00
Jesse Duffield
b42202ea1c better fast forward 2019-11-21 22:07:14 +11:00
Jesse Duffield
a9cd647075 support deleting remote branches 2019-11-21 22:07:14 +11:00
Jesse Duffield
2afbd7ba7f support merging remote branches into checked out branch 2019-11-21 22:07:14 +11:00
Jesse Duffield
55ff0c0dee support detached heads when showing the selected branch 2019-11-21 22:07:14 +11:00
Jesse Duffield
6b7aaeca45 support adding/removing remotes 2019-11-21 22:07:14 +11:00
Jesse Duffield
1f3e1720a3 split RemoteBranch out from Branch 2019-11-21 22:07:14 +11:00
Jesse Duffield
b7f2d0366b get branches with git for-each-ref 2019-11-21 22:07:14 +11:00
Jesse Duffield
b5385f2560 remove redundant logging 2019-11-21 22:07:14 +11:00
Jesse Duffield
325408d0e3 get remote branches when getting remotes 2019-11-21 22:07:14 +11:00