Code Monkey home page Code Monkey logo

Comments (3)

stefanhaller avatar stefanhaller commented on September 25, 2024

Did this work in 0.40.2? My suspicion is that it did, but only as long as you didn't have to force-push. Any attempt to force-push would have resulted in the same "stale info" error.

For context, there are two PRs that broke this workflow in different ways. The first is #3387, which removed the logic to ask for force-pushing when the server rejected the push. We still need this logic for branches whose upstream is not stored locally, because in that case we can't tell ahead of time whether force-pushing is going to be needed. The second is #3528, which would always ask for force-pushing if the branch shows a ?. This is wrong, we need to start with a normal push in that case, and then only ask for force-push if the server rejected it.

Fixing these two problems (or actually, just the second) will make it work again if a normal push is sufficient. However, it will still not fix the "stale info" error that you get when you do in fact need to force-push, and I suspect that this problem was always present for such branches. It is caused by the --force-with-lease argument that lazygit uses to force-push; I think this will have to be just --force in the case that the remote branch is not stored locally.

Draft PR is here if you want to test it: #3619. It fixes the two problems mentioned above, but not the "stale info" problem yet. Just wanted to confirm my theories before I spend more time on this.

from lazygit.

stefanhaller avatar stefanhaller commented on September 25, 2024

I did some more testing and concluded that force-pushing to a branch whose remote is not stored locally can never have worked. I updated #3619 to fix that problem too.

from lazygit.

peppy avatar peppy commented on September 25, 2024

However, it will still not fix the "stale info" error that you get when you do in fact need to force-push, and I suspect that this problem was always present for such branches.

Can confirm this was the case. I just force push to these kinds of branches quite rarely, and when I do I use the CLI execute window in lazygit 😄.

I've tested your fix at a functional level and it fixes the problem. Thanks again.

from lazygit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.