# Confused by git am error message.

2 messages from 2012-09-18 to 2012-09-18. Participants: Philip Oakley, Junio C Hamano.
Thread: https://gitlist.dev/t/31589

## Philip Oakley, 2012-09-18 21:51

Subject: Confused by git am error message.
Message-ID: <747F66C694C844EAA56F4BB62C405F78@PhilipOakley>
URL: https://gitlist.dev/e/747F66C694C844EAA56F4BB62C405F78%40PhilipOakley

```
[a user confusion report]
I was updating my patch series manually aand made a mistake, so the 
series didn't apply properly. However the error message confused me.

    ...
    Applying: Doc clean: add See Also links
    fatal: corrupt patch at line 17
    Patch failed at 0008 Doc clean: add See Also links
    When you have resolved this problem run "git am --resolved".
    ...

In my case I resolved the _patch_ error, and then expected that doing 
the 'git am --resolved' would try to re-apply the patch and continue 
happily - I had checked that the status was clean - but it didn't.

    Philip@PHILIPOAKLEY /c/msysgit179/git (nextDoc|AM)
    $ git am --resolved
    Applying: Doc clean: add See Also links
    No changes - did you forget to use 'git add'?
    If there is nothing left to stage, chances are that something else
    already introduced the same changes; you might want to skip this 
patch.

I'm not quite sure what the 'right' answer should be, maybe a --reapply 
option, or slightly different words in the message to highlight that the 
user is to make their worktree/index look like the patch _had_ applied, 
or something else?

Philip

```

## Junio C Hamano, 2012-09-18 22:51

Subject: Re: Confused by git am error message.
Message-ID: <7vr4pzj66e.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vr4pzj66e.fsf%40alter.siamese.dyndns.org
In-Reply-To: <747F66C694C844EAA56F4BB62C405F78@PhilipOakley>

```
"Philip Oakley" <philipoakley@iee.org> writes:

> [a user confusion report]
> I was updating my patch series manually aand made a mistake, so the
> series didn't apply properly. However the error message confused me.
>
>    ...
>    Applying: Doc clean: add See Also links
>    fatal: corrupt patch at line 17
>    Patch failed at 0008 Doc clean: add See Also links
>    When you have resolved this problem run "git am --resolved".
>    ...
>
> In my case I resolved the _patch_ error, and then expected that doing
> the 'git am --resolved' would try to re-apply the patch and continue
> happily - I had checked that the status was clean - but it didn't.

I recall we went back and forth before settling to the current
wording.  The "have resolved this problem" in that sentence wants to
say "The underlying 'apply --index' did not manage to update the
working tree and the index to the state a perfect patch would have
updated, so please help me by doing so yourself".

When it did not apply (i.e. not "conflicted when run as 'am -3'"),
an alternative is to edit $GIT_DIR/rebase-apply/patch to make it
applicable, and say "git am" again _without_ "--resolved".  But that
is not what the message is suggesting.

```
