Community
Participate
Working Groups
Currently in EGit, when you create a local branch that tracks a remote branch, and it does not have the same name, the result of "Push to Upstream" is surprising. E.g. with this config: [branch "foo"] remote = origin merge = refs/heads/bar Running "Push to Upstream" when having "foo" checked out causes a new "foo" branch to be created on origin, instead of pushing to "bar". C Git nowadays (with "push.default" set to "simple") asks what to do in such a case. We should also ask the following question: The current branch "foo" has a different name than its upstream branch "bar". What do you want to do? [Push to Upstream Branch "bar"] [Push to "foo"] [Start Push Branch Wizard...] (The question should probably only come up when there is no push refspec set for the remote and there's an explicit "branch.*.merge".)
(In reply to Robin Stocker from comment #0) ... > The current branch "foo" has a different name than its upstream branch > "bar". What do you want to do? > > [Push to Upstream Branch "bar"] [Push to "foo"] [Start Push Branch > Wizard...] I personally would very much appreciate when the push.default value is actually honored; either by skipping or properly defaulting this dialog. > (The question should probably only come up when there is no push refspec set > for the remote and there's an explicit "branch.*.merge".) Yes and no. When I see "Commit & Push" I'd expect the current branch on which I commit to be pushed to the proper place, not a general refspec to be applied (so 'no'). On the other hand side, in that case there would be no push refspec for the remote (so 'yes'). And many thanks for the work on #430454!
I just made a back click in EGit, that's somewhat related: I was working on a local feature branch, which is configured for push/pull against a same-named branch on origin. When I dared to click "Commit and Push" I assumed the configuration of this branch would be used. Unfortunately the global "HEAD to origin/master" configuration was used and all my dirty WIP appeared on master <BLUSH> I would always assume the configuration for the currently checked out branch to have precedence over any global configuration, no? Should we open a new bug for issues with "Commit and Push" from a non-master branch? Yes I know, clicking "Commit and Push" may be a bad idea to begin with ... maybe that button should be disabled on any branch that's not based on origin/master ...
@Stephan: I'm not sure you're having the same bug as this one. Could you file a new bug, and attach your .git/config there?
(In reply to Robin Stocker from comment #3) > @Stephan: I'm not sure you're having the same bug as this one. Could you > file a new bug, and attach your .git/config there? Done: bug 441031.
I think fixing bug 441938 as described in comment 6 would fix this (added dependency). Additionally, having a dropdown on the button would enable doing something else such as opening the "Push Branch..." wizard.
Just found this bug at work today. Everyone panicked and was thinking "oh my god I thought I understood git concepts but once again I failed", until I found that the problem is in E/Jgit. Since I educated my co-workers to create local branch 'bugFix_xxx' based on 'origin/master', I have to tell them to merge their work into their local 'master' branch before 'pushing to upstream' to effectively update 'origin/master' They will hate me :)
(In reply to Francois Guillot from comment #6) > I have to tell them to merge their work into their local > 'master' branch before 'pushing to upstream' to effectively update > 'origin/master' Or just tell them to avoid using "Push to Upstream" because it's not predictable enough for beginners ?
(In reply to Mickael Istria from comment #7) > (In reply to Francois Guillot from comment #6) > > I have to tell them to merge their work into their local > > 'master' branch before 'pushing to upstream' to effectively update > > 'origin/master' > > Or just tell them to avoid using "Push to Upstream" because it's not > predictable enough for beginners ? Right, I guess I deserve it. But seriously, when you create a local branch BugXXX from origin/master, you know that the upstream of BugXXX is origin/master, so you expect 'push to upstream' to push to the master branch of the origin remote repository. You certainly don't expect that a new branch BugXXX will be created in the origin repository (and that feeling is enforced by the fact that there is also a 'push branch BugXXX' action)
Can somebody raise the importance of this bug? I think the current GIT workflow is seriously broken in Eclipse. To reproduce: 1. Check out a remote-tracking branch as new local branch 2. Ensure that 'Configure upstream for push and pull' is selected 3. Check that the upstream for the local branch is indeed configured to be the check out branch 4. Stage a commit 5a. Select 'Commit and Push' 5b. (or) Select 'Commit' and use the 'Push to upstream' menu 6. Be amazed that the commit ended up in a new branch on the remote What is even more surprising is that when the "Push Branch 'ABC' ..." menu is used, the configured upstream branch is selected by default.
The behavior of "Push to Upstream" currently behaves as "current" for the "push.default" behavior options. JGit only implements "current" behavior, and not the other "push.default" options. See also, Bug 351314.
*** Bug 441031 has been marked as a duplicate of this bug. ***
(In reply to Thomas Wolf from comment #11) > *** Bug 441031 has been marked as a duplicate of this bug. *** Clicked the wrong button in the wrong screen. :-( 441031 is not a duplicate; it's about "Commit & Push", not about "Push to Upstream".
New Gerrit change created: https://git.eclipse.org/r/c/egit/egit/+/190776
Gerrit change https://git.eclipse.org/r/c/egit/egit/+/190776 was merged to [master]. Commit: http://git.eclipse.org/c/egit/egit.git/commit/?id=c72ac1197d68ae78d893e4c6b8f945a54b79ab22
(In reply to Eclipse Genie from comment #14) > Gerrit change https://git.eclipse.org/r/c/egit/egit/+/190776 was merged to > [master]. > Commit: > http://git.eclipse.org/c/egit/egit.git/commit/ > ?id=c72ac1197d68ae78d893e4c6b8f945a54b79ab22 With this change, "Push to Upstream" behaves like "git push" and opens dialogs if the git config is incomplete or ambiguous, or if it would push several branches.
*** Bug 575068 has been marked as a duplicate of this bug. ***
*** Bug 548915 has been marked as a duplicate of this bug. ***