-
Notifications
You must be signed in to change notification settings - Fork 67
Support modifying order of unapplied patches #144
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
Comments
@topher200 / @jpgrayson Do you have any thoughts? |
@NonLogicalDev Thanks for tagging me! I hadn't seen this Issue. I could see how this would be useful. I occasionally want to re-order non-applied patches in Quick question: would there be conflict resolution for unapplied patches which are re-ordered? ie if they don't merge cleanly on top of each other, would this case be detected? Intuitively I think they would not (because the patch is never applied, there's no chance for a conflict to occur)... I just want to sanity check and make sure I'm understanding the feature correctly. |
I re-read your description and determined that conflict resolution would only occur when a patch is applied, as I expected. Question answered! I have a new question! Your description left out any usecases where a
|
I am somewhat split on whether this should be a |
Sorry for the delay in joining the conversation. Thank you @NonLogicalDev for writing up this idea. I think I see the value in having this capability. My concern is whether there are any corner cases that have not yet been considered that break this feature. But perhaps the best way to uncover that risk is by pursuing the feature. I agree that it is an interesting design decision as to whether we should have |
This option allows patches to be floated without also applying them. I.e. patches can be reordered without modifying the worktree or immediately resolving potential conflicts. Addresses #144 Signed-off-by: Peter Grayson <[email protected]>
The new --noapply option to push allows the order of unapplied patches to be modified without actually applying those patches. It may be helpful to some workflows to allow patches to be reordered without either (a) having to immediately resolve merge conflicts; or (b) having to modify the contents of the working tree. Addresses #144. Signed-off-by: Peter Grayson <[email protected]>
I took a look at this today and as @NonLogicalDev indicated, it was pretty straightforward. So both I would greatly appreciate @NonLogicalDev giving this feature a try to see if it matches expectations. Also please take a look at the tests I wrote to make sure they cover the target use cases. I'm going to close this for now. Please re-open if there are any issues with this feature. |
Whoa! @jpgrayson thank you so much, that was really quick! I will get to testing right now. |
It would be very helpfult to some more advanced usecases to be able to modify the order of patches later in the stack, to bridge the gap between
stg
andgit rebase -i
a little more.This way it would be possible to reorder future operations without any conflicts and the start going through the stack and taking care of issues as they come up.
I have not looked very closely, but I am thinking this should not be very difficult to implement, as
stg delete
already allows you to modify the future, albeit only by deleting patches from the future.I propose modifications to two commands
push
andfloat
by adding--noapply
flag:stg push --noapply [patches...]
stg float --noapply -s series-file
I believe this can make it a lot simpler to write a shell script to implement patch guards from #70
This is certainly not exactly the same idea as Mercurial Queue Patch guards, as it assumes that patch sets are not interleaving. But it can easily be extended to take care of interleaving patchsets also as long as you keep track of global patch order in a separate file along with constraints:
patch-list.txt (to be read into PATCHES var)
Example Workflow:
The text was updated successfully, but these errors were encountered: