It works nicely with git-gui as long as you don't touch the "Commit"
button :) You can just use git-gui as an index editor: You can unstage
parts of an already committed patch (in the Amend Last Commit mode),
which only means that you apply the inverse of the unstaged change to
the index, without touching the working tree. As long as you don't
commit, this change will stay in the index, and it can be applied to
the patch using stgit refresh --index.

On Thu, Jan 27, 2011 at 1:28 PM, Marc Herbert
<[email protected]> wrote:
> 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
>

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

Reply via email to