Revert "logmsg_reencode(): warn when iconv() fails"

This reverts commit fd680bc5 (logmsg_reencode(): warn when iconv() fails, 2021-08-27). Throwing a warning for each and every commit that gets reencoded, without allowing a way to squelch, would make it unpleasant for folks who have to deal with an ancient part of the history in an old project that used wrong encoding in the commits.

Junio C Hamano committed Oct 29, 2021 at 13:48 UTC 0988e665e936d0c2c861dcd652bff9817e9446bf
3 files changed +2 -15
Documentation/pretty-options.txt
+1 -3
@@ -40,9 +40,7 @@ people using 80-column terminals.
40 defaults to UTF-8. Note that if an object claims to be encoded
41 in `X` and we are outputting in `X`, we will output the object
42 verbatim; this means that invalid sequences in the original
43 - commit may be copied to the output. Likewise, if iconv(3) fails
44 - to convert the commit, we will output the original object
45 - verbatim, along with a warning.
43 + commit may be copied to the output.
44
45 --expand-tabs=<n>::
46 --expand-tabs::
pretty.c
+1 -5
@@ -671,11 +671,7 @@ const char *repo_logmsg_reencode(struct repository *r,
671 * If the re-encoding failed, out might be NULL here; in that
672 * case we just return the commit message verbatim.
673 */
674 - if (!out) {
675 - warning("unable to reencode commit to '%s'", output_encoding);
676 - return msg;
677 - }
678 - return out;
674 + return out ? out : msg;
675 }
676
677 static int mailmap_name(const char **email, size_t *email_len,
t/t4210-log-i18n.sh
-7
@@ -131,11 +131,4 @@ do
131 fi
132 done
133
134 -test_expect_success 'log shows warning when conversion fails' '
135 - enc=this-encoding-does-not-exist &&
136 - git log -1 --encoding=$enc 2>err &&
137 - echo "warning: unable to reencode commit to ${SQ}${enc}${SQ}" >expect &&
138 - test_cmp expect err
139 -'
140 -
134 test_done