jesseduffield.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 update release notes 2021-04-20 18:34:47 +10:00
env Support bare worktrees where worktree does not have its own .git file 2023-08-07 22:40:53 +10:00
fakes cleanup integration test code 2023-02-26 12:54:13 +11:00
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 Remove secureexec package 2023-07-30 19:59:51 +10:00
snake integrate snake game into lazygit 2022-12-30 12:18:59 +11:00
tasks Remove secureexec package 2023-07-30 19:59:51 +10:00
theme Add a "Mark commit as base commit for rebase" command 2023-07-31 08:41:41 +02:00
updates Construct arg vector manually rather than parse string 2023-05-23 19:49:19 +10:00
utils Pass "now" into utils.Loader 2023-10-16 09:03:07 +02:00