lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

Add squash merge support

Open rodakd opened this issue 2 years ago • 5 comments

  • PR Description

I do git merge --squash branch a lot so I've added this shortcut for myself. I think some people may want this too so here it is.

  • Please check if the PR fulfills these requirements
  • [x] Cheatsheets are up-to-date (run go generate ./...)
  • [x] Code has been formatted (see here)
  • [x] Tests have been added/updated (see here for the integration test guide)
  • [x] Text is internationalised (see here)
  • [x] Docs (specifically docs/Config.md) have been updated if necessary
  • [x] You've read through your own file changes for silly mistakes etc

rodakd avatar Nov 24 '23 18:11 rodakd

@rodakd I haven't heard from you again after giving feedback; do you intend to keep working on this?

stefanhaller avatar Jan 21 '24 08:01 stefanhaller

Hello since there's no news, should I remake a PR with theses changes ?

noahfraiture avatar May 15 '24 10:05 noahfraiture

Hello since there's no news, should I remake a PR with theses changes ?

I wouldn't have any objections to that. I would, however, be interested in discussing this question first. Any thoughts on that?

stefanhaller avatar May 15 '24 11:05 stefanhaller

Hello since there's no news, should I remake a PR with theses changes ?

I wouldn't have any objections to that. I would, however, be interested in discussing this question first. Any thoughts on that?

I personally have no objection but in my use case I don't always make a commit, I might divide the changes in multiple commits or remove some change. However, having a formatted message showing well that it is a merge could be good for clarity and commit are always editable. Maybe having both good be great, but it requires to either open a new window like for rebase options, or having to keys which might a bit too much. What do you think ?

noahfraiture avatar May 15 '24 11:05 noahfraiture

We probably want to have a confirmation panel anyway (this PR has one). Instead of the confirmation panel we could show a menu with two options, something like this, maybe:

+-- Squash Merge "my-feature" into current branch --+
|c Squash Merge and commit                           |
|u Squash Merge and leave uncommitted                |
|  Cancel                                            |
+---------------------------------------------------+

Or something along these lines. I would vote for making the "and commit" version the first one, as I think it's the more common one.

stefanhaller avatar May 15 '24 11:05 stefanhaller

This was completed in https://github.com/jesseduffield/lazygit/pull/3566. Thanks for getting the ball rolling on it!

jesseduffield avatar Jul 06 '24 10:07 jesseduffield