Re: [PATCH] apply: tell user location of corrupted patch file

2019-10-05 Thread Junio C Hamano
Junio C Hamano writes: >> if (len <= 0) { >> free(fragment); >> -return error(_("corrupt patch at line %d"), >> state->linenr); >> +return error(_("corrupt patch at %s:%d"), >> state->patch_input_file, state->linenr); >>

Re: [PATCH] apply: tell user location of corrupted patch file

2019-10-05 Thread Junio C Hamano
Junio C Hamano writes: >> An alternate design was considered which involved printing the line >> numbers relative to the output of `git am --show-current-patch` (in >> other words, the actual mail file that's provided to am). This design >> was not chosen because am does not store the whole mail

Re: [PATCH] apply: tell user location of corrupted patch file

2019-10-05 Thread Junio C Hamano
Denton Liu writes: > When `git am` runs into a corrupt patch, it'll error out and give a > message such as, > > error: corrupt patch at line 87 > > Casual users of am may assume that this line number refers to the > file that they provided on the command-line. This assumption, however, > i

[PATCH] apply: tell user location of corrupted patch file

2019-10-04 Thread Denton Liu
When `git am` runs into a corrupt patch, it'll error out and give a message such as, error: corrupt patch at line 87 Casual users of am may assume that this line number refers to the file that they provided on the command-line. This assumption, however, is incorrect. The line count reall