Skip to content

Commit

Permalink
add --warn-binary
Browse files Browse the repository at this point in the history
fixes #22 by suppressing warnings by default
  • Loading branch information
casperdcl committed Jun 19, 2019
1 parent 701af53 commit 9c6d6eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion git-fame_completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ _git_fame()
;;
*)
if [ ${COMP_WORDS[1]} == fame ]; then
COMPREPLY=($(compgen -dW '-h --help -v --version --cost --branch --since --sort --incl --excl -n --no-regex -s --silent-progress -t --bytype -w --ignore-whitespace -M -C --format --manpath --log' -- ${cur}))
COMPREPLY=($(compgen -dW '-h --help -v --version --cost --branch --since --sort --incl --excl -n --no-regex -s --silent-progress --warn-binary -t --bytype -w --ignore-whitespace -M -C --format --manpath --log' -- ${cur}))
fi
;;
esac
Expand Down
4 changes: 3 additions & 1 deletion gitfame/_gitfame.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
rather than regular expressions [default: False].
NB: if regex is enabled `,` is equivalent to `|`.
-s, --silent-progress Suppress `tqdm` [default: False].
--warn-binary Don't silently skip files which appear to be binary data
[default: False].
-t, --bytype Show stats per file extension [default: False].
-w, --ignore-whitespace Ignore whitespace when comparing the parent's
version and the child's to find where the lines
Expand Down Expand Up @@ -240,7 +242,7 @@ def run(args):
try:
blame_out = check_output(git_blame_cmd, stderr=subprocess.STDOUT)
except Exception as e:
log.warn(fname + ':' + str(e))
getattr(log, "warn" if args.warn_binary else "debug")(fname + ':' + str(e))
continue
log.log(logging.NOTSET, blame_out)
loc_auth_times = RE_AUTHS.findall(blame_out)
Expand Down

0 comments on commit 9c6d6eb

Please sign in to comment.