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
It would be very convenient for rex to offer a --from-history flag, where it captures all the current shell's history, back to whatever the last git command was, and drop into an editor for a commit message with said commands listed in a script block.
This feature is likely to have a lot of subtle complexities to worry about; for instance, certain git commands like diff are a common part of establishing that a command has done what the user anticipated, so should be skipped over in the history.
Note that I'm not sure if this feature is actually possible (i.e. whether a script can access the history of the invoking shell). Experimentation suggests a bash script can access its parent's history, but I suspect this is because it is run within the same process for efficiency; calling into bash via a python subprocess call returns a blank history.
It would be possible to grab commands from $HISTFILE (as an undocumented feature since by default it is not updated until the shell is closed), but they will be interleaved with commands from other shells in a way we cannot untangle.
It would be very convenient for
rex
to offer a--from-history
flag, where it captures all the current shell's history, back to whatever the lastgit
command was, and drop into an editor for a commit message with said commands listed in a script block.This feature is likely to have a lot of subtle complexities to worry about; for instance, certain git commands like
diff
are a common part of establishing that a command has done what the user anticipated, so should be skipped over in the history.Should respect the core.editor config, if set.
The text was updated successfully, but these errors were encountered: