1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-15 00:15:32 +02:00
Commit Graph

551 Commits

Author SHA1 Message Date
dbdabb34f3 Make "Find base commit for fixup" work with hunks with only added lines
To understand what this does and why, read the design document that I'm about to
add in the next commit.
2024-06-01 08:31:18 +02:00
c1a65546ad Extract a function findCommit
It's not much code, but it turns three lines of code into one, and since we need
to do this a few more times in the next commit, it's worth it.
2024-06-01 08:31:18 +02:00
2c9bca8b57 Return errors from blameDeletedLines instead of just logging them
I guess when I originally wrote this code I just didn't know how to do that...
2024-06-01 08:31:18 +02:00
880528b2e4 Also return hunks with only added lines from parseDiff
We aren't using them, yet, except for deciding whether to show the warning about
hunks with only added lines.

Add a bit of test coverage for parseDiff while we're at it.
2024-06-01 08:31:18 +02:00
e1b4d625c7 Make parseDiff a non-member function so that we can test it more easily 2024-06-01 08:31:18 +02:00
a957c5542f Rename deletedLineInfo to hunk
We'll use it with a more general meaning later in this branch.
2024-06-01 08:31:18 +02:00
1269938ee6 Add user config expandedSidePanelWeight 2024-06-01 08:21:23 +02:00
557dfc5a6d Add test for ExpandFocusedSidePanel config 2024-06-01 08:16:06 +02:00
116c18e957 Use --force instead of --force-with-lease when remote is not stored locally
--force-with-lease simply doesn't work in this case, it will always return a
"stale info" error.
2024-06-01 08:12:45 +02:00
e93617b1de Rename Force to ForceWithLease
This describes better what it is, and we're going to add the regular --force in
the next commit.

No change in behavior in this commit.
2024-06-01 08:12:45 +02:00
aac2535104 Ask to force push if server rejected the update, if remote not stored locally
This broke with 81b497d186 (#3387). In that PR I claimed that we never want to
ask for force-pushing if the server rejected the update, on the assumption that
this can only happen because the remote tracking branch is not up to date, and
users should just fetch in this case. However, I didn't realize it's even
possible to have a branch whose upstream branch is not stored locally; in this
case we can't tell ahead of time whether a force push is going to be necessary,
so we _have_ to rely on the server response to find out. But we only want to do
that in this specific case, so this is not quite an exact revert of 81b497d186.
2024-06-01 08:12:45 +02:00
35af886f55 Refresh branches and reflog independently when sorting branches by date
When branches are sorted by recency we have this logic that first loads the
branches so that they can be rendered quickly; in parallel, it starts loading
the reflog in the background, and when that's done, it loads the branches again
so that they get their recency values. This means that branches are loaded twice
at startup.

We don't need this logic when branches are not sorted by recency, so we can
simply load branches and reflog in parallel like everything else.

This shouldn't change any user observable behavior, it just avoids doing
unnecessary work at startup.
2024-05-29 13:46:53 +02:00
2d0c96466a Fix calculation of tooltip height
For tooltips that are just one or two characters longer than the available
width, the last word would be cut off. On my screen this happened for the
tooltip for the fixup command.
2024-05-26 19:26:27 +02:00
5af0ea85fc feat: focus on local commits view after moving code into new commit 2024-05-20 19:12:38 +02:00
c5cf1b2428 Correctly request force-pushing in triangular workflows
To determine whether we need to ask for force pushing, we need to query the push
branch rather than the upstream branch, in case they are not the same.
2024-05-19 09:44:38 +02:00
0aba686f97 Rename Pushables/Pullables to AheadForPull/BehindForPull
In preparation for adding AheadForPush/BehindForPush in the next commit.
2024-05-19 09:44:38 +02:00
fdff2dec79 Remove redundant variable dedeclarations
In go 1.22, loop variables are redeclared with each iteration of the
loop, rather than simple updated on each iteration. This means that we
no longer need to manually redeclare variables when they're closed over
by a function.
2024-05-19 16:38:21 +10:00
010b0ae923 Show delete/edit keybindings in suggestions subtitle if available 2024-05-19 07:06:18 +02:00
a7041cf492 Allow editing a custom command from the suggestions list by pressing 'e'
For custom commands it is useful to select an earlier command and have it copied
to the prompt for further editing. This can be done by hitting 'e' now.

For other types of suggestion panels we don't enable this behavior, as you can't
create arbitrary new items there that don't already exist as a suggestion.
2024-05-19 07:06:18 +02:00
da3e0f7147 Support deleting items from the custom commands history
In the custom commands panel you can now tab to the suggestions and hit 'd' to
delete items from there. Useful if you mistyped a command and don't want it to
appear in your history any more.
2024-05-19 07:06:18 +02:00
88e7c44552 Fix clicking in status side panel
Seems to have been broken since that big refactoring in March 23.
2024-05-15 13:21:17 +02:00
01ff18dd92 Add commitPrefix for defining a prefix for any project 2024-05-01 19:03:12 +02:00
0677a58e9f chore: fix some comments and typos
Signed-off-by: knowmost <knowmost@outlook.com>
2024-04-28 09:44:59 +02:00
7270dea48d Switch git-todo-parser from fsmiamoto original repo to stefanhaller's fork
Sometimes it takes a while to get PRs accepted upstream, and this blocks our
progress. Since I'm pretty much the only one making changes there anyway, it
makes sense to point to my fork directly.
2024-04-22 20:59:15 +02:00
caad553502 Remove ErrorMsg
There is no reason any more for application code to show error messages in a
panel. Just return an error instead.
2024-04-18 10:10:30 +02:00
653994845e Return error from RefreshOptions.Then 2024-04-18 10:10:30 +02:00
bbad3a70ce Log errors from refresh instead of showing them in a panel
We are already doing this in other cases in this file.
2024-04-18 10:10:30 +02:00
1869fda800 Make OnWorker callback return an error
This lets us get rid of a few more calls to Error(), and it simplifies things
for clients of OnWorker: they can simply return an error from their callback
like we do everywhere else.
2024-04-18 10:10:30 +02:00
5396a70661 Clean up error handling of WithWaitingStatus and WithWaitingStatusSync 2024-04-18 10:10:30 +02:00
82a3d33ce3 Remove calls to Error()
Now that we have an error handler set, we can simply let them bubble up all the
way to gocui.
2024-04-18 10:10:30 +02:00
19bef17042 rename sha to hash 10, last remaining sha (hopefully) 2024-04-12 08:33:47 +02:00
170c4ecb8c rename sha to hash 9, case: Sha 2024-04-12 08:33:47 +02:00
de1c495704 rename sha to hash 8, update some log and comment 2024-04-12 08:33:47 +02:00
05fb12b1d5 rename sha to hash 6, update short hash 2024-04-12 08:33:47 +02:00
9cf1ca10a2 rename sha to hash 5 2024-04-12 08:33:47 +02:00
13af335b37 rename sha to hash 3 2024-04-12 08:33:47 +02:00
92aab21d3a rename sha to hash 2 2024-04-12 08:33:47 +02:00
e6ef1642fa rename sha to hash 2024-04-12 08:33:47 +02:00
84333eebc3 renaming variable to CommitHash 2024-04-12 08:33:47 +02:00
7f6eea2a55 standardize 'Commit Sha' to 'Commit Hash' 2024-04-12 08:31:40 +02:00
5616d6a9bc Dynamic copyright year 2024-04-10 17:38:57 +02:00
2b5c814080 Add StatusPanelView config 2024-04-10 17:38:57 +02:00
f933a2f7ec Replace min/max helpers with built-in min/max
We upgraded our minimum Go version to 1.21 in commit
57ac9c2189. We can now replace our
`utils.Min` and `utils.Max` functions with the built-in `min` and `max`.

Reference: https://go.dev/ref/spec#Min_and_max
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2024-04-07 23:24:10 +08:00
f3dba743f0 Add SpinnerConfig
This new config section allows to customize frames and rate of
thespinner
2024-04-06 13:46:15 +02:00
5d509efe19 Underline links in confirmation panels 2024-03-29 10:55:33 +01:00
6396d1ce03 Extract a function HandleGenericClick 2024-03-29 10:55:33 +01:00
42ebf1947a Cleanup: simplify return statements 2024-03-28 13:11:08 +01:00
c995e7ef2e Cleanup: remove pointless condition and error message
The file .git/info/exclude can't possibly show up in the files panel.
2024-03-28 13:11:08 +01:00
bd8518355e Keep the same commit selected when exiting filtering mode
When exiting filtering mode, we currently keep the selection index the same in
the commits panel. This doesn't make sense at all, since the index in the
filtered view has no relation to the index in the unfiltered view.

I often use filtering mode (either by path or by author) to find a given commit
faster than I would otherwise be able to. When exiting filtering mode, it's
useful to keep the same commit selected, so that I can look at the surrounding
commits, see which branch it was a part of, etc. So reselect the commit again
after exiting filtering mode.

Sometimes this is not possible, most likely when the commit is so long ago that
it's outside of the initial 300 range. In that case, at least select the commit
again that was selected before I entered filtering; this is still better than
arbitrarily keeping the same selection index.
2024-03-28 12:23:46 +01:00
471ea39758 Fix inline status removal when recording demos 2024-03-23 20:45:51 +11:00