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
The second operation should imho be a no-op. This would also have the side effect to disallow operations which don't make much sense to begin with, e.g.
$ stg pick HEAD
The text was updated successfully, but these errors were encountered:
bonki
changed the title
"Idempotent" pick
"Idempotent" pickMar 15, 2024
I think this idea has merit. Though it is risky to modify a long-standing default behavior.
How would you propose to detect that a pick is a duplicate? I believe the only way would be to play-out the patch application. I.e. we don't know the pick is unnecessary until we've done the pick and the patch ends up empty (i.e. we net the same tree after patch application).
(As a long term user just now migrating from stgit 1 to stgit 2, it seems odd to me to break an invariant like stg pick creating a new patch. )
I think that "stg pick" not creating a patch can be dangerous for people with scripts on top of stgit. Suddently something as simple as "stg pick ...; stg pop" can pop the wrong thing.
Also, sometimes even if the commit is empty, the commit log that comes with the empty patch could still be something that you want to pick.
Thus, IMHO if this were changed, it should be a non-default option.
Could we have
pick
by default not generate a patch if it would result in an empty patch?E.g.
The second operation should imho be a no-op. This would also have the side effect to disallow operations which don't make much sense to begin with, e.g.
The text was updated successfully, but these errors were encountered: