• Jeff King's avatar
    pretty: make empty userformats truly empty · b9c7d6e4
    Jeff King authored
    If the user provides an empty format with "--format=", we
    end up putting in extra whitespace that the user cannot
    prevent. This comes from two places:
      1. If the format is missing a terminating newline, we add
         one automatically. This makes sense for --format=%h, but
         not for a truly empty format.
      2. We add an extra newline between the pretty-printed
         format and a diff or diffstat. If the format is empty,
         there's no point in doing so if there's nothing to
    With this patch, one can get a diff with no other cruft out
    of "diff-tree --format= $commit".
    Signed-off-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
commit.h 12 KB