You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been using git-machete in my workflow for some time now, and I've been using a thin wrapper around machete to make my workflows easier and more automated, especially in cases where I alone manage the branch stack I work on.
To this end I often make use of non-interactive traverse.
Building on #1362, since we now have the ability to synchronize a stack of branches, it would be great to stop after a stack has been synced.
It seems to me that the simplest API to support this would allow you to stop traversal either on or after some branch is reached.
Alternative Approach
With the proliferation of flags and options on the traverse command, I've wondered whether a simpler --command option would not make more sense. In this case I would be able to hack together the above by doing the following:
If I were to run this command (--create-github-prs seems not to be present yet)
Actually! --sync-github-prs has two effects:
I've just noticed that the docs for the flag itself don't mention creating PRs, I'll fix that now:
It seems to me that the simplest API to support this would allow you to stop traversal either on or after some branch is reached.
I agree that --stop-at=... is a better option here 😅 Flag like --command will likely be too... powerful (?), potentially leading to weird side effects where the process of traverse is disrupted in hard-to-predict ways.
I'll add two improvements then:
--start-from=... will also accept a managed branch name, not just a fixed value here, root, first-root,
--stop-at=... flag will be added, and it'll accept a managed branch name (but no fixed values — I don't think these are needed)
Hi @PawelLipski this sounds great. Are you also saying that using --sync-github-prs in non-interactive mode will do a create?
--command is indeed quite powerful and probably won't be used by most users, but I view it as a useful escape-hatch / extension seam for scripting non-interactive traversals like I'm doing. However it's probably only worth real consideration if you find yourself needing to hoist more and more sub-command APIs like "--sync-github-prs" to traverse.
Are you also saying that using --sync-github-prs in non-interactive mode will do a create?
Yes, when both --sync-github-prs and --yes are both passed, then PRs are created automatically. Here's a sample execution on a sandbox repo:
needing to hoist more and more sub-command APIs like "--sync-github-prs" to traverse
Yeah, I think I might end up needing to do something like that at some point 😅
Still, for now, I've extended the semantics of --start-from at PR #1496, and a PR adding --stop-at (or --stop-after, TBD) will soon follow
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
I've been using git-machete in my workflow for some time now, and I've been using a thin wrapper around machete to make my workflows easier and more automated, especially in cases where I alone manage the branch stack I work on.
To this end I often make use of non-interactive
traverse.Building on #1362, since we now have the ability to synchronize a stack of branches, it would be great to stop after a stack has been synced.
It seems to me that the simplest API to support this would allow you to stop traversal either on or after some branch is reached.
In this example
If I were to run this command (
--create-github-prsseems not to be present yet)I would expect the last PR create to be for
feat/notifications-email, leaving me with:Similarly, running
would restack these and sync them.
Alternative Approach
With the proliferation of flags and options on the
traversecommand, I've wondered whether a simpler--commandoption would not make more sense. In this case I would be able to hack together the above by doing the following:All reactions