Skip to content
This repository was archived by the owner on Jun 19, 2023. It is now read-only.

Conversation

@pokey
Copy link
Contributor

@pokey pokey commented Aug 2, 2017

This addresses an issue when using a feature branch that is associated with a pull request on GitHub, when the develop branch is merge-protected. In the current implementation of git flow feature finish, the remote feature branch is deleted before the merged local develop branch has been pushed. This causes the pull request to be closed before the changes have been merged, so the approval no longer applies and the push is rejected. To a certain extent this seems to be a bug with GitHub, but I don't see a drawback to pushing before deleting the remote branch.

This addresses an issue when using a feature branch that is associated
with a pull request on GitHub when the develop branch is merge
protected.  In the current implementation of `git flow feature finish`,
the remote feature branch is deleted before the merged develop branch
has been pushed.  This causes the pull request to be closed before the
changes have been merged, so the approval no longer applies.  To a
certain extent this seems to be a bug with GitHub, but I don't see a
drawback to pushing before deleting the remote branch.
@ladislas
Copy link

ladislas commented Dec 4, 2017

will this be eventually merged?

@badwulfy
Copy link

it would be nice if this PR were merged.

@alex-shamshurin
Copy link

Will it be merged or not?

@pho3nixf1re
Copy link

pho3nixf1re commented Aug 15, 2018

This would greatly help cleanup our workflow. Seems awkward having to manually delete the branches just to avoid this bug.

Any comment from the maintainer @petervanderdoes ?

@petervanderdoes
Copy link
Owner

I'll double check and possibly pull it in tonight (Eastern Time Zone)

@pho3nixf1re
Copy link

@petervanderdoes any problems with the merge? I'd like to have this resolved officially rather than having to apply a patch to the script. If there is work that needs to be done I'd be willing to help.

@petervanderdoes
Copy link
Owner

Work and Personal stuff is getting in the way. Planned to review and implement this weekend.

@pho3nixf1re
Copy link

pho3nixf1re commented Aug 23, 2018

Actually, upon closer inspection of this the fix here only applies to finishing features. This should be done for bugfix and hotfix as well (and maybe even release). @pokey can you update your PR with these?

@pokey
Copy link
Contributor Author

pokey commented Aug 23, 2018

Done; nice catch

@dazinator
Copy link

Any news on this one, it would be a great feature to help our workflow too.

@adamrodger
Copy link

+1

@pokey
Copy link
Contributor Author

pokey commented Nov 6, 2018

Fwiw I'm using this script as a workaround. I just put it on my path and then run fff when I want to finish a feature / release / etc

@darekxan
Copy link

darekxan commented Jan 9, 2019

not having this breaks integration with github, this is quite important

@CodyJamesCasey
Copy link

Hi there! Any news on this PR? It would be super helpful to have in!

@pixelyunicorn
Copy link

This is my #️⃣1️⃣ pet peeve w/ this implementation of git-flow and I have patched my local version with this pull request. Hope to see this merged in soon.

@dazinator
Copy link

In my opinion, having used git flow for 3 years, this is the only missing thing that I wish was addressed.

@petervanderdoes
Copy link
Owner

Added to release 1.12.0

@pixelyunicorn
Copy link

This update is landing in homebrew within the next few hours: Homebrew/homebrew-core#36388

Once this gets approved, you can run brew upgrade git-flow-avh to get all of your "pull request showing as closed instead of merged" woes solved 🎉

@petervanderdoes
Copy link
Owner

Thank you @pixelyunicorn for updating Homebrew

@pixelyunicorn
Copy link

pixelyunicorn commented Feb 4, 2019

This feature does not seem to work at all for me nor the people I am working with. git flow finish still makes pull requests appear as closed instead of merged, because the branch was deleted before being pushed:

image

I have confirmed that git flow version returns 1.12.0 (AVH Edition) and that git-flow is not installed for everyone who has this issue. Additionally, I also tried hotfixing git-flow-feature with the original version in the pull request, and it does not work at all.

Here is what git flow config outputs:

Branch name for production releases: master
Branch name for "next release" development: develop
Feature branch prefix: feature/
Bugfix branch prefix: bugfix/
Release branch prefix: release/
Hotfix branch prefix: hotfix/
Support branch prefix: support/
Version tag prefix:

@pho3nixf1re
Copy link

This resolved it for my team using the default flow config. Be sure your configs don't have something odd in them.

@petervanderdoes
Copy link
Owner

If you used git flow finish you didn't tell git-flow to push the branch. If you made a change locally, never pushed it and then finish it, I'm pretty sure Github doesn't see it as a merged branch. So either use git flow finish -p or set it as default git config gitflow.feature.finish.push yes.

More info on setting default values on the wiki page Configuration

@pixelyunicorn
Copy link

@petervanderdoes Thanks for the clarification, that worked for me! (I changed repos recently and forgot to set that as the config)

@petervanderdoes
Copy link
Owner

petervanderdoes commented Feb 4, 2019

If you want it to be for all your repo's on your computer
git config --global gitflow.feature.finish.push yes

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.