Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [egit-dev] Commit + Push no longer using "Push to origin" config

Hi Gunnar,

On 22.03.22 21:20 , Gunnar Wagenknecht wrote:
I noticed a change in the last release. The "Commit and Push" button no longer seems to use the "Push to origin" configuration. It seems to push only the specific branch.

I work in feature branches a lot and use commit amend. This requires force push, which I have enable in the "Push to origin" configuration.

Is this an intentional change or a regression?

It's intentional insofar as the code was changed and does what it's
supposed to do. See [1]. The problem is that the "Push to origin" spec,
depending on how it's configured, may actually push several branches.

OTOH it's unintentional since I just didn't think of the force flag.

It was changed because of bug 441031.[2] Apparently there are
conflicting wishes: some people would like the branch config to take
precedence; others the remote config.

I'm not sure what the best thing to do here would be. I guess we'll
have to figure out something for that...

1. Make push behave like "push to origin" again? Even if that would push
   more than one branch?
2. Do so only if the remote config has exactly one non-wildcard refspec?
3. Leave as is now, but figure out a way to push or force push? (Bug
   411219.[3])
4. Add a preference where the user can choose whether to consider the
   branch config (branch.<name>.merge) in preference over the remote
   config?
5. Something else?

If the remote has no push refspec, though, (1) would for many users
not consider branch.<name>.merge since push.default=simple by default.
People would have to configure push.default=upstream explicitly
otherwise, which may not always be appropriate either.

I have no clear idea how to do (3). An extra checkbox might take
too much screen estate, but is otherwise the simplest option. (State
would need to be persisted per repo.) A "SplitButton" (Button with drop-
down menu) as suggested in bug 411219 doesn't exist in SWT apparently
because it doesn't exist natively on all platforms; I don't think Cocoa
has something that. Using Ctrl-Click or Ctrl-Space for "force push" is
not easily discoverable by the user and I'm off-hand not even sure we'd
have the keypress state in a mouse click event.

One thing I don't quite get: do you change the remote's push refspec
every time you switch branches to update the destination? That can't be
a comfortable workflow either... I imagine you have something like
+HEAD:refs/heads/some_branch. How do you set the destination per
local feature branch?

[1] https://wiki.eclipse.org/EGit/New_and_Noteworthy/6.1
[2] https://bugs.eclipse.org/bugs/show_bug.cgi?id=441031
[3] https://bugs.eclipse.org/bugs/show_bug.cgi?id=411219


Back to the top