lazygit/pkg/commands
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
..
git_commands Better local branch delete confirmation 2024-09-28 11:19:32 +02:00
git_config Use print instead of printf when there are no arguments 2024-08-27 10:33:06 +02:00
hosting_service Remove non-English translation sets, read them from JSON instead 2024-06-23 14:47:50 +02:00
models Add ShortRefName to Ref interface 2024-08-28 18:27:52 +02:00
oscommands [DATALAD RUNCMD] Do interactive fixing of some ambigous typos 2024-08-27 18:03:00 +02:00
patch Fix custom patch operations on added files 2024-06-23 12:40:31 +02:00
testdata
types/enums Show mode-specific keybinding suggestions 2024-01-28 08:33:13 +11:00
git.go Add ahead/behind information for @{push} 2024-05-19 09:44:38 +02:00
git_cmd_obj_builder.go Use an interactive shell for running custom commands 2024-08-17 10:32:18 +02:00
git_cmd_obj_runner.go