modularml / stack-pr

A tool for working with stacked PRs on github.
Other
299 stars 11 forks source link

Colloboration #11

Closed davidhopkins closed 3 months ago

davidhopkins commented 3 months ago

Apologies but I am new to the world of stacking. How can multiple people commit changes to a PR that is part of a stack? As i understand it all changes must be pushed with stacking tool but there is no way that I can see to "download" the stack -- meaning the other person could never push a commit to the PR -- or if they did just push a regular commit, I assume that might corrupt the stack?

ZolotukhinM commented 3 months ago

You can always checkout the branch corresponding to the top PR into your local repo (and it can be someone else's PR, it doesn't have to be yours). Then you can amend the changes as usual and then run stack-pr export to update the stack correspondingly. Just a word of caution here - stack-pr would force push to the corresponding PR branches when you run stack-pr export, so if it's not your PR make sure the author is aware of that :)

As for whether the stack would be corrupted - its logic is plain simple: when stack-pr creates a stack it adds a special line to commit message for each commit in the stack and that line contains the name of the corresponding branch on github. If such a line already exists in the message then it simply reuses the branch specified there - this way as long as you don't mess with that line, it will find what PR a commit corresponds to and update it correctly.