Bug 493952 - Git Flow Publish Feature doesn't do anything after rebase
Summary: Git Flow Publish Feature doesn't do anything after rebase
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: Gitflow (show other bugs)
Version: 4.3   Edit
Hardware: PC Windows All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Max Hohenegger CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-18 16:42 EDT by Sascha Silbe CLA
Modified: 2020-02-02 08:14 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sascha Silbe CLA 2016-05-18 16:42:30 EDT
After rebasing a local feature branch (e.g. to address review comments), Git Flow -> Publish Feature doesn't have any effect anymore. In contrast a regular push still works.

Steps to reproduce:
1. Ensure Git Flow has been initialised.
2. Create a feature branch using right click on repository -> Git Flow -> Start Feature.
3. Make a change and commit it.
4. Push feature branch using right click on repository -> Git Flow -> Publish Feature.
5. Make another change (e.g. fixing a typo in the previous change) and amend the previous commit.
6. Try to push updated (rebased) feature branch using Git Flow -> Publish Feature.
7. Observe that nothing happens, not even an error message.
8. Push the updated feature branch using right click on repository -> Push Branch '<branch name>', ensure "Force overwrite branch in remote if it exists and has diverged" is checked, Next, Finish.
9. Observe that the remote branch is updated as expected.

This happens with "Eclipse Git Team Provider - Gitflow support 4.3.0.201604071810-r" inside Progress Developer Studio 4.3 (Progress OpenEdge 11.6.1), based on Eclipse Platform 4.3.1.M20130911-1000.
Comment 1 Max Hohenegger CLA 2016-05-19 17:19:51 EDT
Thanks for reporting this. It looks like your workflow requires you to force push commits regularly. I'm not sure though if 'publish' should support this.
It doesn't seem like publish was originially intended to support a 'force' argument [1], and a quick look at the code of a more advanced variant of Gitflow [2] doesn't indicate that this is common practice.
But I might be wrong on this.
It is probably reasonable to show an error in such a case, though, so users don't get the impression the operation was successful.

[1] https://github.com/nvie/gitflow/wiki/Command-Line-Arguments
[2] https://github.com/petervanderdoes/gitflow-avh/blob/develop/git-flow-feature
Comment 2 Eclipse Genie CLA 2019-12-30 08:43:48 EST
New Gerrit change created: https://git.eclipse.org/r/155112
Comment 3 Max Hohenegger CLA 2020-01-02 16:16:07 EST
For reference, this is what gitflow AVH would display on publish when the local branch is both, behind the remote:

 ! [rejected]        feature/a -> feature/a (non-fast-forward)
error: failed to push some refs to 'gitflow-sandbox'
Comment 4 Eclipse Genie CLA 2020-01-04 15:15:52 EST
Gerrit change https://git.eclipse.org/r/155112 was merged to [master].
Commit: http://git.eclipse.org/c/egit/egit.git/commit/?id=540c1fff36c96665b8cfbbfde6bb8a58d5533866
Comment 5 Max Hohenegger CLA 2020-02-02 08:13:05 EST
@Sascha
> 7. Observe that nothing happens, not even an error message.

This is fixed. You can try it for example using the nightly build that's listed on the Marketplace.

> 8. Push the updated feature branch using right click on repository -> Push Branch '<branch name>', ensure "Force overwrite branch in remote if it exists and has diverged" is checked, Next, Finish.

I'm all for allowing force-push workflows, however, AVH Gitflow does not support this yet.
I'd suggest to continue the discussion here: https://github.com/petervanderdoes/gitflow-avh/issues/401