1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-04-21 12:16:54 +02:00

314 Commits

Author SHA1 Message Date
Stefan Haller
064fae41e7 Remove return value of OpenCommitMessagePanel
Similar to the previous commit: in 100% of the call sites we now need an extra
`return nil`. Nevertheless, I still prefer it this way.
2024-09-06 08:45:48 +02:00
Stefan Haller
d4ef8e53d5 Remove return value of Alert/Confirm/Prompt
This might seem controversial; in many cases the client code gets longer,
because it needs an extra line for an explicit `return nil`. I still prefer
this, because it makes it clearer which calls can return errors.
2024-09-06 08:45:48 +02:00
Stefan Haller
b15a1c7ae7 Remove return value of CreatePopupPanel 2024-09-06 08:45:48 +02:00
Stefan Haller
6f0182f11c Remove return value of RefreshPatchBuildingPanel 2024-09-06 08:45:48 +02:00
Stefan Haller
371998e635 Remove return value of IContextMgr.Push/Pop et. al. 2024-09-06 08:45:48 +02:00
Stefan Haller
8302575078 Remove return value of Focus-related functions 2024-09-06 08:45:48 +02:00
Stefan Haller
5446683881 Remove return value of RenderToMainViews and some related functions 2024-09-06 08:45:48 +02:00
Stefan Haller
b91beb68e1 Remove return value of HandleRender 2024-09-06 08:45:48 +02:00
Stefan Haller
5659f1f3e9 Bump gocui
And adapt client code.
2024-09-06 08:45:48 +02:00
Brandon
e8e39f5ce2 Offer autostash option when creating new branch 2024-09-03 09:05:53 +02:00
Brandon
370ab2d19c Simplify CheckoutRef 2024-09-03 09:05:53 +02:00
Stefan Haller
9ec77bba91 Don't allow opening a menu while the search or filter prompt is open
This solves several problems that arise from opening a menu while the prompt is
open. We might try to solve these in a different way, e.g. by dismissing the
search prompt before opening a menu, but restricting what you can do while the
prompt is open seems like the more robust fix.

To achieve this, we
- call resetKeyBindings both when opening and when closing the search/filter
  prompt
- change the keybindings to only contain the ones for the search prompt when
  that context is active.
2024-09-02 18:31:30 +02:00
Stefan Haller
ba21d4e651 Ask to auto-stage unstaged files when continuing a rebase after resolving conflicts 2024-09-02 18:24:36 +02:00
Stefan Haller
90b8fd242d Add config git.autoStageResolvedConflicts 2024-09-02 18:12:47 +02:00
Stefan Haller
ef7d1a8602 Use non-sticky range diff when entering commit files panel
We make the name of the GetSelectedRefRangeForDiffFiles very specific on purpose
to make it clear that this is only for switching to diff files, so the
implementations can make assumptions about that (unlike GetSelectedRef, which is
used for different purposes and needs to stay more generic).
2024-08-28 19:51:15 +02:00
Stefan Haller
a6656e307c Extract a method CommitFilesContext.ReInit
Right now it doesn't do very much yet, but it's still worth it even in this
state, I'd say. The function is going to become a bit longer in the next commit,
though.
2024-08-28 19:51:15 +02:00
Stefan Haller
442592a149 Show diff for range selection in commits and sub-commits panel
In other views that show lists of commits (reflog and stash) it doesn't make
sense to show a range diff of selected entries because they don't form a linear
sequence, so we keep the previous behavior of showing the diff for the free end
of the selection range in those view.

The same applies to the commits view if the selection range includes rebasing
todos; these can have an arbitrary order, and a range diff doesn't make sense
for those.
2024-08-28 19:35:23 +02:00
Stefan Haller
b07ce19b9a Add --stat -p to diff args in diffing mode
This is consistent with what we do for showing single commits (with git show),
and I find it very useful.
2024-08-28 18:27:52 +02:00
Stefan Haller
079c5a9905 Add prefix to main view diff when in diffing mode
Hopefully this will help alleviate the problem that diffing mode is sticky, and
you often forget that it's still on.

Make it magenta like the mode text in the information view.
2024-08-28 18:27:52 +02:00
Stefan Haller
a2c4fad410 Bugfix: properly set title of subcommits panel when refreshing
This fixes two problems:
- Set the title ref to the commit description (like
  SwitchToDiffFilesController.enter does), rather than just the hash
- SetTitleRef only sets the title of the DynamicTitleBuilder, but doesn't set it
  on the view; this only happens in ContextMgr.Activate, so you'd have to switch
  to a different side panel and then back to see the new title.
2024-08-28 18:27:52 +02:00
Yaroslav Halchenko
4bbfe7b3cc [DATALAD RUNCMD] run codespell throughout fixing typos automagically
=== Do not change lines below ===
{
 "chain": [],
 "cmd": "codespell -w",
 "exit": 0,
 "extra_inputs": [],
 "inputs": [],
 "outputs": [],
 "pwd": "."
}
^^^ Do not change lines above ^^^

Signed-off-by: Yaroslav Halchenko <debian@onerussian.com>
2024-08-27 18:03:00 +02:00
Yaroslav Halchenko
83ef031922 [DATALAD RUNCMD] Do interactive fixing of some ambigous typos
=== Do not change lines below ===
{
 "chain": [],
 "cmd": "codespell -w -i 3 -C 2",
 "exit": 0,
 "extra_inputs": [],
 "inputs": [],
 "outputs": [],
 "pwd": "."
}
^^^ Do not change lines above ^^^

Signed-off-by: Yaroslav Halchenko <debian@onerussian.com>
2024-08-27 18:03:00 +02:00
Stefan Haller
a709caf138 Remove error return value from functions that always return nil 2024-08-27 10:33:06 +02:00
Stefan Haller
63aa32c521 Remove "double" formatting 2024-08-27 10:33:06 +02:00
Brandon
ae61da7485 Fix cancelled autostash resulting in stuck inline status 2024-08-27 10:28:22 +02:00
Stefan Haller
15d17e16dd Call ReApplySearch after layout
This fixes a possible crash when exiting filter mode in the commits panel.
2024-08-24 10:51:25 +02:00
Stefan Haller
61b59837bb Use our new hyperlink support in confirmations 2024-08-24 10:36:01 +02:00
Stefan Haller
f98b57aa5e Change direct access to Common.UserConfig to a getter
This will allow us to turn the field into an atomic.Value for safe concurrent
access.
2024-08-18 10:24:52 +02:00
Stefan Haller
1eb5d89f1d Remove bool return value of GetParentContext()
The comments that I'm deleting here explain why we need the bool; however, in
our case that's a theoretical issue. It would only arise if we ever were to pass
a nil context to SetParentContext, which we never do.
2024-08-17 11:14:51 +02:00
Stefan Haller
94d6f4dae7 Replace IsCurrentContext() with Context().IsCurrent() 2024-08-17 11:14:51 +02:00
Stefan Haller
f30387e7f5 Replace CurrentPopupContexts() with Context().CurrentPopup() 2024-08-17 11:14:51 +02:00
Stefan Haller
df3afb1b89 Replace CurrentSideContext() with Context().CurrentSide() 2024-08-17 11:14:51 +02:00
Stefan Haller
7f935c1ea8 Replace CurrentStaticContext() with Context().CurrentStatic() 2024-08-17 11:14:51 +02:00
Stefan Haller
7ed94c0410 Replace CurrentContext() with Context().Current() 2024-08-17 11:14:51 +02:00
Stefan Haller
98335361fd Replace PopContext() with Context().Pop() 2024-08-17 11:14:50 +02:00
Stefan Haller
bd36b8a95e Replace PushContext() with Context().Push() 2024-08-17 11:14:50 +02:00
Luke Swan
968060a5ec Ensure branch name matches pattern before replace
Amend test for non-matching branch name
2024-07-10 09:05:41 +02:00
Aleksei Larkov
8813587961 Add Token credential request handling
Asking for 2FA Token prompt when an additional authentication is configured for git over SSH
2024-07-06 21:44:10 +10:00
Elliot Cubit
5959f7bc8e Allow setting a default name when creating new branches 2024-07-06 21:06:28 +10:00
T.
b26ff43d9e Update tracking behaviour for branches created from remote branches
The current behaviour when creating a new branch off of a remote branch
is to always track the branch it was created from.

For example, if a branch 'my_branch' is created off of the remote branch
'fix_crash_13', then 'my_branch' will be tracking the remote
'fix_crash_13' branch.

It is common practice to have both the local and remote branches named
the same when the local is tracking the remote one. Therefore, it is
reasonable to expect that 'my_branch' should not track the remote
'fix_crash_13' branch.

The new behaviour when creating a new branch off of a remote branch is
to track the branch it was created from only if the branch names match.
If the branch names DO NOT match then the newly created branch will not
track the remote branch it was created from.

For example, if a user creates a new branch 'fix_crash_13' off of the
remote branch 'fix_crash_13', then the local 'fix_crash_13' branch will
track the remote 'fix_crash_13' branch.
However, if the user creates a new branch called 'other_branch_name' off
of the remote branch 'fix_crash_13', then the local 'other_branch_name'
branch will NOT track the remote 'fix_crash_13' branch.
2024-07-04 22:34:36 +02:00
T.
2335772db6 Make opening git difftool more consistent
The default shortcut to open git difftool (ctrl+t) is not available on
the "Local Branches" window. It is available when selecting a commit
from a local branch, a remote branch, or a tag from the "Local Branches"
window.

This is inconsistent since branches or tags are also commits, the
shortcut should also work on them directly.

This commit remedies this inconsistency by allowing the use of the
shortcut directly on a branch or a tag. The shortcut works both in the
"standard" mode and the "diffing" mode.
2024-06-30 10:27:28 +02:00
Noah
232be05785 feat: squash merge 2024-06-30 11:01:03 +10:00
Stefan Haller
e205c6ba7f Always reapply filters on filtered views, even inactive ones 2024-06-28 08:23:27 +02:00
Stefan Haller
4b6479b25f Stagger popup panels
When opening a popup panel on top of another one, offset the new one a little
bit down and to the right.
2024-06-28 08:14:07 +02:00
Stefan Haller
1ab1fb3599 Resize all open popup panels in layout, not just the topmost one
Probably not the most import feature in the world, but when resizing the
terminal window while multiple popup panels were open at the same time, we would
only resize the topmost one.

The main reason for changing this is because it makes the next commit easier to
implement.
2024-06-28 08:14:07 +02:00
Stefan Haller
1d502d3245 Remove return value from ResizeCurrentPopupPanel
It always returned nil, so there's no point in returning an error.
2024-06-28 08:14:07 +02:00
Stefan Haller
bb01648521 Remove redundant calls to resize editable panels at creating time
The only purpose of this was to scroll the editable text correctly (see
https://github.com/jesseduffield/lazygit/pull/2146); now that gocui takes care
of that, we no longer need to do this.
2024-06-28 08:14:07 +02:00
Stefan Haller
b795d91fa8 Remove redundant resizeConfirmationPanel() call at panel creating time
We resize the panel in layout, so there's no need to do that after creation.
2024-06-27 10:18:12 +02:00
Stefan Haller
ccc620e5fc Remove duplicate function
ResizeConfirmationPanel and resizeConfirmationPanel were identical, get rid of
one of them.
2024-06-27 10:14:00 +02:00
Stefan Haller
34d7afc0e9 Remove unused functions 2024-06-27 10:14:00 +02:00