lazygit/pkg
Stefan Haller c712b1d0fe Better local branch delete confirmation
Currently we try to delete a branch normally, and if git returns an error and
its output contains the text "branch -D", then we prompt the user to force
delete, and try again using -D. Besides just being ugly, this has the
disadvantage that git's logic to decide whether a branch is merged is not very
good; it only considers a branch merged if it is either reachable from the
current head, or from its own upstream. In many cases I want to delete a branch
that has been merged to master, but I don't have master checked out, so the
current branch is really irrelevant, and it should rather (or in addition) check
whether the branch is reachable from one of the main branches. The problem is
that git doesn't know what those are.

But lazygit does, so make the check on our side, prompt the user if necessary,
and always use -D. This is both cleaner, and works better.

See this mailing list discussion for more:
https://lore.kernel.org/git/bf6308ce-3914-4b85-a04b-4a9716bac538@haller-berlin.de/
2024-09-28 11:19:32 +02:00
..
app Add changeToFixup field to MoveFixupCommitDown 2024-09-15 11:19:39 +02:00
cheatsheet Initialize translation set after reading user config 2024-08-18 10:24:52 +02:00
commands Better local branch delete confirmation 2024-09-28 11:19:32 +02:00
common Make common.UserConfig an atomic.Pointer for safe concurrent access 2024-08-18 10:24:52 +02:00
config Add options for disabling switching to the Files panel after popping or applying a stash 2024-09-15 11:59:59 +02:00
constants Make the links in the status panel point to the current version rather than master 2024-03-22 08:13:59 +01:00
env Support bare worktrees where worktree does not have its own .git file 2023-08-07 22:40:53 +10:00
fakes
gui Better local branch delete confirmation 2024-09-28 11:19:32 +02:00
i18n Add question marks to questions 2024-09-28 11:19:32 +02:00
integration Better local branch delete confirmation 2024-09-28 11:19:32 +02:00
jsonschema Fix boolean config keys not appearing in the generated Config.md 2024-05-31 20:07:58 +02:00
logs Remove secureexec package 2023-07-30 19:59:51 +10:00
snake
tasks Use ScanLinesAndTruncateWhenLongerThanBuffer instead of bufio.ScanLines 2024-05-15 13:27:01 +02:00
theme Highlight inactive selection in bold 2024-06-23 14:43:13 +02:00
updates Change direct access to Common.UserConfig to a getter 2024-08-18 10:24:52 +02:00
utils Add changeToFixup field to MoveFixupCommitDown 2024-09-15 11:19:39 +02:00