stacked-git / stgit

Stacked Git
https://stacked-git.github.io/
GNU General Public License v2.0
521 stars 60 forks source link

feature request: stg move #463

Closed dlan17 closed 3 months ago

dlan17 commented 3 months ago

it would be convenient to have a helper command to move changes of files/dir from one series to another, something like this:

stg_move [file or dir] [from_series] [to_series]

stg_move() { P=xyz.patch if [ -f $1 ] || [ -d $1 ]; then git log -p -1 $1 > $P fi patch -p1 -R < $P stg refresh -p $2 patch -p1 < $P git add -A . stg refresh -p $3 }

jpgrayson commented 3 months ago

stg spill -- <path...> can be used to "spill" the changes associated with one or more files or directories from the current patch. The changes remain in the working tree and index though, so they can be put into a new patch or refreshed into another existing patch.

stg goto patchX
stg spill -- dir/file dir2
stg refresh -p patchY

It's not clear that a new command is needed.