1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-11 12:48:10 +03:00
Commit Graph

324 Commits

Author SHA1 Message Date
d0336fe16f better presentation of remotes 2020-03-28 11:59:45 +11:00
198d237679 more centralised handling of refreshing 2020-03-28 11:59:45 +11:00
fbbd16bd82 use reflogs from state to work out branch recencies 2020-03-28 11:59:45 +11:00
bd2c1eef53 remove redundant fetch of reflog 2020-03-28 11:59:45 +11:00
d1395b15bb use GIT_EDITOR 2020-03-27 19:26:14 +11:00
2d8ed5e274 *: update go-git import 2020-03-27 19:06:21 +11:00
f2036b42e5 only load new reflog entries 2020-03-26 21:44:33 +11:00
d027cf969c better handling of current branch name 2020-03-26 20:37:06 +11:00
0e23f44b84 support reflog action prefix 2020-03-25 09:39:04 +11:00
f80d15062b use reflog undo history pointer 2020-03-25 09:39:04 +11:00
3d3e0be7bd more compatible commands 2020-03-23 22:33:17 +11:00
1be0ff8da7 better upstream tracking and allow renaming a branch 2020-03-18 21:29:06 +11:00
19146d61b1 use selected branch as base when creating a new branch 2020-03-08 18:44:15 +11:00
6ca08c6519 make branches and files non-ambiguous for git-log
fixes #694
2020-03-06 09:25:31 +11:00
0fc58a7986 fix test 2020-03-04 00:12:23 +11:00
54241d8ab9 more generic way of supporting custom pagers 2020-03-04 00:12:23 +11:00
355f1615ab supporing custom pagers step 1 2020-03-04 00:12:23 +11:00
bf946200e9 Fix OutOfBound array access when looking for ReflogCommits
refs #679
2020-02-27 09:34:40 +11:00
02c497fad6 show file list when diffing commits 2020-02-25 21:38:38 +11:00
370cec098b show diff stat 2020-02-24 09:20:50 +11:00
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
66e6369c28 allow fastforwarding the current branch 2020-02-18 23:07:38 +11:00
9f5397a2d4 Moved function to git.go
Signed-off-by: Glenn Vriesman <glenn.vriesman@gmail.com>
2020-02-06 23:19:29 +11:00
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
4cb50b15e4 make amend more non-interactive 2020-02-02 11:29:22 +11:00
44edb49a6e handle files that were deleted downstream but modified upstream 2020-01-29 19:07:47 +11:00
c166c57c5d make use of branch config when pushing/pulling 2020-01-29 15:19:19 +11:00
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
9b32e99eb8 add reflog tab in commits panel 2020-01-09 22:36:07 +11:00
09aabce3cd allow commits to be checked out 2020-01-07 20:43:01 +11:00
eb2bfd3848 allow hard resetting to upstream branch 2020-01-07 20:26:01 +11:00
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
3f4613feb0 allow fetching remotes with 'f' 2019-12-07 16:23:04 +11:00
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
67a446234c fix specs 2019-11-21 22:07:14 +11:00
e36ee0b4f1 give RunCommand the same input signature as fmt.Sprintf 2019-11-21 22:07:14 +11:00
3c13229145 add tags panel 2019-11-21 22:07:14 +11:00
cea24c2cf9 allow editing remotes 2019-11-21 22:07:14 +11:00
07cbae4019 support setting upstream 2019-11-21 22:07:14 +11:00
b42202ea1c better fast forward 2019-11-21 22:07:14 +11:00
a9cd647075 support deleting remote branches 2019-11-21 22:07:14 +11:00
2afbd7ba7f support merging remote branches into checked out branch 2019-11-21 22:07:14 +11:00
55ff0c0dee support detached heads when showing the selected branch 2019-11-21 22:07:14 +11:00
6b7aaeca45 support adding/removing remotes 2019-11-21 22:07:14 +11:00
325408d0e3 get remote branches when getting remotes 2019-11-21 22:07:14 +11:00
eeb667954f trying to use gogit with branches from remotes 2019-11-21 22:07:14 +11:00
092f27495a add remote model 2019-11-21 22:07:14 +11:00
3b1d705473 show upstream branch for branch 2019-11-13 22:25:42 +11:00
f43ba728e3 prompt to set upstream when pulling on untracked branch
prompt to set upstream when pulling on untracked branch
2019-11-13 21:36:16 +11:00
12b84307ac specify upstream when pushing a branch for the first time 2019-11-11 23:30:30 +11:00