phil294 / GitLG

A free, interactive Git UI for VSCode
MIT License
156 stars 16 forks source link

git squash multiple selected commits #75

Open phil294 opened 9 months ago

phil294 commented 9 months ago

would be nice to have for some but I don't know how the respective git command(s) for that would look like.

Squashing is possible with git of course, but since the multiple-commits-selection can have arbitrary gaps...

image

I don't know what the action should do here (git / basic bash commands) without rewriting the entire extension

hansu commented 9 months ago

Suggestion:

phil294 commented 9 months ago

Do not allow multiple selections (more than two) with Ctrl+click

but it's really handy for cherry-picking and reverting them :/

Allow selection of multiple commits (without gaps) with Shift+click

that's already possible, but yeah, with gaps allowed

hansu commented 9 months ago

Do not allow multiple selections (more than two) with Ctrl+click

but it's really handy for cherry-picking and reverting them :/

Do you usually revert multiple commits at once?

Allow selection of multiple commits (without gaps) with Shift+click

that's already possible, but yeah, with gaps allowed

No, shift + click doesn't work with v0.1.14 on my machine...

phil294 commented 9 months ago

No, shift + click doesn't work with v0.1.14 on my machine...

are you using MacOS?

hansu commented 9 months ago

No, shift + click doesn't work with v0.1.14 on my machine...

are you using MacOS?

No, Linux

SeijiSuenaga commented 8 months ago

As an initial iteration, could the squash action only appear when the selection has no gaps? That would be sufficiently useful for many (perhaps most) cases.

phil294 commented 17 hours ago

No, shift + click doesn't work with v0.1.14 on my machine...

@hansu is this still the case in the latest release?

As an initial iteration, could the squash action only appear when the selection has no gaps? That would be sufficiently useful for many (perhaps most) cases.

@SeijiSuenaga yes but main problem with this approach is that the concept of "gap" isn't distinct, as the ordering of commits depends on the sorting options currently set, and other branches' commits could be in the way. There's related discussion about this in #110. The continuitation logic would have to rely on Git's internal commit parent logic, but when it conflicts with the UI, that can be rather confusing. Shouldn't stop us from implementing this feature still.

hansu commented 4 hours ago

No, shift + click doesn't work with v0.1.14 on my machine...

@hansu is this still the case in the latest release?

Works now, thanks!

Edit: But only when selecting from top to bottom - the other way around not.