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

1692 Commits

Author SHA1 Message Date
yk-kd
b5d612e6d6
Add border config (#2344)
Co-authored-by: yk-kd <yosuke.komada@gmail.com>
2023-03-18 11:23:31 +11:00
Stefan Haller
4bd1322941 Rename WillBeAppliedReverse to Reverse
This is the only "reverse"-related option that is left, so use a less clumsy
name for it.
2023-03-07 13:40:07 +01:00
Stefan Haller
45cf993982 Remove the PatchOptions.Reverse option
All callers pass false now (except for the tests, which we simply remove), so we
don't need the option any more.
2023-03-07 13:39:45 +01:00
Stefan Haller
e4659145e8 Use WillBeAppliedReverse (and git apply --reverse) in the staging panel too
It's simpler to have only one way of reversing a patch.
2023-03-07 13:38:19 +01:00
Stefan Haller
6bd1c1d068 Remove parameters that are no longer needed
All callers in this file now use reverseOnGenerate=false and
keepOriginalHeader=true, so hard-code that in the call to ModifiedPatchForLines
and get rid of the parameters.
2023-03-07 09:49:34 +01:00
Stefan Haller
9cc33c479b Use forward patches and --reverse flag for partial patches too
There's no reason to have two different ways of applying patches for whole-file
patches and partial patches; use --reverse for both. Not only does this simplify
the code a bit, but it fixes an actual problem: when reverseOnGenerate and
keepOriginalHeader are both true, the generated patch header is broken (the two
blobs in the line `index 6d1959b..6dc5f84 100644` are swapped). Git fails to do
a proper three-way merge in that case, as it expects the first of the two blobs
to be the common ancestor.

It would be possible to fix this by extending ModifiedPatchForLines to swap the
two blobs in this case; but this would prevent us from concatenating all patches
and apply them in one go, which we are going to do later in the branch.
2023-03-07 09:49:34 +01:00
Stefan Haller
f76cc27956 Bundle the reverse and keepOriginalHeader flags into a PatchOptions struct
We are going to add one more flag in the next commit.

Note that we are not using the struct inside patch_manager.go; we keep passing
the individual flags there. The reason for this will become more obvious later
in this branch.
2023-03-07 09:49:34 +01:00
Jesse Duffield
c36333af3d
Merge pull request #2433 from Ryooooooga/subcommits-limit 2023-03-06 18:22:57 +11:00
Stefan Haller
723504a290 Keep side context in context stack when pushing a main context
This fixes accordion mode for the commit files panel. When entering a file, the
commit files panel should stay expanded.
2023-03-04 15:07:48 +01:00
Stefan Haller
de3e4838ad Store WorkingTreeState in model
This is the working tree state at the time the model commits were loaded. This
avoids a visual glitch with the "You Are Here" label appearing at times when it
is not supposed to.
2023-03-01 09:12:00 +01:00
Stefan Haller
6af8f278d0 Don't put "<--- YOU ARE HERE" in the commit model's name
Instead, derive it from context at display time (if we're rebasing, it's the
first non-todo commit). This fixes the problem that unfolding the current
commit's files in the local commits panel would show junk in the frame's title.

Along the way we make sure to only display the "<--- YOU ARE HERE" string in the
local commits panel; previously it would show for the top commit of a branch or
tag if mid-rebase.
2023-03-01 09:12:00 +01:00
Jesse Duffield
af7c71d1ee
Merge pull request #2476 from pereBohigas/feature/add_kotlin_icon 2023-02-28 10:11:47 +11:00
Ryooooooga
a624e0457f
feat(subcommits): load unlimited sub-commits 2023-02-27 15:29:00 +09:00
Pere Bohigas
adef3bd4ca Add icon for Kotlin script files 2023-02-25 15:14:26 +01:00
Jesse Duffield
dd1bf629b8 migrate patch building tests 2023-02-25 21:37:16 +11:00
Pere Bohigas
c80a94aa7a Add icon for Kotlin files 2023-02-25 10:51:43 +01:00
Jesse Duffield
037e957282 fix PullMergeConflict integration test 2023-02-25 11:39:24 +11:00
Jesse Duffield
db011d8e34 Improve staging panel integration tests 2023-02-25 11:35:41 +11:00
Jesse Duffield
78f3a7a478 migrate interactive rebase integration tests 2023-02-22 19:36:31 +11:00
Jesse Duffield
56424eb1aa remove x keybinding for opening menu so we now only use '?' 2023-02-20 19:28:45 +11:00
Jesse Duffield
38c7030b0f mention path in tooltips 2023-02-20 19:28:45 +11:00
Luka Markušić
31b8524fe6 Add tooltips for discarding 2023-02-20 19:28:45 +11:00
Luka Markušić
0ae34aeeb7 Make discarding items less error prone
The menu is opened by `d` so this makes it harder to mess things up by
accidentally pressing `dd`.
2023-02-20 19:28:45 +11:00
Jesse Duffield
e1c376ef54
Merge pull request #2453 from stefanhaller/allow-rebasing-to-first-commit 2023-02-20 19:21:37 +11:00
Jesse Duffield
0b55eaca1d add create tag from commit test 2023-02-20 19:01:08 +11:00
Jesse Duffield
39c56553b3 show tag message 2023-02-20 19:01:08 +11:00
Stefan Haller
c5cd217a65 Allow squashing fixups above the first commit of a repo
This includes amending changes into a given commit, since that's implemented in
terms of the former.
2023-02-20 08:29:43 +01:00
Jesse Duffield
9e1e20fef2
Merge pull request #2421 from Ryooooooga/tag-on-branch 2023-02-20 18:20:16 +11:00
Stefan Haller
dd61c49a15 Better error message for trying to squash or fixup the first commit
It's not so much the total number of commits that matters here, it's just
whether we are on the first one. (This includes the other condition.)

This allows us to get rid of the condition in rebase.go.
2023-02-20 07:40:04 +01:00
Ryooooooga
67b08ac239
feat: support to create tag on branch 2023-02-19 23:31:46 +09:00
Stefan Haller
67b8ef449c Edit by breaking after current commit
Instead of rebasing from the commit below the current one and then setting the
current one to "edit", we rebase from the current one and insert a "break" after
it. In most cases the behavior is exactly the same as before, except that the
new method also works if the current commit is a merge commit. This is useful if
you want to create a new commit at the very beginning of your branch (by editing
the last commit before your branch).
2023-02-19 10:21:01 +01:00
Jesse Duffield
65bd0ab431 migrate undo test 2023-02-19 15:48:09 +11:00
Jesse Duffield
a51f64814c show snapshot of lazygit when test fails for easier investigation 2023-02-19 15:48:09 +11:00
Jesse Duffield
bff076c70a rename key to Pull 2023-02-19 11:42:00 +11:00
stk
4d39668743 Undo a change made in #2444 that we didn't end up needing 2023-02-18 09:53:31 +01:00
Jesse Duffield
c517d1e0a2 update view cursor when selecting new line in patch explorer view 2023-02-18 10:19:34 +11:00
stk
8cad8cda8f Don't bother setting view cursor pos for staging/stagingSecondary views
Now that the cursor highlight is never shown (see previous commit), there's no
reason to update the cursor position any more.
2023-02-15 21:32:21 +01:00
stk
6b81e6adca Turn highlighting off in staging/stagingSecondary views
There are two reasons for doing this:
1. The view cursor position is often out of sync with the selected line; see
   first commit of this branch.
2. The highlighting is already turned off when the view loses focus, and never
   turned back on thereafter. So just turn it off from the start then.
2023-02-15 21:29:38 +01:00
stk
b499eba1a8 Select next stageable line correctly after staging a range of lines
We already have this very convenient behavior of jumping to the next stageable
line after staging something. However, while this worked well for staging
single lines or hunks, it didn't work correctly when staging a range of lines;
in this case we want to start searching from the first line of the range.
2023-02-15 21:29:00 +01:00
stk
ff2a799200 Make SelectedLine/SelectedLineIdx work in staging/stagingSecondary views
While we try to keep the view's cursor position in sync with the context state's
selectedLineIdx (at least when pressing up or down), there are enough situations
where the two run out of sync; for example when initially opening the view, or
after staging a hunk, or when scrolling the view using the wheel. While it would
be possible to fix these situations to keep them always in sync, it doesn't seem
worth it, because the view's cursor position isn't really used for anything
else. So we rather special-case the SelectedLine/SelectedLineIdx functions of
ViewDriver to query the context state's selectedLineIdx directly if it is a
patch explorer context.
2023-02-15 21:22:11 +01:00
Ryooooooga
39c20bc634
chore: change to work return-alt1 on all views 2023-02-11 21:19:47 +09:00
Jesse Duffield
823d95a8c6
Merge pull request #2418 from jesseduffield/feature/copy-remote-branch-to-clipboard 2023-02-11 10:53:31 +11:00
Jesse Duffield
225cd3cc60
Merge pull request #2412 from Ryooooooga/disable-help-on-suggestions 2023-02-11 10:52:49 +11:00
Ryooooooga
984eb95cb7
chore: remove UNKNOWN_VIEW_ERROR_MSG 2023-02-10 21:26:51 +09:00
Ryooooooga
1be6c522d8
fix: disable menu key binding while displaying popup 2023-02-09 20:13:41 +09:00
Luka Markušić
8af59c3e6e Copy remote branch name to clipboard 2023-02-09 11:56:12 +01:00
Jesse Duffield
4f7324bad0
Merge pull request #2413 from stefanhaller/allow-ignore-whitespace-everywhere 2023-02-09 21:55:12 +11:00
Jesse Duffield
5e2254395a fix linting issue 2023-02-09 21:45:14 +11:00
stk
5bb6198219 Allow ignoring whitespace in diff in commits panel 2023-02-07 12:14:29 +01:00
stk
bbaeab68e1 Better redrawing after toggling "ignore whitespace"
There's no need for refreshing anything; all that's needed is to re-focus the
selected list item. This way it will also work in other panels, which we are
about to add in the next commit.
2023-02-07 12:09:17 +01:00