1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-17 00:18:05 +02:00
Commit Graph

6505 Commits

Author SHA1 Message Date
2be4359e87 Use comment char on interactive rebase (#2639) 2023-07-02 09:52:35 +02:00
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
4df353d006 Bump gocui 2023-07-02 15:47:04 +10:00
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
87fe30d50d Bump git-todo-parser 2023-07-02 02:07:32 -03:00
cff9850374 Add tests of interactive rebase with custom comment character 2023-07-02 02:07:32 -03:00
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
eb7e0e7252 Updated README.md 2023-06-29 07:23:46 +00:00
074396a892 Merge pull request #2750 from letavocado/fix-typo-EnteRefName 2023-06-29 17:23:31 +10:00
62cc036254 fix: typo EnteRefName 2023-06-28 18:54:21 +06:00
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
69df9ba105 Merge pull request #2729 from translation-gang/translation-ru 2023-06-28 10:21:07 +10:00
5133113142 feat(i18n): add russian translation 2023-06-28 00:34:59 +06:00
8051052ea7 Merge pull request #2725 from stefanhaller/improve-pushed-coloring-for-main-branches
Use remote upstreams of main branches to determine merged status of commits
2023-06-26 09:28:31 +02:00
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
4e573e4bb1 Merge pull request #2706 from stefanhaller/fix-discard-change-prompt
Fix the title and text of the Discard Changes prompt
2023-06-26 08:26:00 +02:00
2f6b7b9bc3 Rename the gui.skipUnstageLineWarning conf key to gui.skipDiscardChangeWarning 2023-06-26 08:19:58 +02:00
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
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
6ecd691223 Merge pull request #2718 from stefanhaller/improve-yaml-utils
Improve yaml_utils
2023-06-26 08:14:51 +02:00
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
85f293af1a Add new function RenameYamlKey 2023-06-26 08:11:10 +02:00
9cbd7fe69e Extract a lookupKey function that will be useful in the next commit 2023-06-26 08:11:10 +02:00
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
6acabba417 Return an error if some node in the path is not a dictionary 2023-06-26 08:11:10 +02:00
7fb86d6e9c Return an error if node to be updated is not a scalar 2023-06-26 08:11:10 +02:00
221433522d Return an error if document is not a dictionary 2023-06-26 08:11:10 +02:00
90084d115e Support updating values in empty documents 2023-06-26 08:11:10 +02:00
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
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
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
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
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
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
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
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
3d76c734aa Add test for amending a commit, causing a conflict 2023-06-22 18:57:43 +02:00
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
41b00c8313 Updated README.md 2023-06-22 16:55:20 +00:00
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
77c5d1761d Add nerdFontsVersion config 2023-06-15 21:47:52 +02:00
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
1a2a301aa2 Add instructions for openSUSE 2023-06-12 08:21:34 +02:00
c410d26006 Merge pull request #2717 from jesseduffield/jesseduffield-patch-1 2023-06-08 11:09:28 +10:00
db1fd85e12 Update README.md 2023-06-08 10:33:08 +10:00
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
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
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
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
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