Skip to content

fix BUG() with "git am -i --resolved"

Jeff King git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4am: simplify prompt response handlingbuiltin/am.c+1 -30 replies
2/4am: read interactive input from stdinbuiltin/am.c+4 -20 replies
3/4am: drop tty requirement for --interactivebuiltin/am.c+3 -315 replies
4/4am: fix --interactive HEAD tree resolutionbuiltin/am.c t/t4257-am-interactive.sh+60 -38 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] fix BUG() with "git am -i --resolved"
Quoted 3 lines · Jeff King

I haven't tried to reproduce yet. Is the repository (and patch) that you used to demonstrate this publicly available? Or alternatively, is it possible to show a backtrace from the coredump?

Never mind. It reproduces quite easily, because AFAICT "am -i --resolved" has been totally broken since it was converted to C (in 2015!). I guess it does not have many users. :)

Quoted 1 line

If my blind guess is right, then something like this probably fixes it:

This is indeed the problem. Here are some patches. The actual fix is what I showed already. The other three are just making it possible to cover this with the test suite (until now, we had no coverage of "am --interactive" at all).

[1/4]: am: simplify prompt response handling [2/4]: am: read interactive input from stdin [3/4]: am: drop tty requirement for --interactive [4/4]: am: fix --interactive HEAD tree resolution

 builtin/am.c              | 30 +++++++++++++++---------
 t/t4257-am-interactive.sh | 49 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 68 insertions(+), 11 deletions(-)
 create mode 100755 t/t4257-am-interactive.sh

-Peff