]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Revert "logmsg_reencode(): warn when iconv() fails"
authorJunio C Hamano <gitster@pobox.com>
Fri, 29 Oct 2021 20:48:58 +0000 (13:48 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 29 Oct 2021 20:48:58 +0000 (13:48 -0700)
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.

Documentation/pretty-options.txt
pretty.c
t/t4210-log-i18n.sh

index b3af8506086a83216abc5e5791dfe6c36eaf978c..54d8bb3db0bdd61be23413bb2d1f5589ab6caa20 100644 (file)
@@ -40,9 +40,7 @@ people using 80-column terminals.
        defaults to UTF-8. Note that if an object claims to be encoded
        in `X` and we are outputting in `X`, we will output the object
        verbatim; this means that invalid sequences in the original
-       commit may be copied to the output. Likewise, if iconv(3) fails
-       to convert the commit, we will output the original object
-       verbatim, along with a warning.
+       commit may be copied to the output.
 
 --expand-tabs=<n>::
 --expand-tabs::
index 73b5ead5099d3efdb3e1999865ab868da5053ea6..9631529c10a072a21acb76d65545d61a80b337d4 100644 (file)
--- a/pretty.c
+++ b/pretty.c
@@ -671,11 +671,7 @@ const char *repo_logmsg_reencode(struct repository *r,
         * If the re-encoding failed, out might be NULL here; in that
         * case we just return the commit message verbatim.
         */
-       if (!out) {
-               warning("unable to reencode commit to '%s'", output_encoding);
-               return msg;
-       }
-       return out;
+       return out ? out : msg;
 }
 
 static int mailmap_name(const char **email, size_t *email_len,
index 0141f36e338188c87ca6765871e67f091b7240f8..d2dfcf164e25b8771dd852d2aefc4aee4bd3f5ea 100755 (executable)
@@ -131,11 +131,4 @@ do
        fi
 done
 
-test_expect_success 'log shows warning when conversion fails' '
-       enc=this-encoding-does-not-exist &&
-       git log -1 --encoding=$enc 2>err &&
-       echo "warning: unable to reencode commit to ${SQ}${enc}${SQ}" >expect &&
-       test_cmp expect err
-'
-
 test_done