Commit Graph

161 Commits

Author SHA1 Message Date
Marco Hinz
14f7fda000
Verbose: mention cmd dir and run dir 2018-12-27 15:37:51 +01:00
Marco Hinz
49c8ce0f13
Typo 2018-12-27 15:19:49 +01:00
Marco Hinz
ea6db3c7df Improve directory changing
On Windows, Vim and Nvim can't work with mklink'ed paths. Issue an error message
and bail out before starting the actual job when the directory can't be changed.

Fixes https://github.com/mhinz/vim-signify/issues/279
2018-12-20 23:28:01 +01:00
Marco Hinz
412ae37d93
Add missing "catch all exceptions" clause 2018-12-16 17:42:42 +01:00
itouen
ea87e05e6f SignifyDiff: convert encoding based on fileencoding (#278) 2018-11-16 17:23:24 +01:00
Marco Hinz
c4eb6e1469
SignifyDiff! will not open a new tab
This makes is behave like :SignifyFold.

Closes #271
2018-11-02 21:15:34 +01:00
Marco Hinz
4e7faba8d3
Hg: change default invocation (#275)
Mercurial used to enable colors via an extension. Nowadays that is not true
anymore and `extensions.color=!` is rendered useless. Use the omnipresent
`--color=never` instead.

`defaults` is deprecated in favor of `aliases`. We use `aliases.diff=` to force
the use of the standard diff behaviour of `hg diff` which is the same as from
GNU diff. Otherwise an external diff tool could produce output that signify does
not understand.

Refrences #272
2018-10-31 16:59:03 +01:00
spar01
40d1a4ee19 Don't open folds in diff mode (#269)
Closes #268
2018-08-05 12:11:25 +02:00
spar01
fe8b5eb4c5 Perforce: fix command (#267)
Commit cc2b17d462 removed the '&&' used to check whether the p4 info command succeeded. This caused incorrect invocation of the p4 diff command.
Add back the check for p4 info command success.

Prior to this commit the command invoked was:
p4 info >/dev/null 2>&1 env P4DIFF= P4COLORS= p4 diff -du0

This commit makes the invocation as:
p4 info >/dev/null 2>&1 && env P4DIFF= P4COLORS= p4 diff -du0
2018-08-02 10:57:48 +02:00
Marco Hinz
cc2b17d462
Perforce: avoid colored output on Unixes
On Unix, many people use P4DIFF=colordiff to get colored diff output with `p4
diff`. But our diff parser doesn't expect these escape sequences used for
coloring.

We now simply use empty $P4DIFF and $P4COLORS to be on the safe side.

Reference:

  36c7d22a69 (commitcomment-29924066)
2018-08-01 21:02:08 +02:00
Aaron Miller
36c7d22a69 Windows: allow p4 diff command to actually work
Windows doesn't know about the `env` program.

Apart from that, using an external diff tool is not even needed anymore, since
`p4 diff` itself supports unified diffs nowadays.
2018-07-25 12:13:53 +02:00
Marco Hinz
0f12c2b18c
SignifyDiff: support Perforce
References #253
2018-05-03 17:37:03 +02:00
Marco Hinz
c42f8b21b4
Make "no 'diff' executable found" message verbose-only
Fixes #256
2018-04-30 14:02:58 +02:00
Marco Hinz
8351e5212f
Improve detection of nested repos managed by different VCS
Assume a hg repo below a git repo. `git diff` on a file managed by hg, will
return a successful exit value, but no output.

So, if we got a successful exit value from multiple VCS tools, and none of them
gave any output, keep them all as potential candidates. The next time Sy is run,
only these candidates will be tested again.

If one of them returns a proper diff, set b:sy.updated_by to that VCS and prune
all other candidates.

References #235
2018-04-17 17:35:08 +02:00
Marco Hinz
3d3edac39d
Refactoring 2018-04-15 22:00:17 +02:00
Marco Hinz
a804002c21
CVS: fix regexp 2018-04-15 17:49:03 +02:00
Marco Hinz
daf59eee47
SignifyDiff: support CVS 2018-04-15 14:27:23 +02:00
Marco Hinz
791fe598a6
SignifyDiff: support darcs 2018-04-15 13:23:51 +02:00
Marco Hinz
8bcbd9cb7b
SignifyDiff: support bzr 2018-04-15 13:11:10 +02:00
Marco Hinz
da02a4796b
SignifyDiff: support subversion 2018-04-15 13:01:38 +02:00
Marco Hinz
12f28b1336
Refactor cmd expansion 2018-04-13 15:01:47 +02:00
Marco Hinz
b199f9eec0
Remove unused line 2018-04-13 14:59:11 +02:00
Marco Hinz
38cb96c987
Move b:sy_info to b:sy.info 2018-04-13 14:49:57 +02:00
Marco Hinz
d9e881bd0f
SignifyDiff: cd into dir of file
All VCS assume slightly different things where things have to be if you're in
this directory using that command etc.

Changing to the directory of the current file avoids many pitfalls.
2018-04-13 13:01:02 +02:00
Marco Hinz
14413921fe
SignifyDiff: add verbose message 2018-04-13 12:59:58 +02:00
Marco Hinz
32a1761e42
Remove useless line
The line became useless as of bf099a3fe2
2018-04-13 12:39:46 +02:00
Marco Hinz
841b3f0597
SignifyDiff: support mercurial 2018-04-11 16:40:59 +02:00
Marco Hinz
28744768e6
SignifyDiff: expose g:signify_vcs_cmds_diffmode 2018-04-11 16:40:59 +02:00
Marco Hinz
46699b1df6
SignifyDiff: initial support for :SignifyDiff
Currently this only works for git and is not documented.
2018-04-11 16:40:59 +02:00
Marco Hinz
26ed57e0fe
RCS: exit value of 1 means there are changes, 2 means error
Fixes #251
2018-02-21 13:28:40 +01:00
Marco Hinz
7cc32c28aa
Darcs: update arguments
Fixes https://github.com/mhinz/vim-signify/issues/243
2017-07-27 16:39:59 +02:00
Marco Hinz
64b2170a1f
Remove all references to do_register 2017-04-18 17:15:28 +02:00
Marco Hinz
92ed727f3a
Remove caching mechanism
We introduced this when everything still got executed sychronously. It also
dosn't play well with multiple active VCS anymore.
2017-04-18 17:02:40 +02:00
Marco Hinz
b119f8d81b
Allow multiple active VCS
When you have nested repos of different VCS and you edit a file from the inner
repo, more than one VCS can return a valid diff. Only one VCS should return a
non-empty diff, though.

Once a non-empty diff is found, all other VCS get disabled to reduce overhead.

References #235.
2017-04-18 17:00:12 +02:00
Marco Hinz
9dcdb8fda9
Cleanup 2017-03-13 15:50:04 +01:00
Marco Hinz
9d0947952e
Avoid running detection more than once
Before this change, it was possible that a buffer was disabled, when Sy was run
more than once at startup, e.g. because of `BufEnter` and `FocusGained`.

The first call would start the detection and the second call would disable the
buffer, because the first call hadn't changed the VCS type from "unknown" yet.
2017-02-24 17:16:17 +01:00
Marco Hinz
bf099a3fe2
Nvim: provide cwd to jobstart() 2017-02-20 15:14:24 +01:00
Marco Hinz
61d5a48c71
Simplify has-patch condition
The new format is supported since 7.4.237. If a Vim doesn't recognize the
format, it's too old by definition.
2017-02-20 15:03:34 +01:00
Marco Hinz
7a639b0263
Rename callback functions 2017-02-20 14:52:24 +01:00
Marco Hinz
0908e37758
Vim: make sure all stdout is read when job exits
References #228.
2017-02-20 14:47:51 +01:00
Marco Hinz
3020873ee4
Use correct cwd in verbose output 2017-02-20 01:38:25 +01:00
Marco Hinz
40deeb3fdf
Win: string passed to job_start() must contain shell
References #228.
2017-02-19 17:11:07 +01:00
Marco Hinz
e1396b903c
Add cmd and cwd to verbose output 2017-02-19 02:23:06 +01:00
Marco Hinz
34ee12d179
Vim compat fix: type variables were introduced in 7.4.2071
To avoid issues for Vim versions between 7.4.1966 and 7.4.2071, we now use
type() to distinguish between the type of variable `job_id` being either Number
or Job.
2017-02-17 16:25:00 +01:00
Marco Hinz
8d35722aa1
Fix "Calling dict function without Dictionary"
Closes #223.
2017-02-17 15:14:34 +01:00
Marco Hinz
b7db40e58e
Vim uses Job instances instead of job IDs
References #222.
2017-02-17 11:29:06 +01:00
Marco Hinz
6364e8f7f2 Vim: use close_cb to trigger exit_cb
Before Vim 8.0.50, an exited job was only detected with a potentially huge
delay.

Thus, for versions smaller than 8.0.50, we add a close_cb callback that runs
job_status() which in return runs the exit_cb callback immeditely if the job was
found to be dead.

Vim patch:

    01688ad545

References: #216.
2017-02-16 15:29:41 +01:00
Marco Hinz
f6d76b41d6
Neovim: fix stdout logic
References #218.
2017-02-15 15:27:24 +01:00
Marco Hinz
a2c28f6540
A diff is a list of lines and no long string anymore
References #216.
2017-02-10 17:40:11 +01:00
James McCoy
8d5e018519 Rename variable to work with older (n)vim, when types were sticky
Closes #213
2017-02-01 09:10:06 -05:00