Commit Graph
4282 Commits
Author SHA1 Message Date
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 HallerandGitHub de69fbd645 Merge pull request #2682 from stefanhaller/show-entry-for-conflicted-commit
Show rebase todo entry for conflicted commit
2023-06-22 19:00:41 +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
README-bot 41b00c8313 Updated README.md 2023-06-22 16:55:20 +00:00
Stefan HallerandGitHub 06892cb0ac Merge pull request #2731 from jesseduffield/config-for-nerd-fonts-version
Add config for nerd fonts version
2023-06-22 18:55:05 +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
Jesse DuffieldandGitHub c410d26006 Merge pull request #2717 from jesseduffield/jesseduffield-patch-1 2023-06-08 11:09:28 +10:00
Jesse DuffieldandGitHub db1fd85e12 Update README.md 2023-06-08 10:33:08 +10:00
Stefan HallerandGitHub 1489a31e48 Merge pull request #2712 from stefanhaller/discard-changes-only-from-local-commits
Allow discarding changes only from local commits
2023-06-07 16:40:56 +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 HallerandGitHub e229e26fbe Merge pull request #2707 from stefanhaller/better-prompt-for-discarding-old-file-changes
Better prompt for discarding old file changes
2023-06-07 12:47:19 +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 DuffieldandGitHub 0080684c7c Merge pull request #2715 from jesseduffield/recent-repos 2023-06-07 18:33:05 +10: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 DuffieldandGitHub b6a31369da Merge pull request #2714 from jesseduffield/author-suggestions-custom-commands 2023-06-07 17:21:03 +10:00
Jesse Duffield a694c458dd Support authors and tags in custom command suggestions preset 2023-06-07 10:18:01 +10:00
README-bot ced773ab18 Updated README.md 2023-06-05 13:19:01 +00:00
Stefan HallerandGitHub a741b81b21 Merge pull request #2708 from enricozb/patch-1
fix kakoune binary name
2023-06-05 15:18:45 +02:00
Enrico BorbaandGitHub cbbb281011 kakoune binary name 2023-06-05 08:53:39 -04:00
README-bot e6fc332748 Updated README.md 2023-06-03 05:56:51 +00:00
Jesse DuffieldandGitHub 042ab2f99a Merge pull request #2704 from jesseduffield/int-matchers 2023-06-03 15:56:34 +10: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 DuffieldandGitHub e98935f83e Merge pull request #2699 from jesseduffield/revert-hide-underscores 2023-06-01 22:30:56 +10:00
Jesse DuffieldandGitHub 75293ff572 Merge pull request #2700 from jesseduffield/refresh-commits-viewport-on-focus-lost 2023-06-01 22:30:45 +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 DuffieldandGitHub caab31ff38 Merge pull request #2274 from jesseduffield/show-commit-against-branch 2023-06-01 19:25:00 +10:00
Jesse Duffield a4db44bc3d show commits against branches 2023-06-01 19:21:24 +10:00
Jesse DuffieldandGitHub 4b3f8055d0 Merge pull request #2696 from jesseduffield/default-to-default 2023-06-01 19:08:52 +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 DuffieldandGitHub 860fd23b42 Merge pull request #2695 from jesseduffield/fix-time-ago-function 2023-06-01 18:53:55 +10:00