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

On 23.03.22 06:13 , Gunnar Wagenknecht wrote:
Thanks for the context Thomas. Appreciate it!


On Mar 22, 2022, at 22:58, Thomas Wolf <thomas.wolf@xxxxxxxxxx> wrote:
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?

I don't have strong opinion whether *all* branches should be pushed or just the one receiving the commit. Form a UX point of you the latter seems to make a lot of sense.

I do. With a wildcard push refspec, I'd quite frequently update other
upstream branches, which would trigger CI builds. I quite often work on
several feature branches simultaneously, and have work in progress
committed on some of them that I definitively don't want to have pushed
yet when I do push one of them. It would update Github PRs that I don't
want to update.


My use case is specifically Commit Amend + Push, which is now broken without the force flag.

Unless you used a Gerrit server ;-)


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.

We've created a preference page for tweaking the behavior of that specific button. IMO it should go there.

I would imagine users would want to have different settings for that
force flag for different repos, so a single preference is probably not a
good match.



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?

I use a * ref spec. All "my/*" branches will be force pushed.

So you never have pending work committed on your other local feature
branches that you don't want to be pushed, or you don't care if it
happens since a later push will also use force and overwrite the pushed
work in progress on those branches. You don't have automatic CI jobs
triggered on your remote my/* branches?


It seems some little UI would be needed to set the force flag and
to choose between the remote's push refspec (if any) or using
branch.<name>.merge even if there is a remote push refspec.

Cheers,

  Thomas


Back to the top