2011/1/27 Erik Carstensen <[email protected]>:
> I find "stg refresh --index" useful for this purpose, especially in
> conjunction with the "Amend last commit" mode of git-gui, which allows
> me to unstage parts of the top commit.

You described exactly what I want... except your solution does not
work. Because git gui is not stacked git-aware. And even worse, "stg
repair" fails in this case (it seems to duplicates the patch...)

Here is a shell script that does it without breaking stacked git. It
is ugly but it seems to work.

#!/bin/sh

set -e
# set -x

pname="$(stg top)"
porig="${pname}".orig

stg pop || exit $?
stg rename "${pname}" "${porig}"
# all this just to reliably copy the commit message now
stg pick -n "${pname}" "${porig}"

# zero the new copy
stg show | patch -R -p1
stg refresh

# spill (and delete) the old copy
stg push
stg delete --spill "${porig}"

_______________________________________________
stgit-users mailing list
[email protected]
https://mail.gna.org/listinfo/stgit-users

Reply via email to