hartwork/git-delete-merged-branches

[Feature Request] Prompt to update remote branches

calebdw opened this issue · 3 comments

I have an extra remote besides origin which has stale develop/master branches and generates the following message:

Remote <remote> is not up to date with 2 local branch(es):
  - develop
  - master

This will likely impair detection of merged branches for remote <remote>.
Please consider getting it back in sync by running
  $ git push <remote> develop
  $ git push <remote> master

and then invoking git-delete-merged-branches, again.

Rather than having to exit the tool, sync the branches, and then rerun the tool, can you please just have the tool prompt to update these branches?

Thanks!

Hi @calebdw the situation is a bit tricky because (1) pushing things is a bit far from deleting branches and (2) because if we prompt for things --yes would be expected to acknowledge that prompt as well. So while I understand that adding this feature would ease things for some users (including myself) I'm not yet sure if it needs to be part of the tool and if so how to integrate it in a sane way. Maybe we need git-sync-fork for that or something 🤷

Thanks for the response @hartwork! You bought up some interesting points I had not thought about...

How about this idea though:
Syncing remotes could be designated a 'risky' feature and --yes could be made to answer No by default to risky features. However, if desired, --yes could be made to answer Y either by another switch (such as --auto-sync-remotes) or by another switch (such as --yes-risky).

Hi @calebdw maybe something like the --auto-sync-remotes you mention could indeed work: like printing the message and hinting about that argument and keeping it out of --yes altogether because then there is no prompt and hence nothing to decide upon.
I will need to digest on it a bit more, and also find a name that avoids "sync". Maybe --push-targets? --push-required-targets? --push-to-remotes? Ideally I'd want the name to communicate that it's about adding new content to the remotes (rather than the usual deletion push that's also a push in some way) and that it's not needed for purely local operation without remotes 🤔