-
-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cakeArguments must be array #80
Conversation
@devlead I just picked up the buggy version in a PR to an OSS project and my PR was merged, so now they have to deal with that. I think this repo is referenced fairly frequently, so the less time for the buggy version to spread, the better. |
Just hit this while setting a new project up. Fixed it with |
Can anyone explain how to squash my commits into one, when there is a merge develop into my issue branch in the middle (stupid level explanation needed)? |
The way I would do it is to do The parent of your first commit is ce57fc7. To roll back to there without touching your files:
Then to stage all the changes in your files since ce57fc7:
Then to create a new commit with all these changes:
Double-check your local commit history before pushing just so there are no surprises. You should expect to see a single commit with your message and the exact changes you want to see in this PR, and its parent commit should be ce57fc7. Then to update the PR branch, since you'd be overwriting history:
Force pushes are pretty safe since GitHub shows the entire history in the PR timeline, including the original commit hashes in case they are needed, and no one else is working in your branch. Then, there will be a single commit in the Commits section of this PR. |
Thanks @jnm2 That is, of course, on my own forked repo. Will it look right if pushed, or should I kill this PR and build a new from a new fork? |
Oh, good catch. You want to get rid of the merge commit before doing this. Interactive rebase is the fastest way to drop a commit that far back, but interactive rebase isn't easy unless you have Notepad++ or VS Code or something set up as your git text tool. To undo my bad instructions and get your local branch matching this branch again, do Starting over, this is what I'd do if I didn't use interactive rebase.
Reset back to the branch which you want to be the parent commit. You could make this a newer commit from upstream/develop but let's go with ce57fc7, the current parent, just for simplicity. This time, use
Then replay the commits you want to keep, one by one.
Finally,
|
d1030d6
to
049984e
Compare
I think it looks good now. |
@Roadrunner67 You can. My preference for my own branches is to rebase instead of merging. Rebasing replays your set of commits (you have just one now) on top of a different parent commit, one by one, stopping to allow merge conflict resolution for each one that needs it if any. If you don't need to fetch to get the latest commits from upstream/develop, this is all you have to do:
If you want to fetch and rebase in a single command:
( Rebasing does mean rewriting history, so the usual caveats apply. Only use in branches that no one else is working in, and check carefully before doing |
Keep cakeArguments as array (not string) and only add Script (quoted) if Script is not empty.
049984e
to
d321f2d
Compare
Got it, history is so much cleaner now with the rebase. |
You're very welcome! As another Cake user, thanks for these improvements to Cake! I love Fork! I just started using it. Its interactive rebase UI is so good that I debated suggesting that you use it earlier in the thread. Oh well :D I learned on the CLI and typing is faster than clicking, but Fork is a beautiful piece of software. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
@Roadrunner67 your changes have been merged, thanks for your contribution 👍 |
Initializes $cakeArguments as array instead of string.
$($cakeArguments -join " ") will not insert spaces between arguments if it is a string.