1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-01-08 04:04:22 +02:00
lazygit/pkg
Stefan Haller b35f8776e1 Warn when there are hunks with only added lines
The algorithm works by blaming the deleted lines, so if a hunk contains only
added lines, we can only hope that it also belongs in the same commit. Warn the
user about this.

Note: the warning might be overly agressive, we'll have to see if this is
annoying. The reason is that it depends on the diff context size whether added
lines go into their own hunk or are grouped together with other added or deleted
lines into one hunk. However, our algorithm uses a diff context size of 0,
because that makes it easiest to parse the diff; this results in hunks having
only added lines more often than what the user sees. For example, moving a line
of code down by two lines will likely result in a single hunk for the user, but
in two hunks for our algorithm. On the other hand, being this strict makes the
warning consistent. We could consider using the user's diff context size in the
algorithm, but then it would depend on the current context size whether the
warning appears, which could be confusing. Plus, it would make the algorithm
quite a bit more complicated.
2024-01-10 09:11:40 +01:00
..
app Show a friendly error message when starting lazygit from a non-existent cwd 2024-01-02 18:25:28 +00:00
cheatsheet Use go:generate for generating cheatsheets 2023-09-29 20:38:29 +02:00
commands Add command to find base commit for creating a fixup 2024-01-10 09:11:40 +01:00
common Add AppState to common.Common 2023-09-04 17:48:39 +02:00
config Add command to find base commit for creating a fixup 2024-01-10 09:11:40 +01:00
constants
env Support bare worktrees where worktree does not have its own .git file 2023-08-07 22:40:53 +10:00
fakes
gui Warn when there are hunks with only added lines 2024-01-10 09:11:40 +01:00
i18n Warn when there are hunks with only added lines 2024-01-10 09:11:40 +01:00
integration Warn when there are hunks with only added lines 2024-01-10 09:11:40 +01:00
jsonschema Add UserConfig jsonschema generation script 2023-12-02 10:46:24 +01:00
logs
snake
tasks
theme Add a "Mark commit as base commit for rebase" command 2023-07-31 08:41:41 +02:00
updates
utils Pass "now" into utils.Loader 2023-10-16 09:03:07 +02:00