Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to enable/disable force push (LMBQ-59) #1

Open
ghost opened this issue May 11, 2017 · 3 comments
Open

Option to enable/disable force push (LMBQ-59) #1

ghost opened this issue May 11, 2017 · 3 comments

Comments

@ghost
Copy link

ghost commented May 11, 2017

For whatever reason, sometimes repository histories diverge and then become unsyncable. In this case, there should be the option to force the git repository to update, if desired. I don't think this is easily done for the mercurial repository, so it probably should be restricted to git.

@Piedone
Copy link
Member

Piedone commented May 11, 2017

Interesting idea. Hg push actually already happens in a forced manner, since this is needed to be able to push multiple heads of a single branch with different bookmarks (which is required to sync git repos to hg repos, since git branches will be translated to bookmarks on the default branch).

Doing force push in git would need to change the refspecs in GitCommandExecutor.PushToGit().

Probably what we could to is have an option to do force push in either direction, no matter the destination repository's type (so like having checkboxes for both repos). By default this would be on if the destination repo is hg and off if git. We could have this no matter if the sync is one-way or two-way.

We'll think about this but first we need to do some major refactoring, related to reflecting on the UI that actually git-git, git-hg and hg-hg sync, both bidirectionally and just one-way are supported.

@Piedone Piedone changed the title allow force push for one-way Option to enable/disable force push May 11, 2017
@Piedone
Copy link
Member

Piedone commented May 26, 2017

@xoviat a force push would potentially overwrite new commits in the destination repo and cause data loss. Are you sure this is a good idea?

BTW now the option is to fix the destination repo by hand, see https://githgmirror.com/faq ("I've rewritten history and I'm getting punished for it. What now?").

@Piedone Piedone changed the title Option to enable/disable force push Option to enable/disable force push (LMBQ-59) Aug 11, 2022
@Piedone
Copy link
Member

Piedone commented Sep 20, 2022

Since we have the "Git ref selection regex for pushes" config now, this is less interesting. You can configure it to just push branches where you don't rewrite history or do other things requiring a force push.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant