DESCRIPTION

[460500] Gerrit Configuration... is misleading when switching branches

Treat "Commit and Push" as Gerrit push for the currently checked out
branch when user checks "Add Change-ID" button.

Change-Id: I6eddab11e58a383cd7a9ebe11226f344e97aa324
Signed-off-by: Justine Wolfe xxx@xxx.xxx


COMMENTS

author: Justine Wolfe
date: 2015-09-02 13:52:25.000000000

Uploaded patch set 1.

-------------------------------------
author: Brenden Conley
date: 2015-09-02 13:52:32.000000000

Patch Set 1:

Build Started https://hudson.eclipse.org/egit/job/egit.gerrit/7504/

-------------------------------------
author: Brenden Conley
date: 2015-09-02 14:14:45.000000000

Patch Set 1: Verified+1

Build Successful 

https://hudson.eclipse.org/egit/job/egit.gerrit/7504/ : SUCCESS

-------------------------------------
author: Douglas Trujillo
date: 2015-09-24 22:02:47.000000000

Patch Set 1: Code-Review-1

(6 comments)

Line:176, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitJob.java -> - unnecessary braces
- bad indentation

Line:198, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitUI.java -> use ResourcePropertyTester.hasGerritConfiguration(Repository repository) instead

Line:2856, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> use ResourcePropertyTester.hasGerritConfiguration(Repository repository) instead

Line:205, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushToGerritPage.java -> commented out code ?

Line:209, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushToGerritPage.java -> I think this doesn't make sense since typically you have more than one local branch pushed for review to the same upstream branch. The name of the local branch is typically used to remember which change is done on which branch (at least that's how I choose local branch names).

Instead I propose we check if the current branch tracks a branch in the upstream repository. If yes push to refs/for/trackedBranch, if not use the branch we pushed to last time (settings.get(lastBranchKey).

You can find the tracked upstream branch in the following way:

 BranchConfig branchConfig = new BranchConfig(repository.getConfig(),
				repository.getBranch());
 String trackedBranch = branchConfig.getMerge()

see PushBranchPage.hasDifferentUpstreamConfiguration()

Line:7, /COMMIT_MSG -> style nit: we link to the bug in the footer (last paragraph):

 Bug: 460500

https://wiki.eclipse.org/EGit/Contributor_Guide#Commit_message_guidelines

-------------------------------------
author: Douglas Trujillo
date: 2015-10-12 20:06:23.000000000

Patch Set 1:

(5 comments)

marking comments addressed in patchset 2 as done

Line:176, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitJob.java -> Done

Line:198, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitUI.java -> Done

Line:2856, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> Done

Line:205, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushToGerritPage.java -> Done

Line:7, /COMMIT_MSG -> Done

-------------------------------------
author: Gerrit Johnathan Pham
date: 2016-02-21 15:27:00.000000000

Change has been successfully merged into the git repository by Douglas Trujillo

-------------------------------------
