rebase icon indicating copy to clipboard operation
rebase copied to clipboard

Autosquash

Open fkorotkov opened this issue 5 years ago • 6 comments

Fixes #20

fkorotkov avatar Nov 18 '19 03:11 fkorotkov

@fkorotkov was this closed on purpose? Didn't you mean to merge it instead?

marton78 avatar Dec 18 '19 16:12 marton78

It didn't work for me actually. You can try to use this branch via uses: cirrus-actions/rebase@autosquash (changed master to autosquash). Closed it until find a better way.

fkorotkov avatar Dec 23 '19 19:12 fkorotkov

rebase

ghost avatar Dec 25 '19 15:12 ghost

Looks like the issue with this attempt was that it was missing the --interactive rebase flag. The --autosquash flag does not work outside of a interactive rebase. Luckily there is a hack around this: https://stackoverflow.com/questions/29094595/git-interactive-rebase-without-opening-the-editor In summary, the solution is to run the following to get a non-interactive autosquash rebase:

GIT_SEQUENCE_EDITOR=: git rebase -i --autosquash origin/$BASE_BRANCH

I'll work on a PR for this, borrowing from this PR's branch.

samholmes avatar Jul 01 '21 17:07 samholmes

@samholmes thank you for the finding! I've rebased the branch. PTAL.

fkorotkov avatar Jul 06 '21 13:07 fkorotkov

@fkorotkov Why not review my PRs changes? I'd appreciate the contributor recognition 😉

Looking at this PR some of my grips are with the fixup commits. There's no need to make a mistake, then fix the mistake in a separate commit unless the commit has already been merged to the base branch. The commits to this PR could use some rebasing to make a clean commit history.

Secondly, if you look closely at how I've implemented the feature, I intentionally chose to use action inputs to enable or disable autosquash; this allows for the user of this action to decide on what event will trigger the action with the autosquash input (paramater). For example, one could choose to trigger this action on the pull_request_review event to automatically rebase and auto-squash when the PR is approved.

samholmes avatar Jul 09 '21 15:07 samholmes