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

3104 Commits

Author SHA1 Message Date
Jesse Duffield
c7a3b69eb9 Remove retry logic in integration tests
I want to see how we go removing all retry logic within a test. Lazygit should be trusted to tell us when it's no longer busy,
and if it that proves false we should fix the issue in the code rather than being lenient in the tests
2023-07-09 20:57:18 +10:00
Jesse Duffield
b19943af01 Wait for intro before doing any of our refresh functions
We were doing this already for fetching but not for refreshing files so I'm making it consistent.
2023-07-08 22:54:52 +10:00
Jesse Duffield
015a04fac6 Remove redundant waitgroup
Turns out we're just running our refresh functions one after the other which isn't ideal but we can fix that separately.
As it stands this wait group isn't doing anything.
2023-07-08 22:54:52 +10:00
Jesse Duffield
26ca41a40e Handle pending actions properly in git commands that require credentials
I don't know if this is a hack or not: we run a git command and increment the pending action
count to 1 but at some point the command requests a username or password, so we need to prompt
the user to enter that. At that point we don't want to say that there is a pending action,
so we decrement the action count before prompting the user and then re-increment it again afterward.

Given that we panic when the counter goes below zero, it's important that it's not zero
when we run the git command (should be impossible anyway).

I toyed with a different approach using channels and a long-running goroutine that
handles all commands that request credentials but it feels over-engineered compared to this
commit's approach.
2023-07-08 22:54:52 +10:00
Jesse Duffield
6c4e7ee972 Add busy count for integration tests
Integration tests need to be notified when Lazygit is idle so they can progress to the next assertion / user action.
2023-07-08 22:54:52 +10:00
Jesse Duffield
1a36cb9f3f
View filtering (#2680) 2023-07-03 12:57:11 +10:00
Jesse Duffield
5d982e1d70 Add mutex to filtered list to avoid concurrency issues 2023-07-03 12:54:14 +10:00
Jesse Duffield
b625eb5323 Differentiate between different filter modes
We can filter by path, by file status, and by text.
2023-07-03 12:54:14 +10:00
Jesse Duffield
8e46b8a275 Use searching, not filtering, in file tree views
There's more work to be done to support filtering for these views so we're sticking with searching for now
2023-07-03 12:54:14 +10:00
Jesse Duffield
cd989d8ebe Fix escape logic for remote branches
The remote branches controller was using its own escape method meaning it didn't go through the flow of cancelling
an active filter. It's now using the same approach as the sub-commits and commit-files contexts: defining a parent
context to return to upon hittin escape.
2023-07-03 12:54:14 +10:00
Jesse Duffield
261f30f49c Add integration tests for searching/filtering 2023-07-03 12:54:14 +10:00
Jesse Duffield
7d7399a89f Support case sensitive filtering 2023-07-03 12:54:14 +10:00
Jesse Duffield
9df634f13f Color view frame differently when searching/filtering
Given that we now persist search/filter states even after a side context loses focus, we need to make it really
clear to the user that the context is currently being searched/filtered
2023-07-03 12:54:14 +10:00
Jesse Duffield
3ca1292fb4 Show filter status similar to what we show with search 2023-07-03 12:54:14 +10:00
Jesse Duffield
13c1103815 Only cancel search if main or temporary context loses focus
This is a pickle: initially I wanted it so that a filter would cancel automatically if the current context lost focus.
But there are situations where you want to retain the focus, e.g. when a popup appears, or when you view the commits
of a branch. The issue is that when you view the commits of a branch, the branches context is removed from the context
stack. Even if this were not the case, you could imagine going branches -> sub-commits -> files -> sub-commits, where
in that case branches would definitely be off the stack upon navigating to the files context.

So because I'm too lazy to find a proper solution to this problem, I'm just making it so that filters in side contexts
are retained unless explicitly cancelled.

There's another edge case this commit handles which is that if I'm in the sub-commits context via the branches context
and start a search, then navigate to the reflog context and hit enter to get to the sub-commits context again, I need
to cancel the search before I switch. Likewise with the commit files context.
2023-07-03 12:54:14 +10:00
Jesse Duffield
b8bee4de51 Scroll to top when filtering and retain selection when cancelling filter 2023-07-03 12:54:14 +10:00
Jesse Duffield
d67b209e62 Move more logic into search helper 2023-07-03 12:54:14 +10:00
Jesse Duffield
bf5871cc4f Case insensitive string comparison 2023-07-03 12:54:13 +10:00
Jesse Duffield
13326344f0 Support filtering files 2023-07-03 12:54:13 +10:00
Jesse Duffield
84870d4503 Cancel filter/search when hitting escape 2023-07-03 12:54:13 +10:00
Jesse Duffield
a9e2c8129f Introduce filtered list view model
We're going to start supporting filtering of list views
2023-07-03 12:54:13 +10:00
Jesse Duffield
fd861826bc Add integration tests for discarding files 2023-07-03 12:54:13 +10:00
Jesse Duffield
c9a917b830 Print entire panic message
For some reason, the panic message was being truncated. So here we're printing it first, and then calling panic
2023-07-02 15:47:04 +10:00
Gustavo Krieger
9ae7710850 Use comment char config on interactive rebase
Co-authored-by: Stefan Haller <stefan@haller-berlin.de>
2023-07-02 02:07:32 -03:00
Gustavo Krieger
87fe30d50d Bump git-todo-parser 2023-07-02 02:07:32 -03:00
Gustavo Krieger
cff9850374 Add tests of interactive rebase with custom comment character 2023-07-02 02:07:32 -03:00
Stefan Haller
7cb54f4fee
Merge pull request #2748 from jesseduffield/always-show-branch-heads-in-diff
Always show branch heads in diff pane
2023-06-29 09:32:33 +02:00
Amirzhan Aliyev
62cc036254 fix: typo EnteRefName 2023-06-28 18:54:21 +06:00
Stefan Haller
a8aeadfdb7 Always show branch heads in diff pane
The first line of the diff pane would show branch heads (e.g.

  commit dd9100ccc8b69a8b14b21a84e34854b5acfb871a (mybranch, origin/mybranch)

only when a pager is used. The reason is that the default of the --decorate
option to git show is "auto", which means to show the decoration only when
output goes to a tty. Lazygit uses a pty only when a pager is used, so the
decoration wouldn't show when no pager is used.

Since the branch head annotation is useful and we always want to see it, force
it by explicitly passing --decorate.
2023-06-28 09:44:06 +02:00
Amirzhan Aliyev
5133113142 feat(i18n): add russian translation 2023-06-28 00:34:59 +06:00
Stefan Haller
ff8bc91a8e Use remote upstreams of main branches to determine merged status of commits
This solves three problems:

1. When the local main branch is behind its upstream, the merged status of
   commits of a feature branch sitting on origin/main was not correct. This can
   easily happen when you rebase a branch onto origin/main instead of main, and
   don't bother keeping local main up to date.
2. It works when you don't have the main branch locally at all. This could
   happen when you check out a colleague's feature branch that goes off of
   "develop", but you don't have "develop" locally yourself because you normally
   only work on "main".
3. It also works when you work on a main branch itself, e.g. by committing to it
   directly, or by merging a branch locally. These local commits on a main
   branch would previously be shown in green instead of red; this broke with
   910a61dc46.
2023-06-26 09:02:46 +02:00
Stefan Haller
2f6b7b9bc3 Rename the gui.skipUnstageLineWarning conf key to gui.skipDiscardChangeWarning 2023-06-26 08:19:58 +02:00
Stefan Haller
ee03a0be41 Rename "Delete change" menu entry to "Discard change" in staging panel
For consistency with the previous commit.

Note that this menu entry is used both for unstaged and for staged changes, and
for staged changes it is not quite accurate, as we are not discarding changes in
that case (just unstaging them). Not sure it's worth fixing this; it's still
better than "Delete", anyway.
2023-06-26 08:19:58 +02:00
Stefan Haller
51a558040d Fix the title and text (and variable names) of the Discard Changes prompt
The title was saying "Unstage lines", which was just wrong. The text said
"Delete lines", which can be seen as a bit misleading; we are only discarding
the changes to the selected lines, not deleting the lines themselves.

For consistency, rename the config variable skipUnstageLineWarning accordingly.
2023-06-26 08:15:35 +02:00
Stefan Haller
c4a2749a99 Avoid rewriting the file if nothing changed
This avoids changing the indentation or number of blank lines etc unnecessarily
if nothing has changed.
2023-06-26 08:11:10 +02:00
Stefan Haller
85f293af1a Add new function RenameYamlKey 2023-06-26 08:11:10 +02:00
Stefan Haller
9cbd7fe69e Extract a lookupKey function that will be useful in the next commit 2023-06-26 08:11:10 +02:00
Stefan Haller
4461dc68b7 Create missing path elements
This fixes a serious error: trying to change a value on gui.someOption would add
a someOption key at root if gui doesn't exist.
2023-06-26 08:11:10 +02:00
Stefan Haller
6acabba417 Return an error if some node in the path is not a dictionary 2023-06-26 08:11:10 +02:00
Stefan Haller
7fb86d6e9c Return an error if node to be updated is not a scalar 2023-06-26 08:11:10 +02:00
Stefan Haller
221433522d Return an error if document is not a dictionary 2023-06-26 08:11:10 +02:00
Stefan Haller
90084d115e Support updating values in empty documents 2023-06-26 08:11:10 +02:00
Stefan Haller
a14794bf5c Rename UpdateYaml to UpdateYamlValue
We are going to add other ways to update yaml documents in the future.
2023-06-26 08:11:10 +02:00
Stefan Haller
bf685cf832 Cleanup: improve test setup and check for the right error string
Use the assert package to check expectations; also, check for the exact error
message instead of just whether any error occurred.
2023-06-26 08:11:10 +02:00
Stefan Haller
8932d17393 Cleanup: remove unnecessary if statements
The assert package is already very good at displaying errors, including printing
a diff of expected and actual value, so there's no point in printing the same
information again ourselves.
2023-06-26 08:11:10 +02:00
Stefan Haller
1998d0724f Add a test for stopping at an "edit" command that conflicts
This test is almost identical to swap_in_rebase_with_conflict.go, except that it
sets the commit that will conflict to "edit".

This test is interesting because there's special code needed to determine
whether an "edit" command conflicted or not, i.e. whether to show the "confl"
entry. In this case we do. We have lots of other tests already that have "edit"
commands that don't conflict, so that's covered already.
2023-06-22 18:57:58 +02:00
Stefan Haller
3928d0ebda Insert fake todo entry for a conflicting commit that is being applied
When stopping in a rebase because of a conflict, it is nice to see the commit
that git is trying to apply. Create a fake todo entry labelled "conflict" for
this, and show the "<-- YOU ARE HERE ---" string for that one (in red) instead
of for the real current head.
2023-06-22 18:57:58 +02:00
Stefan Haller
d66ca7751c Add test for rewording a commit and failing with an error
The point of this test is to verify that the <--- YOU ARE HERE --- display is
correct when the last command in a rebase was "reword".
2023-06-22 18:57:43 +02:00
Stefan Haller
ba160cb5db Add test for a pick that fails and gets rescheduled
This test is interesting because it already behaves as desired: since git has
rescheduled the "pick" command, we do _not_ want to show a "conflict" entry in
this case, as we would see the same commit twice then.
2023-06-22 18:57:43 +02:00
Stefan Haller
3d76c734aa Add test for amending a commit, causing a conflict 2023-06-22 18:57:43 +02:00
Stefan Haller
cddf056f4d Extend test to expect what commits we want to be listed when there's a conflict 2023-06-22 18:57:43 +02:00
Stefan Haller
77c5d1761d Add nerdFontsVersion config 2023-06-15 21:47:52 +02:00
Stefan Haller
6ab5d7f69b Turn remoteIcons into a map
We don't actually use it to do map lookups; we still iterate over it in the same
way as before. However, using a map makes it easier to patch elements; see the
next commit.
2023-06-15 13:25:32 +02:00
Stefan Haller
1f42c8a387 Allow discarding changes only from local commits
We use CommitFilesController also for the files of commits that we show
elsewhere, e.g. for branch commits, tags, or stashes. It doesn't make sense to
discard changes from those (for stashes it might be possible to implement it
somehow, but that would be a new feature), so we disallow it unless we are in
the local commits panel.
2023-06-07 12:48:56 +02:00
Stefan Haller
5c55ce6555 Better prompt for discarding old file changes
Lazygit knows what kind of file change this is, so there doesn't have to be any
"if" in the prompt text.
2023-06-07 12:47:03 +02:00
Stefan Haller
1f801b91e4 Disallow discarding file changes while a directory is selected
Discarding changes to an entire directory doesn't quite work correctly in all
cases; for example, if the current commit added files to the directory (but the
directory existed before) then those files won't be removed.

It might be possible to fix the command so that these cases always work for
directories, but I don't think it's worth the effort (you can always use a
custom patch for that), so let's display an error for now.
2023-06-07 12:47:03 +02:00
Jesse Duffield
c92e687d3b Fix focus issue when opening recent-repos menu at launch
I don't know why we were setting the initial context to CurrentSideContext
and not just CurrentContext in the first place. If there is no current context
in either case it'll default to the files context. So the only issue is if
we anticipated that some random context would be focused and we didn't want to
activate that. But I can't think of any situation where that would happen.
2023-06-07 18:27:18 +10:00
Jesse Duffield
a694c458dd Support authors and tags in custom command suggestions preset 2023-06-07 10:18:01 +10:00
Enrico Borba
cbbb281011
kakoune binary name 2023-06-05 08:53:39 -04:00
Jesse Duffield
a9ae5063c2 Fix flakey test
Whenever we perform an action in a test, we should assert on the result before doing the next action.
This prevents issues where the test moves too fast for our code. It would be nice to not have to do this,
but for now that's the situation
2023-06-03 15:54:03 +10:00
Jesse Duffield
1932c2366b Appease linter 2023-06-03 15:54:03 +10:00
Jesse Duffield
dd34adb36c Support matchers on integers in integration tests 2023-06-03 15:32:23 +10:00
Jesse Duffield
e98935f83e
Merge pull request #2699 from jesseduffield/revert-hide-underscores 2023-06-01 22:30:56 +10:00
Jesse Duffield
4ff02bd3b7 Add integration test for commit highlighting on focus
A better refactor would be to allow matchers to assert against either a string or a slice of cells, so that I could have
the same ergonomics that I have elsewhere, but this is a start.
2023-06-01 22:20:30 +10:00
Jesse Duffield
5df27c61ed Apply correct styling to root commit in graph
The root commit is special in that it has no parents. So we need to add a pipe that's headed for a commit
that doesn't actually exist i.e. the mythical empty tree commit. We're using the actual hash of that
pseudo-commit, but it's not being read anywhere.
2023-06-01 22:20:30 +10:00
Jesse Duffield
c9136538b5 Refresh commits viewport on focus lost
We don't want the highlighted selection sticking around after the context loses focus.
2023-06-01 21:31:57 +10:00
Jesse Duffield
b250644ea8 Stop hiding underscores for VSCode
VSCode had an issue in their terminal where underscores were printed all over the place.
That has now been fixed.
See https://github.com/jesseduffield/lazygit/issues/2294 and https://github.com/xtermjs/xterm.js/issues/4238
2023-06-01 20:12:20 +10:00
Jesse Duffield
a4db44bc3d show commits against branches 2023-06-01 19:21:24 +10:00
Jesse Duffield
378c50cf30 Set defaults colours to 'default', not 'white'
'white' is great on dark themes, and terrible on light themes.
2023-06-01 18:59:04 +10:00
Jesse Duffield
860fd23b42
Merge pull request #2695 from jesseduffield/fix-time-ago-function 2023-06-01 18:53:55 +10:00
Stefan Haller
33e5f8f776
Merge pull request #2694 from stefanhaller/conflict-handling-menu
Show menu instead of prompt when there are conflicts in a rebase or merge
2023-06-01 10:52:11 +02:00
Stefan Haller
16dceb813b Show menu instead of prompt when there are conflicts in a rebase or merge
This solves the issue that previously you could too easily abort a rebase
accidentally by hitting escape.
2023-06-01 10:51:48 +02:00
Jesse Duffield
61f00e6dd4 update seconds ago function and add tests 2023-06-01 18:48:06 +10:00
Stefan Haller
31a2ea1f19 Add --all to "git fetch" command when not fetching a specific remote 2023-06-01 10:13:14 +02:00
Stefan Haller
697157f5d5 Add tests for Fetch 2023-05-31 15:54:20 +02:00
Stefan Haller
ee4b9d20b1 Extract a FetchCmdObj function so that we can test it
No change in behavior.
2023-05-31 15:54:20 +02:00
Stefan Haller
a2bdab2135 Remove unused fetch options RemoteName and BranchName
These were never used, since there are separate functions for fetching a remote
and for fast-forwarding a branch.
2023-05-31 15:54:20 +02:00
Jesse Duffield
614a30134c
Merge pull request #2688 from tzengyuxio/master 2023-05-31 09:36:12 +10:00
Jesse Duffield
cc0edd42bb
Merge pull request #2508 from Ryooooooga/remove-jesseduffield-yaml 2023-05-30 17:39:25 +10:00
Tzeng Yuxio
5d8af7bbd8
Add Traditional Chinese support 2023-05-30 12:58:11 +08:00
Jesse Duffield
1de876ed4d Support using command output directly in menuFromCommand custom command prompt
The menuFromCommand option is a little complicated, so I'm adding an easy way to just use the command output directly,
where each line becomes a suggestion, as-is.

Now that we support suggestions in the input prompt, there's less of a need for menuFromCommand, but it probably still
serves some purpose.

In future I want to support this filter/valueFormat/labelFormat thing for suggestions too. I would like to think a little more
about the interface though: is using a regex like we currently do really the simplest approach?
2023-05-29 22:52:16 +10:00
Jesse Duffield
036a1ea519 Support suggestions generated from command in custom commands
This changes the interface a bit but it was only added earlier today so I doubt anybody is dependent on it yet.

I'm also updating the docs.
2023-05-29 22:47:35 +10:00
Jesse Duffield
16fa22a36e Add suggestionsPreset to custom commands system 2023-05-29 14:24:49 +10:00
Jesse Duffield
0e0458f355 More compact and flexible date format
You can now configure both a time format and a short time format, where the short format kicks in
when the time is within the last day
2023-05-26 17:31:39 +10:00
Jesse Duffield
05bfa96936
Merge pull request #2672 from jesseduffield/sentence-case 2023-05-26 17:21:33 +10:00
Jesse Duffield
be6acf2fbe
Merge pull request #2670 from jesseduffield/better-list-context-trait 2023-05-26 15:28:32 +10:00
Jesse Duffield
9c384c5267 Clean up helix editor preset 2023-05-26 09:19:12 +10:00
Jesse Duffield
d772c9f1d4 Use sentence case everywhere
We have not been good at consistent casing so far. Now we use 'Sentence case' everywhere. EVERYWHERE.

Also Removing 'Lc' prefix from i18n field names: the 'Lc' stood for lowercase but now that everything
is in 'Sentence case' there's no need for the distinction.

I've got a couple lower case things I've kept: namely, things that show up in parentheses.
2023-05-25 23:52:19 +10:00
Jesse Duffield
e5534d9781
Merge pull request #2668 from dvic/add-helix-support 2023-05-25 19:59:14 +10:00
Jesse Duffield
e0ecc9e835 Allow global logging when developing
I'll be honest, for all I know logging should be global in general: it is
a pain to pass a logger to any struct that needs it. But smart people on the
internet tell me otherwise, and I do like the idea of not having any global
variables lying around.

Nonetheless, I often need to log things when locally debugging and that's a
different kind of logging than the kind you would include in the actual
released binary. For example if I want to log something from gocui, I would
rather not have gocui depend on lazygit's logging setup.
2023-05-25 18:31:32 +10:00
Jesse Duffield
add1de4138 Use boolean field to control whether viewport is refreshed on line focus
Go really doesn't like us doing anything inheritance-y: it does not support open recursion meaning
it's really hard to re-use code. As such, here we're falling back to conditional logic.

This fixes an issue where our ListContextTrait was calling FocusLine which was intended to be
overridden by ViewportListContextTrait, but the subclassed function wasn't being called. I'm
not actually sure how this went wrong given that it was working fine in the past, but at any rate,
the new code is easy to follow.
2023-05-25 17:09:18 +10:00
dvic
ed496deeca
Add helix editor preset 2023-05-24 23:08:26 +02:00
Jesse Duffield
1f8e838052
Merge pull request #2656 from mazharz/gitlab-merge-request-url
Update gitlab merge request URL to match new routing
2023-05-23 22:54:57 +10:00
Jesse Duffield
fb0931e1a1 Fix discard logic
Missed a spot a couple PR's ago. We had an integration test which caught this but which was skipped due
to index.lock file issues. The test was also broken for other reasons due to it not having been running
for a while, so I've fixed that up too.
2023-05-23 20:23:08 +10:00
Jesse Duffield
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
Jesse Duffield
1a4cf84b58
Merge pull request #2661 from jesseduffield/cache-binary-paths
Cache binary paths
2023-05-23 19:19:49 +10:00
Jesse Duffield
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
Mazhar Zandsalimi
59379b45da Update gitlab commit URL to match new routing 2023-05-22 07:39:47 +03:30
Mazhar Zandsalimi
2d4ca2b54f Update gitlab merge request URL to match new routing 2023-05-21 13:21:34 +03:30
Stefan Haller
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
Jesse Duffield
ec3a28df43 Right-align key labels in menu
I find this makes it look a little nicer
2023-05-21 12:09:43 +10:00
Jesse Duffield
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
Jesse Duffield
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
Jesse Duffield
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
Jesse Duffield
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
Jesse Duffield
820f7b9404 Support strikethrough text style 2023-05-21 10:46:13 +10:00
Stefan Haller
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
Jesse Duffield
ed857d1e07 Show correct keybinding in tip 2023-05-20 23:36:34 +10:00
Jesse Duffield
ee11046d35 Refactor interface for ApplyPatch 2023-05-20 20:54:39 +10:00
Jesse Duffield
25f8b0337e Add convenience builder for git commands 2023-05-20 20:54:24 +10:00
Jesse Duffield
63ddc52a6b Increase test coverage 2023-05-20 16:55:15 +10:00
Stefan Haller
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
Stefan Haller
64b2685c2d Visualize the "ignore whitespace" state in the subtitle of the diff view 2023-05-20 12:58:32 +10:00
Stefan Haller
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
Stefan Haller
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
Jesse Duffield
d161afe37f Support ignoring whitespace on stash 2023-05-19 17:49:22 +02:00
Jesse Duffield
681a9bf20d
Merge pull request #2612 from longlhh90/fix-commit-prefixes-with-empty-commit-message 2023-05-17 17:12:05 +10:00
Lukas
0606b7a43b remove empty message check as message of commit can be empty 2023-05-17 17:07:50 +10:00
Stefan Haller
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
Jesse Duffield
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
Jesse Duffield
00b03079d8 Don't deactivate context that you're about to activate 2023-05-16 21:01:38 +10:00
Jesse Duffield
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
Jesse Duffield
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
Stefan Haller
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
Stefan Haller
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
Stefan Haller
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
Stefan Haller
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
Jesse Duffield
007b406b14 remove duplicate method 2023-05-11 19:00:41 +10:00
Jesse Duffield
2b30085dba Merge branch 'master' into refactor-better-encapsulation 2023-05-11 19:00:01 +10:00
Jesse Duffield
e156e090cc add ability to update yaml path while preserving comments 2023-05-10 22:31:27 +10:00
Jesse Duffield
3cac14c76e add comment to encourage keeping code and docs in sync 2023-05-04 16:53:13 +10:00
Stefan Haller
d607b366cb Add own version for test move_to_earlier_commit for older git versions 2023-05-02 16:27:32 +02:00
Stefan Haller
c8f26aca68 Rename From to AtLeast 2023-05-02 16:27:32 +02:00
Ryooooooga
30656b5ac6 chore(git_commands): support old git version (git rebase --empty=keep) 2023-05-02 16:27:32 +02:00
Jesse Duffield
5dacbb6293 merge master into refactor-better-encapsulation 2023-05-02 19:05:42 +10:00
Stefan Haller
fba1a2b5ac Add config gui.experimentalShowBranchHeads
People find the new (*) display for branch heads in the commits list confusing,
so make it opt-in for now.
2023-05-02 18:58:54 +10:00
Jesse Duffield
c6c4346d48
Merge pull request #2551 from stefanhaller/fix-initial-context-activation 2023-05-01 21:22:43 +10:00
Jesse Duffield
ee9ae8f07f
Merge pull request #2552 from stefanhaller/support-stacked-branches 2023-05-01 21:07:19 +10:00
Jesse Duffield
af97bf484c Refresh staging panel when committing
We now refresh the staging panel when doing an unscoped refresh, so that if we commit from the staging panel we escape
back to the files panel if need be. But that causes flickering when doing an unscoped refresh from other contexts,
because the refreshStagingPanel function assumes that the staging panel has focus. So we're adding a guard at the top
of that function to early exit if we don't have focus.
2023-04-30 13:19:54 +10:00
Jesse Duffield
a57310df24 Retain commit message when cycling history
When cycling history, we want to make it so that upon returning to the original prompt, you get your text back.
Importantly, we don't want to use the existing preservedMessage field for that because that's only for preserving
a NEW commit message, and we don't want the history stuff of the commit reword flow to overwrite that.
2023-04-30 13:19:54 +10:00
Sean
9d68b287db Split commit message panel into commit summary and commit description panel
When we use the one panel for the entire commit message, its tricky to have a keybinding both for adding a newline and submitting.
By having two panels: one for the summary line and one for the description, we allow for 'enter' to submit the message when done from the summary panel,
and 'enter' to add a newline when done from the description panel. Alt-enter, for those who can use that key combo, also works for submitting the message
from the description panel. For those who can't use that key combo, and don't want to remap the keybinding, they can hit tab to go back to the summary panel
and then 'enter' to submit the message.

We have some awkwardness in that both contexts (i.e. panels) need to appear and disappear in tandem and we don't have a great way of handling that concept,
so we just push both contexts one after the other, and likewise remove both contexts when we escape.
2023-04-30 13:19:53 +10:00
Jesse Duffield
a5c72d056d ensure initial context is set when entering submodule 2023-04-30 13:19:53 +10:00
Jesse Duffield
8a86de85c8 remove log call because it clutters test output 2023-04-30 13:19:53 +10:00
Jesse Duffield
dd31f8ecea update cheatsheets 2023-04-30 13:19:53 +10:00
Jesse Duffield
5a7b2ab6d0 fix rendering of commit files view 2023-04-30 13:19:53 +10:00
Jesse Duffield
68a9d7fd77 appease linter 2023-04-30 13:19:53 +10:00
Jesse Duffield
19cbafcdfc remove unused file 2023-04-30 13:19:53 +10:00
Jesse Duffield
f2c85c5b19 move side window actions to controllers package 2023-04-30 13:19:53 +10:00
Jesse Duffield
0faa41e6f8 move toggle whitespace action to controllers package 2023-04-30 13:19:53 +10:00
Jesse Duffield
2e32e55957 update integration test for toggling whitespace 2023-04-30 13:19:53 +10:00
Jesse Duffield
037cd99138 move quit actions to controller 2023-04-30 13:19:53 +10:00
Jesse Duffield
d3e9bc2185 remove unused file 2023-04-30 13:19:53 +10:00
Jesse Duffield
ea4587a3b8 move some methods 2023-04-30 13:19:53 +10:00
Jesse Duffield
2da300f2fb move diffing menu action to controller 2023-04-30 13:19:53 +10:00
Jesse Duffield
7848958326 move filtering menu action to controller 2023-04-30 13:19:53 +10:00
Jesse Duffield
2cba98e3fe move another action into controller 2023-04-30 13:19:53 +10:00
Jesse Duffield
f8c9ce33c2 move more actions into controller 2023-04-30 13:19:53 +10:00
Jesse Duffield
71753770ad move custom patch options menu action to controllers package 2023-04-30 13:19:53 +10:00
Jesse Duffield
820b1e811d move custom command action into its own file 2023-04-30 13:19:53 +10:00
Jesse Duffield
4a33fede7b move window arrangement helper 2023-04-30 13:19:53 +10:00
Jesse Duffield
db12853bbe lots of changes 2023-04-30 13:19:53 +10:00
Jesse Duffield
711674f6cd standardise controller helper methods 2023-04-30 13:19:53 +10:00
Jesse Duffield
fc91ef6a59 standardise helper args 2023-04-30 13:19:53 +10:00
Jesse Duffield
43251e7275 split context common from helper common 2023-04-30 13:19:53 +10:00
Jesse Duffield
f081358943 move getDisplayStrings funcs into contexts 2023-04-30 13:19:53 +10:00
Jesse Duffield
0c6ab4b43e refactor cherry pick code to move state access out of helper 2023-04-30 13:19:53 +10:00
Jesse Duffield
1b2fb34ffd start moving getDisplayStrings funcs into contexts 2023-04-30 13:19:53 +10:00
Jesse Duffield
0e5a4c7a36 move getModel functions into contexts 2023-04-30 13:19:53 +10:00
Jesse Duffield
47b91f1ef5 move views into contexts 2023-04-30 13:19:53 +10:00
Jesse Duffield
e2db6a1732 remove context callback opts 2023-04-30 13:19:53 +10:00
Jesse Duffield
509e3efa70 lots more refactoring 2023-04-30 13:19:53 +10:00
Jesse Duffield
8edad826ca Begin refactoring gui
This begins a big refactor of moving more code out of the Gui struct into contexts, controllers, and helpers. We also move some code into structs in the
gui package purely for the sake of better encapsulation
2023-04-30 13:19:52 +10:00
Jesse Duffield
9adbef40de Refresh staging panel when committing
We now refresh the staging panel when doing an unscoped refresh, so that if we commit from the staging panel we escape
back to the files panel if need be. But that causes flickering when doing an unscoped refresh from other contexts,
because the refreshStagingPanel function assumes that the staging panel has focus. So we're adding a guard at the top
of that function to early exit if we don't have focus.
2023-04-30 12:17:34 +10:00
Jesse Duffield
0cd5257523 Retain commit message when cycling history
When cycling history, we want to make it so that upon returning to the original prompt, you get your text back.
Importantly, we don't want to use the existing preservedMessage field for that because that's only for preserving
a NEW commit message, and we don't want the history stuff of the commit reword flow to overwrite that.
2023-04-30 12:17:34 +10:00
Sean
49da7b482d Split commit message panel into commit summary and commit description panel
When we use the one panel for the entire commit message, its tricky to have a keybinding both for adding a newline and submitting.
By having two panels: one for the summary line and one for the description, we allow for 'enter' to submit the message when done from the summary panel,
and 'enter' to add a newline when done from the description panel. Alt-enter, for those who can use that key combo, also works for submitting the message
from the description panel. For those who can't use that key combo, and don't want to remap the keybinding, they can hit tab to go back to the summary panel
and then 'enter' to submit the message.

We have some awkwardness in that both contexts (i.e. panels) need to appear and disappear in tandem and we don't have a great way of handling that concept,
so we just push both contexts one after the other, and likewise remove both contexts when we escape.
2023-04-30 12:17:34 +10:00
Stefan Haller
d675117289 Fix activation of initial context
This broke with 40f6767cfc77; the symptom is that starting lazygit with a git
arg (e.g. "lazygit log") wouldn't activate the requested panel correctly. While
it would show in the expanded view, it didn't have a green frame, and keyboard
events would go to the files panel.
2023-04-29 07:37:44 +02:00
Jesse Duffield
e63858215e refactor moveFixupCommitDown 2023-04-29 07:28:33 +02:00
Stefan Haller
3fe4db9316 Make RebaseCommands.AmendTo more robust
This fixes two problems with the "amend commit with staged changes" command:

1. Amending to a fixup commit didn't work (this would create a commmit with the
   title "fixup! fixup! original title" and keep that at the top of the branch)
2. Unrelated fixup commits would be squashed too.

The added integration test verifies that both of these problems are fixed.
2023-04-29 07:28:33 +02:00
Jesse Duffield
185bbf0c75 Refactor to tighten interface to lazygit daemon 2023-04-29 07:28:33 +02:00
Stefan Haller
a8586ba57e Refactor: simplify PrepareInteractiveRebaseCommand API
Instead of passing a bunch of different options in
PrepareInteractiveRebaseCommandOpts, where it was unclear how they interact if
several are set, have only a single field "instruction" which can be set to one
of various different instructions.

The functionality of replacing the entire todo file with our own is no longer
available; it is only possible to prepend todos to the existing file.

Also, instead of using different env vars for the various rebase operations that
we want to tell the daemon to do, use a single one that contains a json-encoded
struct with all available instructions. This makes the protocol much clearer,
and makes it easier to extend in the future.
2023-04-29 07:28:33 +02:00
Stefan Haller
dad7a70bf8 Implement moving commits up/down in terms of daemon 2023-04-29 07:28:33 +02:00
Stefan Haller
3791f0b2fa Implement "move patch to selected commit" in terms of daemon 2023-04-29 07:28:33 +02:00
Stefan Haller
b8fbe9756e Implement squash, fixup, drop, and reword in terms of daemon 2023-04-29 07:28:33 +02:00
Stefan Haller
ab25600ccb Extract EditRebaseTodo into a function in utils.rebaseTodo
We want to reuse it from the daemon code in the next commit.
2023-04-29 07:28:33 +02:00
Stefan Haller
d50c58b4c6 Implement "edit commit" in terms of the new EditRebase function 2023-04-29 07:28:33 +02:00
Stefan Haller
5645a662de Use --rebase-merges for interactive rebase
At the moment it doesn't make a big difference, because the vast majority of
callers create a list of todos themselves to completely replace what git came up
with. We're changing this in the following commits though, and then it's helpful
to preserve merges.
2023-04-29 07:28:33 +02:00
Stefan Haller
a41218551d Put gitCommon.version back in deps_test.go
This was reverted in 3546ab8f21, but shouldn't have.
2023-04-29 07:28:33 +02:00
Jesse Duffield
aec46942a8 enforce lowercase filenames 2023-04-29 13:05:05 +10:00
Jesse Duffield
aa70723e3a
Merge pull request #2558 from stefanhaller/allow-resetting-author-during-rebase 2023-04-29 12:44:14 +10:00
Jesse Duffield
7db54a948a
Merge pull request #2548 from AKARSHITJOSHI/fix/tagPush 2023-04-29 12:43:55 +10:00
J. B. Rainsberger
6c010a788c
Add an editor preset for kakoune (kakoune.org). 2023-04-27 13:41:54 -03:00
Jesse Duffield
79dc1d9052
Merge pull request #2557 from noahziheng/feature/add-gitea-pr 2023-04-24 13:42:05 +10:00
Noah Gao
bf3dd79b7a feat: add gitea to hosting service 2023-04-18 16:16:09 +00:00
Stefan Haller
21072226d2 Don't allow resetting non-HEAD commits (including rebase todos) during rebase 2023-04-18 17:34:07 +02:00
Stefan Haller
b09000194a Allow resetting author of HEAD commit during rebase 2023-04-18 17:33:33 +02:00
Ryooooooga
3546ab8f21
Revert "feat: support for push --force-if-includes"
This reverts commit e00f248cf7.
2023-04-17 19:37:33 +09:00
Personal
9a13447b97 Change push tag command
Signed-off-by: AKARSHITJOSHI <akarshitjoshi@gmail.com>
2023-04-16 10:37:11 +05:30
AzraelSec
08a445eb9d test: check focus on commits after performing an advanced rebase 2023-04-15 11:01:55 +02:00
AzraelSec
28501fbf77 chore: add focus on local commits after interactively rebase 2023-04-15 10:42:36 +02:00
Jesse Duffield
8f1f712841 use lowercase text for menu items (as we're still yet to standardise on 'Sentence case') 2023-04-15 17:29:31 +10:00
AzraelSec
b82b6a2992 test: add integration test to verify the interactive rebase correctly work 2023-04-15 17:26:08 +10:00
AzraelSec
ddcd6be245 refactor: introduce a struct to pack the
`PrepareInteractiveRebaseCommand` function
2023-04-15 17:26:08 +10:00
Jesse Duffield
711be78811 extract out function 2023-04-15 17:26:08 +10:00
AzraelSec
3422b1e218 test: update the UI to follow the new rebase type selection instead of confirm the previous popup 2023-04-15 17:26:08 +10:00
AzraelSec
a3fdf91714 feat: allow to perform a rebase with breaking before the first commit 2023-04-15 17:26:08 +10:00
AzraelSec
368f9c8cb3 feat: let interactive rebase prepend commands to the default todo file 2023-04-15 17:26:08 +10:00
Stefan Haller
d675eb6507 Don't allow changing the type of certain rebase todos
We already show "merge" todo entries when starting an interactive rebase with
--rebase-merges outside of lazygit. Changing the type of a merge entry to "pick"
or "edit" doesn't make sense and shouldn't be allowed. Earlier in this branch we
have started to show "update-ref" entries, these can't be changed either (they
can be moved, though).

You might argue that it should be possible to change them to "drop", but in the
case of "update-ref" this doesn't make sense either, because "drop" needs a Sha
and we don't have one here. Also, you would then be able to later change it back
to "pick", so we would have to remember that this isn't allowed for this
particular drop entry; that's messy, so just disallow all editing.
2023-04-15 08:36:03 +02:00
Stefan Haller
dc4e88f8a4 Make moving todo commits more robust 2023-04-15 08:36:03 +02:00
Stefan Haller
120dd1530a Make EditRebaseTodo more robust
It used to work on the assumption that rebasing commits in lazygit's model
correspond one-to-one to lines in the git-rebase-todo file, which isn't
necessarily true (e.g. when users use "git rebase --edit-todo" at the custom
command prompt and add a "break" between lines).
2023-04-15 08:36:03 +02:00
Stefan Haller
860a8d102b Add integration test for dropping a todo commit when there's an update-ref
The test shows how we are accidentally dropping the wrong commit in this case.
We'll fix that in the next commit.
2023-04-15 08:36:03 +02:00
Stefan Haller
a304fed68c Add GitVersion field to NewIntegrationTestArgs
It can be used to specify which git versions a given test should or should not run on.
2023-04-15 08:36:03 +02:00
Stefan Haller
227b0b781c Show update-ref commands in rebase todo list
This is useful when working with stacked branches, because you can now move
"pick" entries across an update-ref command and you can tell exactly which
branch the commit will end up in.

It's also useful to spot situations where the --update-refs option didn't work
as desired. For example, if you duplicate a branch and want to rebase only one
of the branches but not the other (maybe for testing); if you have
rebase.updateRefs=true in your git config, then rebasing one branch will move
the other branch along. To solve this we'll have to introduce a way to delete
the update-ref entry (maybe by hitting backspace?); this is out of scope for
this PR, so for now users will have to type "git rebase --edit-todo" into the
custom command prompt to sort this out.

We will also have to prevent users from trying to turn update-ref commands into
other commands like "pick" or "drop"; we'll do this later in this branch.
2023-04-15 08:36:03 +02:00
Stefan Haller
740474c10c Visualize branch heads in commits panel
Useful when working with stacked branches.
2023-04-15 08:36:03 +02:00
Stefan Haller
a0d179b6dc Make getHydratedRebasingCommits more robust
So far the algorithm worked on the assumption that the output of the "git show"
command corresponds one-to-one to the lines of the rebase-todo file. This
assumption doesn't hold once we start to include todo lines that don't have a
sha (like update-ref), or when the todo file contains multiple entries for the
same sha. This should never happen normally, but it can if users manually edit
the todo file and duplicate a line.
2023-04-15 08:36:03 +02:00
Stefan Haller
c53c5e47ef Store commit.Action as an enum instead of a string
The main reason for doing this (besides the reasons given for Status in the
previous commit) is that it allows us to easily convert from TodoCommand to
Action and back. This will be needed later in the branch. Fortunately,
TodoCommand is one-based, so this allows us to add an ActionNone constant with
the value 0.
2023-04-15 08:36:03 +02:00
Stefan Haller
188773511e Store commit.Status as an enum instead of a string
This is unrelated to the changes in this PR, but since we are doing the same
thing for the commit.Action field in the next commit, it makes sense to do it
for Status too for consistency. Modelling this as an enum feels more natural
than modelling it as a string, since there's a finite set of possible values.
And it saves a little bit of memory (not very much, since none of the strings
were heap-allocated, but still).
2023-04-15 08:36:03 +02:00
Jesse Duffield
7f5465a27b fix flaky tests 2023-04-14 21:01:45 +10:00
Stefan Haller
6a340ec840 Reorder tests 2023-04-13 19:17:08 +02:00
Stefan Haller
3535cd0f94 Rename test files to match test names 2023-04-13 19:17:08 +02:00
Jesse Duffield
82c54ed3d2
Merge pull request #2544 from scallaway/git-diff-detect-renames 2023-04-13 21:47:59 +10:00
Jesse Duffield
bd62b519de
Merge pull request #2496 from jesseduffield/feature/prevent-history-custom-command 2023-04-13 21:25:35 +10:00
Jesse Duffield
04e0a9bb45
Merge pull request #2523 from stefanhaller/editor-config 2023-04-13 21:22:17 +10:00
Luka Markušić
2b4ac986a2 Don't add custom command to history if it starts with space
Add tests for custom command with leading space
2023-04-13 21:20:46 +10:00
Stefan Haller
046b0d9daa Show warning about deprecated edit configs
We print this to the terminal after lazygit quits rather than showing it in a
panel at startup, so as to not annoy people too much. Hopefully it will still be
prominent enough this way.
2023-04-13 13:14:00 +02:00
Stefan Haller
e4e16fa38e Change OpenCommand to Open and OpenLinkCommand to OpenLink
We do this for consistency with the edit settings. The old names are kept as a
fallback for now.
2023-04-13 13:14:00 +02:00
Stefan Haller
b7e029adc7 Don't set platform defaults on OSConfig struct immediately
Instead, query the platform defaults only if the config is empty. This will be
necessary later to distinguish an empty config from a default config, so that we
can give deprecation warnings.
2023-04-13 13:14:00 +02:00
Stefan Haller
08d679c3a8 Remove line number support for "open" command
The "open" command is supposed to behave in the same way as double-clicking a
file in the Finder/Explorer. The concept of jumping to a specific line in the
file doesn't make sense for this; use "edit" instead.
2023-04-13 13:14:00 +02:00
Stefan Haller
2947b56134 Add support for falling back to legacy edit config 2023-04-13 13:14:00 +02:00
Stefan Haller
659d668e16 Implement edit presets 2023-04-13 13:14:00 +02:00
Stefan Haller
7bbcec965b Cleanup: fix copy/paste error in comment 2023-04-13 13:14:00 +02:00
Stefan Haller
24de156592 Fix windows tests
Now that the tests run again, it turns out that they actually fail, so fix them.
2023-04-13 13:14:00 +02:00
Stefan Haller
8d3cce4a49 Rename test files so that test discovery works again
These files were renamed from os_windows_test.go to os_test_windows.go (etc.) in
95b2e9540a. Since then, the tests have no longer run, since go only looks for
tests in files ending with "test.go".

It isn't important that the file name ends with "_windows.go", since there are
already build constrains in the files themselves.
2023-04-13 13:14:00 +02:00
Scott Callaway
6ffe98abac
feat: remove --no-renames flag from main panel diffs (to show renamed files) 2023-04-13 10:57:38 +01:00
Scott Callaway
046cb942c2
fix: organise commit test file
Pulled this out into a separate commit since it was unrelated to the
feature coming behind it.

This just cleans up the `commit_test.go` file slightly (for the method
that I was working on) so that the tests are built in a way that is
slightly more readable - testing each configuration option individually
without combining any of them.
2023-04-12 12:31:06 +01:00
Andrew
298dae23e8 fix: generalize parsing of ssh git urls 2023-04-03 12:10:30 +10:00
Jesse Duffield
a02b54e1b7
Merge pull request #2497 from stefanhaller/fix-initial-scroll-bar-size 2023-04-02 16:38:07 +10:00
Jesse Duffield
0af4e5a843 prevent unnecessary re-renders of view 2023-04-02 15:44:05 +10:00
Stefan Haller
d508badd62 Better error message when trying to amend a commit other than head during rebase 2023-04-01 08:16:15 +02:00
Luka Markušić
e7d0116312 Allow amending the head commit during interactive rebase 2023-04-01 08:16:15 +02:00
Stefan Haller
85fdb700ba Extract amendHead function into new AmendHelper 2023-04-01 08:16:15 +02:00
Stefan Haller
7513d77567 Add integration test for amending from the files panel 2023-04-01 08:16:15 +02:00
Stefan Haller
c757063264 Better error message when trying to edit or move a non-todo commit during rebase
Previously we would have tried to do the rebase, resulting in a long and
somewhat cryptic error message from git; now we check ourselves and show a less
intimidating message.
2023-04-01 08:16:15 +02:00
Stefan Haller
b24955063c Allow rewording the head commit during interactive rebase 2023-04-01 08:16:15 +02:00
Stefan Haller
c6930e0538 Cleanup: use commit.isTODO() consistently
It seems cleaner than checking the Status for "rebasing".
2023-04-01 08:16:15 +02:00
Jesse Duffield
213ae8dd07 fix reflog text colour by defaulting every view to the same foreground colour 2023-03-26 15:24:09 +11:00
Jesse Duffield
4780953cef
Merge pull request #2377 from shinhs0506/clear-staging-after-commit 2023-03-24 19:13:00 +11:00
Jesse Duffield
8121a0cc74 remove old integration test recording code 2023-03-24 18:42:11 +11:00
Stefan Haller
4adca84d68 Make sure scrollbars have the right size initially
We refresh the view after reading just enough to fill it, so that we see the
initial content as quickly as possible, but then we continue reading enough
lines so that we can tell how long the scrollbar needs to be, and then we
refresh again. This can result in slight flicker of the scrollbar when it is
first drawn with a bigger size and then jumps to a smaller size; however, that's
a good tradeoff for a solution that provides both good speed and accuracy.
2023-03-21 18:26:18 +01:00
Stefan Haller
b7c61aa883 Push initial context instead of just putting it in the context array
This makes sure activateContext gets called on it.
2023-03-20 20:14:13 +11:00
Stefan Haller
40f6767cfc Avoid deactivating and activating when pushing the current context again
When calling PushContext, do nothing if the context to be pushed is already on
top of the stack. Avoids flicker in certain situations.
2023-03-20 20:14:13 +11:00