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

Fix LFS auto-push failure because out of date, via auto-pull #136

Merged

Conversation

sinbad
Copy link
Contributor

@sinbad sinbad commented May 20, 2020

There's a common problem if you use the LFS locking mode with more than one person. Because Submit automatically pushes so that it can unlock, if that push fails you're left in a state where you need to resolve it yourself. This means:

  1. Pull
  2. Push
  3. Manually unlock (because Push doesn't do it - I may submit another PR for that)

This is awkward when most of the time the changes are unrelated, git just won't let you push. And since Unlock isn't exposed in UE4 you either have to do it manually, or know that Revert will do it (even though you haven't got any local changes).

In 99% of cases where locking is applied, you could just auto-pull to resolve then try again. So that's what this PR does. In the case of a failed pull, this change:

  1. Checks whether the failure was a non-fast forward error
  2. If so, it checks whether there are any other modifications, and stashes if needed
  3. Performs a pull --rebase (since that's the default in the Pull menu)
  4. Re-tries the push
  5. Applies the stash again (even in the case of further push failure)

This is a big QoL improvement for us, hope you like it.

@SRombauts
Copy link
Owner

Thank you again!

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

Successfully merging this pull request may close these issues.

2 participants