Bug 441031 - Commit and Push on non-master branch should respect configuration of current branch
Summary: Commit and Push on non-master branch should respect configuration of current ...
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 6.1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 578607 (view as bug list)
Depends on: 441938
Blocks:
  Show dependency tree
 
Reported: 2014-08-03 07:58 EDT by Stephan Herrmann CLA
Modified: 2022-02-18 05:06 EST (History)
4 users (show)

See Also:


Attachments
.git/config (12.44 KB, text/plain)
2014-08-03 08:08 EDT, Stephan Herrmann CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Herrmann CLA 2014-08-03 07:58:49 EDT
From bug 431872 comment 2:

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?

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 ...
Comment 1 Stephan Herrmann CLA 2014-08-03 08:08:35 EDT
Created attachment 245663 [details]
.git/config

Here's my (lengthy) .git/config

Relevant branches are
 master
 sherrmann/ExternalAnnotations


for your convenience the corresponding entries are

[branch "sherrmann/ExternalAnnotations"]
        remote = origin
        merge = refs/heads/sherrmann/ExternalAnnotations

[branch "master"]
        remote = origin
        merge = refs/heads/master
        rebase = true

This is what seems to have taken precendence:

[remote "origin"]
        url = ssh://sherrmann@git.eclipse.org/gitroot/jdt/eclipse.jdt.core.git
        fetch = +refs/heads/*:refs/remotes/origin/*
        fetch = refs/notes/*:refs/notes/*
        pushurl = ssh://sherrmann@git.eclipse.org/gitroot/jdt/eclipse.jdt.core.git
        push = HEAD:refs/heads/master

Not, sure if the remote section should contain a push entry for the feature branch, too? But I don't want all my pushes to also push the feature branch.

Also, I did select "[x] configure branch for push and pull" (quoted from memory) when I first did "Push Branch".

The "HEAD:refs/heads/master" entry is handy for all the short-lived, purely local branches, that should never show up on the server.
Comment 2 Robin Stocker CLA 2014-08-20 10:07:02 EDT
See bug 441938 comment 6 for how this would be properly fixed. I added it as a dependency.
Comment 3 Mykola Nikishov CLA 2015-06-30 15:54:19 EDT
[Batch change] Remove pre-3.7 Target Milestones

If anyone on CC list is going to fix/implement this, please assign a new 3.7+ target milestone.
Comment 4 Thomas Wolf CLA 2022-02-10 07:52:51 EST

*** This bug has been marked as a duplicate of bug 431872 ***
Comment 5 Thomas Wolf CLA 2022-02-10 07:54:10 EST
Clicked the wrong button in the wrong screen... :-(
Comment 6 Thomas Wolf CLA 2022-02-10 07:54:56 EST
*** Bug 578607 has been marked as a duplicate of this bug. ***
Comment 7 Eclipse Genie CLA 2022-02-14 09:29:43 EST
New Gerrit change created: https://git.eclipse.org/r/c/egit/egit/+/190775