jdigger / git-process

Scripts to help work with a good Git process
Apache License 2.0
65 stars 22 forks source link

Added squash commits prompt to to-master #136

Open pgoodrich opened 10 years ago

pgoodrich commented 10 years ago

Updating to-master command to prompt user to squash commits before continuing with to-master. Hopefully this will reduce the number of cases where users forget to squash.

Note: Default editor used by interactive rebase may not launch properly on Windows machines.

jdigger commented 10 years ago

This could make sense if it detected that there's more than a small number of commits (likely 1, but being configurable to would be good). This is most useful if you usually rebase but just forgot and this acts as that backstop. Otherwise if it's too noisy everyone will simply turn it off.

jdigger commented 10 years ago

Test cases? What happens if the user cancels the rebase, there's an error, or a Ctl-C?

pgoodrich commented 10 years ago

@jdigger I agree, I will update to check for the number of commits before prompting. Right now it's off by default anyway.

I will add test cases after I figure out why the editor is not launching. Wanted to ask you today why you thought that may be the case :)

pgoodrich commented 10 years ago

@jdigger Added check for >1 commit before prompting. Seems to not work with VIM on Windows but it's working with NP++

If the user cancels the rebase, currently the to-master will continue. Do you think it should prompt again? An error will cancel the entire to-master process and a Ctrl-C will print an error regarding the interrupt on the next attempted command, but that's the same as interrupting the current to-master I believe.

I added test cases but I'm having trouble running them (about 95% of the test cases are failing on master when I run them)

jdigger commented 10 years ago

The test cases use Rugged, which requires at least Ruby 1.9.

pgoodrich commented 10 years ago

@jdigger Using Ruby 1.9.3. Could it be a Windows issue?

jdigger commented 10 years ago

I guess? What's it saying? The last "master" build on Travis built fine, except for Ruby 1.8.

jdigger commented 10 years ago

You should sync with the latest on jdigger/git-process:master I just updated the .travis.yml file to not even try to build the tests with 1.8, so everything should be fully green.

pgoodrich commented 10 years ago

@jdigger @jharrell Finally was able to get back to this and fix the test cases.

pgoodrich commented 10 years ago

@jdigger Do you have any further feedback?

pgoodrich commented 9 years ago

@jdigger Updated

ghowell15 commented 9 years ago

+1 Testing. One note, when it hits the interactive re-base if I don't set my default editor it seems to just hang but if I set it to an editor it works just fine. Believe you updated the documentation though.