finale-lua / lua-scripts

A central repository for all Lua scripts for Finale.
https://finalelua.com
Creative Commons Zero v1.0 Universal
14 stars 14 forks source link

Update deletion_chooser.lua #735

Closed cv-on-hub closed 2 months ago

cv-on-hub commented 2 months ago

Correction to BeamMod clearing routine during cross-staff erasure.

cv-on-hub commented 2 months ago

This is getting too messy. Dumping this PR, creating a fresh one.

asherber commented 2 months ago

@cv-on-hub Just a small observation. There's nothing particularly wrong with a PR that has 3 or 4 small commits -- the code that gets merged will be the same as if there were just one bigger commit, and the diff on the "Files changed" tab looks exactly the same.

But if you don't like several small commits and want to squash them into one, it's easy to do by rebasing and force pushing, and then you don't need to close the PR and open a new one. I can provide details if that sounds like Greek to you.

cv-on-hub commented 2 months ago

I can provide details if that sounds like Greek to you.

Many thanks for the offer @asherber! Not quite Greek but maybe Renaissance Italian. If there's really no difference at the review endpoint then I won't bother with the deletion/resubmission. (I've learnt to work with a bunch of coding languages but still can't quite fathom GIT precepts).

asherber commented 2 months ago

@cv-on-hub No difference from a review perspective -- if you take a look at the "Files changed" tab on this PR, you'll see all the changes presented together. Though if you want, you can also look at individual commits, using the dropdown in the upper left:

image

A pull request basically compares the current state of your branch to the current state of the branch you want to merge to. The fact that it does list individual commits isn't relevant to what's actually going on.

If you want to combine your commits just to make things tidy, that involves git rebase. Assuming that you've got something like this PR -- 3 commits where you really want just one -- here's basically how it works. These are all local CLI commands; if you're using a GUI tool for git, then search for "interactive rebase" to see how it works.

# Start an interactive rebase with the fourth commit before the current one
# i.e., the last good commit
git rebase -i head~4

# This will open an editor with a text file that has lots of things in it.
# Something like these lines will appear at the top:
pick 623729b Update deletion_chooser.lua
pick 3f86d2d Update deletion_chooser.lua
pick d719641 Update deletion_chooser.lua

# On the second and third lines, change 'pick' to 'fixup'.
# Save the file and close your editor.
# git will do things, and when it's done you'll see just a single commit instead of 3.

# Tell git to push this new version of your branch, overwriting what GitHub has.
git push --force

This process looks complicated, but it's no big deal once you've done it a couple of times. You can try it with a scratch branch to see how it works. Or just leave the 3 commits as they are!

cv-on-hub commented 2 months ago

Thanks again for the thoughtful help. I've used GIT a few times on the CLI and yes, it eventually gets easier than it looks. I'll give it a bash next time I'm embarrassed by too many resubmissions.