summaryrefslogtreecommitdiffstats
path: root/pkg
AgeCommit message (Collapse)Author
2024-03-23Set the `TERM` env variableTau
This communicates to pagers that we're in a very simple terminal that they should not expect to have much capabilities. See #3419
2024-03-23Fix inline status removal when recording demosStefan Haller
2024-03-23Update interactive rebase demoJesse Duffield
I'm adding an explicit delay between moving the commits and selecting the next items because otherwise it happens too fast
2024-03-22Fix container detectionaritmos
Running WSL without a container would be treated as native linux, causing problems at it would then attempt to use `xdg-open`. This was caused by `isContainer()` always returning true due to some dubious conditionals. These have been removed. The env-var check seems to not be used by lazygit, nor any common containers, and therefore appears to only exist to manually tell lazygit to behave as if it were inside of a container. This functionality has been kept, but the env-var has been changed to be all uppercaps as to comply with the POSIX standard. Fixes #2757 Bug introduced in 4d78d76
2024-03-22Change CopiedToClipboard text to start lower-caseStefan Haller
It is used in the context "'xyz' copied to clipboard", so it looks weird when it start uppercase.
2024-03-22Change toast for copying sha to clipboard to include what was copiedStefan Haller
This makes it easier to see that "y, enter" copies the full sha, whereas ctrl-o copies an abbreviated sha.
2024-03-22Change log message for copying sha to the clipboard to include "full"Stefan Haller
To make it even clearer that this is different from copying a sha with ctrl-o.
2024-03-22Add config to truncate commit hashes when copying them to the clipboardStefan Haller
I often copy hashes in the commits panel in order to paste them into Github comments (or other places), and I can't stand it when they have the full length. I picked a default of 12 for this; I find this to be a good middle ground between being reliable in large repos (12 still works in the linux kernel repo today, but it might not be enough in really huge repos) and not being too ugly (many smaller repos can probably get away with less). We deliberately don't change this for the "Copy to clipboard" menu, since this gives users a way to copy the unabbreviated sha if they need this occasionally.
2024-03-22Make it easy to create "amend!" commitsStefan Haller
To support this, we turn the confirmation prompt of the "Create fixup commit" command into a menu; creating a fixup commit is the first entry, so that "shift-F, enter" behaves the same as before. But there are additional entries for creating "amend!" commits, either with or without file changes. These make it easy to reword commit messages of existing commits.
2024-03-22Remove CreateFixupCommitDescription as it's identical to CreateFixupCommitStefan Haller
2024-03-22Support editing multiple files at once using range selectionStefan Haller
We pass all of them to a single editor command, hoping that the editor will be able to handle multiple files (VS Code and vim do). We ignore directories that happen to be in the selection range; this makes it easier to edit multiple files in different folders in tree view. We show an error if only directories are selected, though.
2024-03-22When creating a new remote, select it and fetch itStefan Haller
I'm doing these two things every time I add a new remote, in 100% of the cases, so do them automatically for me.
2024-03-22Make links in status view clickable, and underline themStefan Haller
2024-03-22Make the links in the status panel point to the current version rather than ↵Stefan Haller
master We've seen a lot of issues recently where people complain that lazygit doesn't behave as documented, but that was only because they were running the latest release but were looking at the documentation of master. Make the documentation links in the status panel point to the release that they are using in the hope that this will help a little bit with this problem.
2024-03-21Always prompt to return from subprocess if there was an errorstk
Except when we are running integration tests, in which case we never want to prompt because there wouldn't be a way to confirm the prompt.
2024-03-19Fix indentationStefan Haller
2024-03-19Improve translations for zh_TWStefan Haller
Authored-by: Oliver Tzeng <olivertzeng@proton.me>
2024-03-18Fix disabling the switch-to-editor menu item if unavailableStefan Haller
Some operations don't support switching to the editor from the commit message panel; an example is the commit message panel that appears when moving a custom patch into a new commit. Disable the "open in editor" menu entry in this case, instead of silently doing nothing.
2024-03-18Always show the "Press <c-o> to open menu" help text in the commit panelStefan Haller
Previously we would hide it if no onSwitchToEditor function was set; that was from a time when <c-o> was bound directly to the switch-to-editor command. Now it is bound to showing a menu, and that menu is always available even if no onSwitchToEditor function is set. (We rather need to disable the switch to editor item _within_ that menu, see next commit.)
2024-03-17Add missing translations for polishundg
2024-03-17Get rid of the retain-sort-order-when-filtering logic againStefan Haller
For die-hard fuzzy-searching fans it's probably in the way, so taking it out makes fuzzy filtering work better. For substring filtering it always retains the sort order anyway.
2024-03-17Rename FuzzySearchFunc to FilterFuncStefan Haller
It isn't necessarily fuzzy any more.
2024-03-17Rename FuzzySearch to FilterStringsStefan Haller
It isn't necessarily fuzzy any more.
2024-03-17Default to substring filtering, add option to go back to fuzzy filteringStefan Haller
By default we now search for substrings; you can search for multiple substrings by separating them with spaces. Add a config option gui.filterMode that can be set to 'fuzzy' to switch back to the previous behavior.
2024-03-17Don't sort the results of fuzzy.FindStefan Haller
It sorts them already, so it's unnecessary. In the next commit we use this same code for substring searching too, and in that case we don't want to sort because sorting is by Score, but we don't even fill in the score for substring searching.
2024-03-17Refresh after creating local branch, before checking it outStefan Haller
This way we see the local branch immediately when switching to the branches view, and we see an inline waiting status on it when checking it out.
2024-03-17Show inline waiting status when checking out a local branchStefan Haller
2024-03-17Show the same menu when pressing space on a remote branchStefan Haller
The old behavior of showing a prompt to choose a name for the new local branch is still available via the 'n' keybinding.
2024-03-17When checking out a remote branch by name, ask the user howStefan Haller
The choices are to create a new local branch that tracks the remote, or a detached head.
2024-03-17Don't ask to force-push if the remote rejected updatesStefan Haller
Lazygit has two ways to decide whether it needs to ask the user to force-push: 1. if it knows ahead of time that the push will fail because the branch has diverged, by looking at the incoming/outgoing information that it shows as ↑3↓7. 2. by examining the error that comes back when the push has failed. The second situation should happen only rarely, because lazygit fetches every minute by default, so the ↑3↓7 information is usually up to date. It might not be if the user turned off auto-fetch (or increased the auto-fetch interval). However, in this case it's almost always harmful to prompt the user to force-push, because we know that the reason for diverging is that something was pushed to the remote, and we would wipe it out by force-pushing. In such a situation, the more likely user action is to pull the remote changes and then push normally again. So just remove the second prompt, and replace it by a better error message when we detect that updates were rejected remotely. A little bit of history archeology reveals that the second prompt was added at a time where we didn't have the first one yet, so at that time it made sense to have it; but when the first prompt was added, we should have removed the second.
2024-03-16Set mode to none when calling SetSelectionRangeAndMode with empty non-sticky ↵Stefan Haller
range So far, the only situation where we called SetSelectionRangeAndMode was one where the range could only get larger (in startInteractiveRebaseWithEdit, in which case update-ref todos can be inserted by the rebase). However, in the last commit we introduced a new call site where the range can get smaller, including being reduced to a single item. Since this is indistinguishable from a single selection, set the mode to none in this case; without this, hitting escape would seemingly do nothing because it collapses the empty range selection.
2024-03-16Allow deleting update-ref todosStefan Haller
2024-03-16Extract a findTodo helper functionStefan Haller
We will reuse it in the next commit.
2024-03-16Allow moving update-ref todos up/downStefan Haller
2024-03-16Store full ref in Name field of update-ref commitsStefan Haller
Strip the prefix at presentation time instead. This makes it easier to find update-ref todos in order to move them up/down, or delete them.
2024-03-16Refactor: pass Todo to moveTodoUp/Down instead of Sha and ActionStefan Haller
We need this because we want to enable moving update-ref todos, which don't have a sha.
2024-03-12Handle mouse-wheel scrolling in confirmation panelStefan Haller
This can easily happen for the breaking changes panel when there are many.
2024-03-12Show popup message with breaking changes on startupStefan Haller
2024-03-11Add integration testStefan Haller
2024-03-11Add commit menu entry "Add co-author"Abhishek Keshri
2024-03-11Add a commit menu to the commit message panelAbhishek Keshri
And move the "switch to editor" command into this menu. So far this is the only entry, but we'll add another one in the next commit.
2024-03-11Extract functions AddCoAuthorToMessage and AddCoAuthorToDescriptionStefan Haller
In this commit we only need the former; the latter will be reused later in this branch.
2024-03-11Make test assertion more specificStefan Haller
It's safe to rely on git padding the log messages with exactly four spaces (I think). This makes the diff of the following commit slightly clearer.
2024-03-11Make keybindings for the "Amend attribute" menu configurableAbhishek Keshri
2024-03-11Internationalize the tooltips of the "Amend commit attributes" menuAbhishek Keshri
2024-03-09Add integration testStefan Haller
2024-03-09Remove hard line breaks when rewording commitsStefan Haller
... and when recalling a commit message from an old commit by pressing up-arrow. This is necessary because committing turns our soft line breaks into real ones, but when rewording we want to turn them back into soft ones again, so that it's possible to insert words at the beginning of a paragraph and have everything rewrap nicely. This is only a best effort; the algorithm only removes those hard line breaks that can be removed without changing the way the message looks. This works well when the previous commit message was wrapped at the same width, which for most users should be the most common case; but if it wasn't, the result is not great. Specifically, if the old wrap width was smaller, some hard line breaks just won't be removed; if it was wider though, you'll get an unpleasant comb effect with alternating long and short lines. In such a case it's best to switch to the editor and use whatever wrapping features you have there (e.g. alt-Q).
2024-03-09Replace DOS linefeeds with Unix line feeds when loading a commit messageStefan Haller
I have seen some commit messages that contain CRLF instead of just LF; I'm not sure if these were created by a broken git client, but they exist, so we need to deal with them. Editing them when rewording a commit sort of works, but is a little strange; the \r characters are invisble, so you need an extra arrow key press to skip over them. In the next commit we are going to add more logic related to line breaks, and it is getting confused by the \r, so it is becoming more important to fix this. The easiest fix is to normalize the line endings right after loading.
2024-03-09Save and restore the unwrapped descriptionStefan Haller
When preserving the commit message (when cancelling a commit), and later restoring it, use the unwrapped description.
2024-03-09Add config for soft-wrapping the commit message bodyStefan Haller