jasonmccreary / git-trim

MIT License
367 stars 10 forks source link

Add function to remove a local branch #4

Closed the-dijkstra closed 2 years ago

the-dijkstra commented 2 years ago

Description

Inspired by Laravel php artisan migrate --pretend, that prints SQL queries instead of running them on the database.

I have added a new flag --dry-run to git trim, that prints branches going to be trimmed instead of actually deleting them.

This will solve the problem of not knowing what branches are going to be impacted, fearing to delete unwanted branches.

Changes

the-dijkstra commented 2 years ago

@jasonmccreary This pr has both changes. Adding the flag dry and creating a function for deleting branches.

Let me know if I should add the changes here to my previous pr.

jasonmccreary commented 2 years ago

@mohammed-elhaouari, thanks. I'll clean this up shortly as I just pushed some changes to main.

the-dijkstra commented 2 years ago

@jasonmccreary great. Good luck mate.

jasonmccreary commented 2 years ago

I'm working on one more change in main, then I'll resolve these conflicts and get this merged.

the-dijkstra commented 2 years ago

@jasonmccreary I have resolved old merge conflicts. Left for you to do the cleanup.

jasonmccreary commented 2 years ago

Again, I have more changes inbound. However, if you're going to work on it, please make the option dry-run inline with other common commands.

the-dijkstra commented 2 years ago

@jasonmccreary I have resolved all conflicts. And resolved the points raised. I have also sorted flags in alphabetical order. Though, I think dry-run and reset flags should be the last options. When you run git trim -h it makes sense to see them last in the list, it gives visual feedback that these 2 options are secondary options.

I don't know, but I feel that flags should not be sorted alphabetically

the-dijkstra commented 2 years ago

image

Vs

image

jasonmccreary commented 2 years ago

@mohammed-elhaouari, let's keep it alphabetical.

Also, please do not make formatting changes to the code.

the-dijkstra commented 2 years ago

@jasonmccreary removed all the automatic formatting applied by my IDE.

jasonmccreary commented 2 years ago

@mohammed-elhaouari, awesome. Thanks for your continued work on this!

the-dijkstra commented 2 years ago

@jasonmccreary always a pleasure.