Greg Hurrell [Mon, 21 Dec 2020 20:27:07 +0000 (21:27 +0100)]
Merge branch 'pull/9'
Closes: https://github.com/wincent/vcs-jump/pull/9
* pull/9:
docs: update AUTHORS and HISTORY sections
fix: set diff.noprefix=no to avoid local config removing the prefix
fix: stop hunk header regex from mismatching wrong line number
Closes: https://github.com/wincent/vcs-jump/pull/7
* pull/7:
docs: update HISTORY and AUTHORS sections
refactor: tweak case of config name
fix: use with git diff.mnemonicprefix configuration
As per `man git-config`, config names are case-insensitive:
> The configuration variables are used by both the Git plumbing and
> the porcelains. The variables are divided into sections, wherein the
> fully qualified variable name of the variable itself is the last
> dot-separated segment and the section name is everything before
> the last dot. The variable names are case-insensitive, allow only
> alphanumeric characters and -, and must start with an alphabetic
> character. Some variables may appear multiple times; we say then that
> the variable is multivalued.
So this won't have any effect on the behavior, other than making the
case match the case of the man page:
diff.mnemonicPrefix
If set, git diff uses a prefix pair that is different from the
standard "a/" and "b/" depending on what is being compared. When
this configuration is in effect, reverse diff output also swaps
the order of the prefixes:
git diff
compares the (i)ndex and the (w)ork tree;
git diff HEAD
compares a (c)ommit and the (w)ork tree;
git diff --cached
compares a (c)ommit and the (i)ndex;
git diff HEAD:file1 file2
compares an (o)bject and a (w)ork tree entity;
git diff --no-index a b
compares two non-git things (1) and (2).
Added some automated test cases because it is just too hard to be sure
that changes won't break a specific Git or Mercurial workflow.
As these tests show (I think), the vcs-jump executable should now work
in a number of edge cases (in subdirectories) in both Git and Mercurial,
which will make things work a little better for Vim users who use
`'autochdir'`.
Greg Hurrell [Tue, 11 Jun 2019 20:24:44 +0000 (22:24 +0200)]
fix: add `--no-color` to `git diff` invocation (#1)
Makes sure that the output from `git diff` is still usable even when
`git config color.ui` is set to "always" (instead of "auto", which is
the default).