Skip to content
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

ADD branches cleanup script #1885

Merged
merged 4 commits into from
Sep 24, 2017

Conversation

ndelangen
Copy link
Member

Issue: -we sometimes leave merged branches around-

What I did

I added a script to remove them

How to test

Run script:

./scripts/clean-merged-branches.sh

Will list the branches

Run script:

./scripts/clean-merged-branches.sh -f

Will remove listed branches from remote

@ndelangen ndelangen added cleanup Minor cleanup style change that won't show up in release changelog maintenance User-facing maintenance tasks labels Sep 24, 2017
@ndelangen ndelangen self-assigned this Sep 24, 2017
@codecov
Copy link

codecov bot commented Sep 24, 2017

Codecov Report

Merging #1885 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1885   +/-   ##
=======================================
  Coverage   21.32%   21.32%           
=======================================
  Files         257      257           
  Lines        5740     5740           
  Branches      691      702   +11     
=======================================
  Hits         1224     1224           
+ Misses       4013     3979   -34     
- Partials      503      537   +34
Impacted Files Coverage Δ
app/vue/src/server/config/babel.js 0% <0%> (-100%) ⬇️
app/vue/src/server/babel_config.js 0% <0%> (-77.42%) ⬇️
app/vue/src/server/utils.js 0% <0%> (-53.58%) ⬇️
addons/knobs/src/components/types/Boolean.js 11.62% <0%> (ø) ⬆️
addons/knobs/src/KnobManager.js 32% <0%> (ø) ⬆️
lib/ui/src/modules/ui/libs/hierarchy.js 48.8% <0%> (ø) ⬆️
app/react-native/src/bin/storybook-build.js 0% <0%> (ø) ⬆️
app/react-native/src/preview/story_kind.js 0% <0%> (ø) ⬆️
lib/ui/src/modules/api/actions/api.js 50.47% <0%> (ø) ⬆️
...ponents/left_panel/stories_tree/tree_decorators.js 33.33% <0%> (ø) ⬆️
... and 16 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2f011ce...173ab73. Read the comment docs.

@usulpro
Copy link
Member

usulpro commented Sep 24, 2017

tried to test it. always get no merged branches detected

@ndelangen
Copy link
Member Author

ndelangen commented Sep 24, 2017

Yeah, because i already removed all the merged branches using this 😃

screen shot 2017-09-24 at 11 37 51

@usulpro
Copy link
Member

usulpro commented Sep 24, 2017

Great script, Norbert!

I noticed that it missed the branch remotes/origin/Gongreg/master, but we can remove it manually :)
I added two test/* branches (one is merged to another) and it missed them as well, but I can detect them by git branch -a --merged so not sure how to handle such cases

@Hypnosphi
Copy link
Member

Hypnosphi commented Sep 24, 2017

It doesn't work if the origin is named other than origin (in my case it's upstream). I think I can rename though:

git remote rename upstream origin

branches=$(
git branch -a --merged origin/master |
grep remotes/origin/ |
grep -v /master |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This excludes remotes/origin/Gongreg/master as well

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will fix that and add a confirm prompt instead of "run this command with -f" message

@Hypnosphi
Copy link
Member

I changed "Run with '-f' if you're sure" to "Press 'y' if you're sure"

@ndelangen ndelangen requested a review from a team September 24, 2017 18:56
Copy link
Member

@usulpro usulpro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ndelangen ndelangen merged commit 72186a4 into master Sep 24, 2017
@ndelangen ndelangen deleted the ndelangen/add-merged-branches-cleanup-script branch September 24, 2017 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Minor cleanup style change that won't show up in release changelog maintenance User-facing maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants