Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Finishing a feature always ends up in having to use force-mode #83

Open
hussfelt opened this issue Oct 16, 2014 · 18 comments
Open

Finishing a feature always ends up in having to use force-mode #83

hussfelt opened this issue Oct 16, 2014 · 18 comments

Comments

@hussfelt
Copy link

Always when we try to finish a feature we end up in these two lines:
https://github.com/proteste/hubflow/blob/master/git-hf-feature#L366-L367

The only option is to force, which closes the PR, merges the stuff locally but does not seem to set the "merge state" of the PR to done...

Steps to reproduce:

  1. Create feature: "git hf feature start foo-feature"
  2. Commit something "git commit -am 'bar'"
  3. Create PR
  4. Let someone "git hf feature checkout foo-feature"
  5. Let that person "git hf feature finish foo-feature"
  6. Fail
@hussfelt
Copy link
Author

I ended up doing this again:
git hf feature finish -f issue-10

@hussfelt
Copy link
Author

Some screenshots from the actual PR:s

This is a merged PR from HubFlow
screenshot 2014-10-16 11 26 06

This is a merged PR from Github
screenshot 2014-10-16 11 26 30

@hussfelt
Copy link
Author

More data :)

No force:

(feature/issue-10) $ git hf feature finish issue-10
Fetching origin

Feature branch has not yet been merged into origin/develop.
Please raise a pull-request via GitHub first, or use the -f flag.

And with force:

(feature/issue-10) $ git hf feature finish -f issue-10
Fetching origin
Switched to branch 'develop'
Your branch is up-to-date with 'origin/develop'.
Merge made by the 'recursive' strategy.
 app/scripts/app.js            | 11 +++++++----
 app/templates/application.hbs |  6 +++---
 2 files changed, 10 insertions(+), 7 deletions(-)
To [email protected]:***/***.git
 - [deleted]         feature/issue-10
Counting objects: 16, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (14/14), done.
Writing objects: 100% (16/16), 1.52 KiB | 0 bytes/s, done.
Total 16 (delta 11), reused 0 (delta 0)
To [email protected]:***/***.git
   4ac46b4..45a0e6f  develop -> develop
Deleted branch feature/issue-10 (was f132b71).

Summary of actions:
- The latest changes from 'origin' were merged into 'master' and 'develop'
- The feature branch 'feature/issue-10' was merged into 'develop'
- Feature branch 'feature/issue-10' has been removed
- Feature branch 'origin/feature/issue-10' has been removed
- You are now on branch 'develop'

Luke Skywalker would be happy - use the force :godmode:

@morgondag
Copy link

+1

@hussfelt
Copy link
Author

We're not using git hf feature submit issue-10 - it was not in the documentation :)
Is that the issue?

@aehlke
Copy link

aehlke commented Mar 12, 2015

Any resolution to this? Does using git hf feature submit in your workflow fix this issue?

@aehlke
Copy link

aehlke commented Mar 12, 2015

Hm I think the missing step (which the blog post I read on the workflow is not clear about: http://dev.datasift.com/blog/hubflow-github-and-gitflow-model-together ) is that the PR must be merged (via clicking merge on github) before git hf feature finish

@mheap
Copy link

mheap commented Mar 12, 2015

That's correct. A PR should be merged before git hf feature finish

@aehlke
Copy link

aehlke commented Mar 12, 2015

Thanks for clarifying. Do you think the git hf feature finish step is one that could/should be automated? We already have Jenkins integrated with our github repo, it would be easy to make it automatically git hf feature finish upon a merge happening. This would reduce these 2 workflow steps to one button press in the github pull request.

(Sorry for the naive questions, I'm still evaluating hubflow before adopting it, but it looks very promising!)

@aehlke
Copy link

aehlke commented Mar 12, 2015

(I'd also suggest closing this ticket since it's not an actual issue, though it might be a documentation issue instead)

@mheap
Copy link

mheap commented Mar 12, 2015

You could definitely automate this with Jenkins. If that's the correct decision is down to your specific workflow. Personally I wouldn't, but I can see the advantages

@aehlke
Copy link

aehlke commented Mar 12, 2015

What's the use case for clicking to merge a PR, but not immediately running git hf feature finish? What kind of work might you be doing between those 2 steps such that you wouldn't want to always immediately call that?

@mheap
Copy link

mheap commented Mar 12, 2015

Running git hf feature finish on Jenkins would leave the feature's developer with the branch open on their machine. It's a nice step to tell the feature owner "that's merged" so they know it's done, and they can then finish the feature

@aehlke
Copy link

aehlke commented Mar 12, 2015

Ah! I see, thanks!

Looking more closely at the source, I'm more worried about leaving git hf hotfix finish un-automated in a similar way. Without automation for that, develop and master could drift. Whereas git hf feature finish is just branch cleanup and not a real hazard if left undone, from my understanding.

@mheap
Copy link

mheap commented Mar 12, 2015

Again, you can do it if you feel it's the correct fit, but for us a developer being told their hotfix is merged is a trigger for them to schedule a release window with the operations team

@aehlke
Copy link

aehlke commented Mar 12, 2015

That's a good point. Maybe it's just specifically the back-merging that should be automated, since drift between develop and master is dangerous.

@mohnishkodnani
Copy link

I still get this even when the PR is merged. the only difference is , the reviewer approved it, I then use "Squash Merge" button to merge the PR.

Go to my local machine and try git hf feature finish , it still says open a PR first and get it merged.

@nikoskip
Copy link

Having the same issue here with "Squash and Merge" option from GitHub.

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

No branches or pull requests

7 participants