builtin-am: implement -i/--interactive
commit7ff26832535a83bd8d75beefbf822d965e066961
authorPaul Tan <pyokagan@gmail.com>
Tue, 4 Aug 2015 13:52:03 +0000 (4 21:52 +0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 5 Aug 2015 05:02:11 +0000 (4 22:02 -0700)
treec63a9e348d497bd430337cd78a910a5519377b11
parent94cd175cff196d2571bc2e17ad8e9f47ef4b3911
builtin-am: implement -i/--interactive

Since d1c5f2a (Add git-am, applymbox replacement., 2005-10-07),
git-am.sh supported the --interactive mode. After parsing the patch mail
and extracting the patch, commit message and authorship info, an
interactive session will begin that allows the user to choose between:

* applying the patch

* applying the patch and all subsequent patches (by disabling
  interactive mode in subsequent patches)

* skipping the patch

* editing the commit message

Since f89ad67 (Add [v]iew patch in git-am interactive., 2005-10-25),
git-am.sh --interactive also supported viewing the patch to be applied.

When --resolved-ing in --interactive mode, we need to take care to
update the patch with the contents of the index, such that the correct
patch will be displayed when the patch is viewed in interactive mode.

Re-implement the above in builtin/am.c

Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/am.c