The sync command could work more like other IDE commands which do both a pull and push as a single operation to ensure that all the remote changes are captured before trying to push new changes.
for me it is intuitive to expect that sync means local and remote will be aligned, like in VSCode, sync means pull + push, but i would also check this in other tools to ensure this is not entirely unexpected behavior, to prevent fragmantation of the ecosystem on established functionality.
Totally agree- I think it needs to be made to pull as well. I hadn't considered needing to pull a suggestion.
It'll most likely need to be squashed though, so that might require some user input 🤔
Also curious about this - I don't quite understand why the each stacked diff must be a single commit. Not to say it shouldn't commonly be this way, but a diff containing multiple commits shouldn't be a technical issue as long as to tooling looks at the diff as the smallest unit.
Is this because each piece of the stack can only be one commit?
Also curious about this - I don't quite understand why the each stacked diff must be a single commit. Not to say it shouldn't commonly be this way, but a diff containing multiple commits shouldn't be a technical issue as long as to tooling looks at the diff as the smallest unit.
@phikai@nathan.cain There's not a technical reason (that I can think of) where it needs to be a single commit, it's currently that way to make sense with the stack amend command (you can't specify which commit to amend, it just assumes the last one). I think this would be a good addition, but we might need to do some rework of amend and incorporate #7581 in that case
Speaking with one of the devs I support, he mentioned that it is easier for him to think about it with a single commit in each diff; however, we need a solution for when changes are not made with the glab stack command (MR suggestions, Web IDE, Regular git commits if glab not available on machine, etc). Each of those other options would add multiple commits to the same diff and would not be uncommon (especially MR suggestions).
@rtzoor@nathan.cain There's a new release out where sync (after a git fetch) should now pull in commits from the web UI/elsewhere.
One caveat is that glab stack amend tacks on to the latest commit. So if you had a normal (commit A), you applied a suggestion on the web UI (commit B), and you made another change to the code and ran glab stack amend, it would be applied to commit B. That might not be expected if you're not squashing any commits to have a complete history.