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
Currently it seems I can run stg refresh and even if there are no staged changes it still refreshes. This can lead to false confidence if I've forgotten to stage my changes. Similar to my change for stg commit, could stg refresh also reject unless the index has files (once again with an --allow-empty flag)? Or at the very least emit a warning?
The text was updated successfully, but these errors were encountered:
It is a pretty fundamental StGit behavior for refresh to take unstaged changes from the worktree, bypassing the index. I don't think this behavior can be reasonably changed without breaking many (all?) StGit users' workflows.
That said, I appreciate that refresh bypassing the index is also fundamentally different from how git commit works, so I think what you're asking for is reasonable. Running stg refresh -i will give you behavior closer to how git commit works; i.e. stg refresh -i will only take changes staged in the index and will not take changes from the worktree.
A possible change we could make to make stg refresh -i behave even closer to what you're asking would be to make stg refresh -i abort if there is nothing staged in the index. With this change, running stg refresh -i would either capture the changes you've staged in the index, or complain that there is nothing to do (as git commit also does).
Currently it seems I can run
stg refresh
and even if there are no staged changes it still refreshes. This can lead to false confidence if I've forgotten to stage my changes. Similar to my change forstg commit
, couldstg refresh
also reject unless the index has files (once again with an--allow-empty
flag)? Or at the very least emit a warning?The text was updated successfully, but these errors were encountered: