Skip to content
  • Jeff King's avatar
    trace: do not fall back to stderr · 6f253057
    Jeff King authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    If the trace code cannot open a specified file, or does not
    understand the contents of the GIT_TRACE variable, it falls
    back to printing trace output to stderr.
    
    This is an attempt to be helpful, but in practice it just
    ends up annoying. The user was trying to get the output to
    go somewhere else, so spewing it to stderr does not really
    accomplish that. And as it's intended for debugging, they
    can presumably re-run the command with their error
    corrected.
    
    So instead of falling back, this patch disables bogus trace
    keys for the rest of the program, just as we do for write
    errors. We can drop the "Defaulting to..." part of the error
    message entirely; after seeing "cannot open '/foo'", the
    user can assume that tracing is skipped.
    
    Signed-off-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    6f253057