lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

Command history lacks detail when deleting a branch

Open ptim opened this issue 2 years ago • 1 comments

Niggle:

I just inadvertently deleted the wrong branch, but lazygit made it harder to find the hash to recover:

I expected / would hope for:

# from the CLI
git branch -D "feature/my-branch"
Deleted branch feature/my-branch (was 0ffd351).

# when I can see the hash, I can recover like:
git checkout -b "feature/my-branch" 0ffd351

Lazygit omits the hash of the head of the deleted branch in the log:

Delete branch
    git branch -d "feature/my-branch"

Solution I like

Include the hash in the log message:

Delete branch
    Deleted branch feature/my-branch (was 0ffd351).

Alternatives considered

  • don't use lazygit for branch deletion
  • recover using other methods

Thanks for considering!

ptim avatar Feb 23 '23 02:02 ptim

Perhaps we should write all outputs of logged commands to the command log panel. We already do for pulling/pushing. Might make things cluttered but worth doing a spike on it to see what it looks like.

jesseduffield avatar Feb 23 '23 05:02 jesseduffield