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

4191 Commits

Author SHA1 Message Date
ee1597415d Merge pull request #2655 from jesseduffield/use-command-args-vector 2023-05-23 19:55:09 +10:00
63dc07fded Construct arg vector manually rather than parse string
By constructing an arg vector manually, we no longer need to quote arguments

Mandate that args must be passed when building a command

Now you need to provide an args array when building a command.
There are a handful of places where we need to deal with a string,
such as with user-defined custom commands, and for those we now require
that at the callsite they use str.ToArgv to do that. I don't want
to provide a method out of the box for it because I want to discourage its
use.

For some reason we were invoking a command through a shell when amending a
commit, and I don't believe we needed to do that as there was nothing user-
supplied about the command. So I've switched to using a regular command out-
side the shell there
2023-05-23 19:49:19 +10:00
70e473b25d Updated README.md 2023-05-23 09:20:04 +00:00
1a4cf84b58 Merge pull request #2661 from jesseduffield/cache-binary-paths
Cache binary paths
2023-05-23 19:19:49 +10:00
ad72a1f5a3 Cache binary paths
Turns out that with our secureexec package (which we only use on windows due to a windows security thing),
2023-05-23 19:15:33 +10:00
ec5075104a Merge pull request #2644 from stefanhaller/remove-empty=keep-option-when-rebasing
Don't keep commits that become empty during a rebase
2023-05-21 07:45:21 +02:00
6f535d71c9 Merge pull request #2652 from jesseduffield/right-align-columns 2023-05-21 12:30:53 +10:00
ec3a28df43 Right-align key labels in menu
I find this makes it look a little nicer
2023-05-21 12:09:43 +10:00
5b933762c2 Merge pull request #2651 from jesseduffield/strikethrough-menu 2023-05-21 11:34:19 +10:00
3eed997161 Update cheatsheet
Now that we're using the angle-bracket syntax everywhere for consistency, we need to escape
the angle brackets in the markdown of the cheatsheets.
2023-05-21 11:31:29 +10:00
526d8a8a76 Fix cheatsheet generate VSCode task
This was previously not working because we tried to run the whole string as its own process
2023-05-21 11:31:29 +10:00
e1fc90615d Apply strikethrough style to reserved keybindings in menus
If a given menu item has an associated keybinding of 'enter', hitting enter won't actually execute
that item unless your cursor is on it. This creates confusion, and so we're going to use a strikethrough
style to communicate that the keybinding is reserved for something else.
2023-05-21 11:31:29 +10:00
460a166e16 Stop displaying navigation keybinding at bottom of screen
The reason for this is that now our labels for navigation keybindings are larger so they
take up more realestate. It's not the kind of thing a user needs to be told anyway,
anybody is going to try out hjkl and the arrow keys when a TUI opens up.

We could map from <up> to the single character up unicode rune but given you can rebind this stuff
I'd rather keep it simple
2023-05-21 11:01:15 +10:00
2e66d87b94 Use same labels for keys that we use in the config
Previously we were displaying keys in a different format than we expected them in the config.
This was certain to cause confusion.
2023-05-21 10:59:16 +10:00
820f7b9404 Support strikethrough text style 2023-05-21 10:46:13 +10:00
3cddd7cfa5 Don't keep commits that become empty during a rebase
The only exception is when moving a custom patch for an entire commit to an
earlier commit; in this case the source commit becomes empty, but we want to
keep it, mainly for consistency with moving the patch to a later commit, which
behaves the same.

In all other cases where we rebase, it's confusing when empty commits are kept;
the most common example is rebasing a branch onto master, where master already
contains some of the commits of our branch. In this case we simply want to drop
these.
2023-05-20 21:10:03 +02:00
2e0d0a92ee Merge pull request #2647 from jesseduffield/fix-tip 2023-05-20 23:40:31 +10:00
ed857d1e07 Show correct keybinding in tip 2023-05-20 23:36:34 +10:00
b30ec538fb Merge pull request #2645 from jesseduffield/convenient-git-command-building 2023-05-20 20:58:18 +10:00
ee11046d35 Refactor interface for ApplyPatch 2023-05-20 20:54:39 +10:00
25f8b0337e Add convenience builder for git commands 2023-05-20 20:54:24 +10:00
63ddc52a6b Increase test coverage 2023-05-20 16:55:15 +10:00
b07c4fc001 Updated README.md 2023-05-20 03:01:38 +00:00
2304ffc804 Merge pull request #2641 from stefanhaller/visualize-ignore-whitespace-config 2023-05-20 13:01:22 +10:00
401610c0ef Remove the toast when toggling "ignore whitespace"
Now that we visualize the state, the toast is no longer needed.
2023-05-20 12:58:32 +10:00
64b2685c2d Visualize the "ignore whitespace" state in the subtitle of the diff view 2023-05-20 12:58:32 +10:00
7d4bfb6621 Don't toggle "ignore whitespace" in the staging and patch building panels
The option doesn't have any affect in these views, so we don't need to toggle it
here. But the problem was the HandleFocus call at the end: this would activate
the wrong view, so we need to avoid it here.

Show an error if the user tries to turn the option on, to let them know that it
doesn't work here.
2023-05-20 12:58:32 +10:00
a2778f01c6 Disregard the "ignore whitespace" option in the patch building panel
It's not possible to reliably stage things into a custom patch when "ignore
whitespace" is on, so always treat it as off here (like we do in the staging
panel).

It looks like this is a regression that was introduced in 8edad826ca.
2023-05-19 18:22:28 +02:00
d161afe37f Support ignoring whitespace on stash 2023-05-19 17:49:22 +02:00
3dd96a8010 Updated README.md 2023-05-17 07:12:19 +00:00
681a9bf20d Merge pull request #2612 from longlhh90/fix-commit-prefixes-with-empty-commit-message 2023-05-17 17:12:05 +10:00
0606b7a43b remove empty message check as message of commit can be empty 2023-05-17 17:07:50 +10:00
33da56eeb4 Merge pull request #2619 from stefanhaller/config-for-base-branches
Add config for main branches
2023-05-16 13:23:56 +02:00
46b93bba0e Add config git.mainBranches
It defaults to {"master", "main"}, but can be set to whatever branch names
are used as base branches, e.g. {"master", "devel", "v1.0-hotfixes"}. It is
used for color-coding the shas in the commit list, i.e. to decide whether
commits are green or yellow.
2023-05-16 13:20:03 +02:00
d2d50aedd0 Updated README.md 2023-05-16 11:13:36 +00:00
ea5fb6a364 Merge pull request #2629 from jesseduffield/try-fix-conflict-continue-prompt 2023-05-16 21:13:17 +10:00
a82134f41c Fix race condition
Our refresh code may try to push a context. It does this in two places:
1) when all merge conflicts are resolved, we push a 'continue merge?' confirmation context
2) when all conflicts of a given file are resolved and we're in the merge conflicts context,
   we push the files context.

Sometimes we push the confirmation context and then push the files context over it, so the user
never sees the confirmation context.

This commit fixes the race condition by adding a check to ensure that we're still in the
merge conflicts panel before we try escaping from it
2023-05-16 21:01:38 +10:00
00b03079d8 Don't deactivate context that you're about to activate 2023-05-16 21:01:38 +10:00
9592686629 Compare contexts with keys
We don't want to compare contexts directly given they are interfaces and not
pointers to structs
2023-05-16 21:01:38 +10:00
114ad52ff6 Rename CmdLog -> GuiLog
We want to log both actions and commands for the sake of integration tests
2023-05-16 21:01:38 +10:00
9514284f8e Merge pull request #2608 from stefanhaller/allow-selected-line-outside-view
Allow the selected line of a list view to be outside the visible area
2023-05-13 12:29:17 +02:00
ece14844bb Updated README.md 2023-05-13 02:33:48 +00:00
9910a7c308 Merge pull request #2628 from stefanhaller/make-merged-take-precedence-over-unpushed 2023-05-13 12:33:34 +10:00
910a61dc46 Make "merged" take precedence over "unpushed"
Previously, when rebasing a branch onto a newer master, all commits from the
previous fork point up to its head were marked red (unpushed), including the
commits that are on master already. While this is technically correct from the
perspective of the current branch's upstream, it's not what most people expect,
intuitively; they want to see where the current branch starts, relative to
master. So all commits of master should be green, and then the commits of the
current branch in red.
2023-05-12 22:56:58 +02:00
e5dd4d3110 Allow the selected line of a list view to be outside the visible area
I don't see a reason why this restriction to have the selection be always
visible was necessary. Removing it has two benefits:

1. Scrolling a list view doesn't change the selection. A common scenario: you
   look at one of the commits of your current branch; you want to see the how
   many'th commit this is, but the beginning of the branch is scrolled off the
   bottom of the commits panel. You scroll down to find the beginning of your
   branch, but this changes the selection and shows a different commit now - not
   what you want.

2. It is possible to scroll a panel that is not the current one without changing
   the focus to it. That's how windows in other GUIs usually behave.
2023-05-11 13:23:58 +02:00
595c7ee73e Extend one of the filtering tests to start on a commit other than the first
Enabling the filter selects the first entry in the filtered commits view. It's
useful to have a test that checks this, as I almost broke it in the following
commit (it needs an added FocusLine call in the setFiltering function in
filtering_menu_action.go).
2023-05-11 13:23:58 +02:00
051af6a066 Updated README.md 2023-05-11 09:09:15 +00:00
e2d7e461a8 Merge pull request #2519 from jesseduffield/refactor-better-encapsulation 2023-05-11 19:09:01 +10:00
7c66ca83c1 update cheatsheets 2023-05-11 19:02:25 +10:00
007b406b14 remove duplicate method 2023-05-11 19:00:41 +10:00