Commit Graph

74 Commits

Author SHA1 Message Date
Marco Hinz
0867de3ac3 Escape cwd 2015-05-28 19:24:40 +02:00
Marco Hinz
c0da740d7e Don't cache cwd 2015-05-28 18:40:30 +02:00
Marco Hinz
a05b780c33 Add :SignifyDebugUnknown 2015-05-26 10:59:29 +02:00
Marco Hinz
a1cfbc8b70 Perforce: use difftool modifier 2015-05-25 09:25:23 +02:00
Marco Hinz
3f1f9c17fd Add :SignifyDebugDiff
References #161
2015-05-24 10:40:18 +02:00
Marco Hinz
4ed7b37205 Merge branch 'cmd-options'
This merge removes g:signify_diffoptions and replaces it by the much more
general g:signify_vcs_commands. Users can customize the entire command to be
run now.
2015-05-24 09:42:03 +02:00
James McCoy
0001094dea Copy stdout fd to stderr only after stdout is redirected
Signed-off-by: James McCoy <vega.james@gmail.com>
2015-05-24 00:56:44 -04:00
James McCoy
c2fc1dc78a Revert "Escape 2>&1 in the p4 detection"
This reverts commit 5cdf72acd1.

`shellescape()`, which is what `sy#util#escape()` is a front-end to, is
only supposed to escape a single element of an argv list. In this case,
it's being used to escape multiple -- `p4 info 2>&1 >`. None of that
should be escaped anyway, because they need to be interpreted by the
shell.
2015-05-24 00:41:21 -04:00
Marco Hinz
8955952295 /dev/null -> %n 2015-05-20 14:22:52 +02:00
Marco Hinz
23ddfa87a0 Use b:sy_info 2015-05-20 14:00:39 +02:00
Marco Hinz
ae38ddc7f6 Move variables to the bottom 2015-05-20 13:11:26 +02:00
Marco Hinz
1469ecb05f g:signify_diffcmds -> g:signify_vcs_cmds 2015-05-19 15:39:04 +02:00
Marco Hinz
7d022eb5fd Introduce g:signify_diffcmds 2015-05-19 15:26:22 +02:00
Marco Hinz
57f51d197d Remove useless fnamemodify() 2015-05-19 15:07:25 +02:00
Marco Hinz
74068229f0 Cleanup 2015-05-19 14:57:40 +02:00
Marco Hinz
e32f685640 Cache difftool and devnull 2015-05-19 14:48:33 +02:00
Marco Hinz
bed28c1db5 Add %n modifier 2015-05-19 14:09:48 +02:00
Marco Hinz
883f3a1cd3 system() -> s:run() 2015-05-19 14:06:52 +02:00
Marco Hinz
330dffd2dd Refactoring + %d and %f modifiers for commands
%d gets replaced by the difftool
%f gets replaced by the actual file
2015-05-19 14:01:29 +02:00
Stephan Steinbach
5cdf72acd1 Escape 2>&1 in the p4 detection
References #157.
2015-04-16 00:44:48 +02:00
James McCoy
06c51319c0 Detect valid Perforce configurations with “p4 info”
“p4 monitor info” isn't always available and can impose a heavy runtime
cost when it is if the server isn't responsive.

Closes mhinz/vim-signify#153

Signed-off-by: James McCoy <vega.james@gmail.com>
2015-02-23 22:26:39 -05:00
Ed Page
9c94652917 Making the cross-platform /dev/null reusable 2014-12-30 15:10:43 -06:00
Ed Page
3cade031b6 Fix Perforce support on Windows 2014-12-30 14:45:15 -06:00
Marco Hinz
52cb36801d get_diff_hg: Disable color extension
This handles the case where a user forces colors from the color extension via
hgrc:

    [extensions]
    color =

    [defaults]
    diff = --colors=always

Sy disables these for its 'hg diff' call, otherwise the output would be
riddled with color escape sequences and couldn't be parsed properly which
would result in no signs shown.

References #146.
2014-11-23 07:34:20 +01:00
James McCoy
6d45797393 get_diff_hg: Run diff from the file's parent directory
Mercurial's detection for where a file's containing repo is doesn't work
well when the working directory is a different Mercurial repo (c.f.,
mhinz/vim-signify#146).  Run "hg diff" from the target file's parent
directory to work around this.

Signed-off-by: James McCoy <vega.james@gmail.com>
2014-11-23 00:03:26 -05:00
James McCoy
75c8b4d54a Preserve user's order in vcs_list
Signed-off-by: James McCoy <vega.james@gmail.com>
2014-10-23 17:44:32 -04:00
Marco Hinz
64c3b60a98 Revert "Use 'git -C'"
This reverts commit 8fa7aea4b3.

Although -C was introduced in git 1.8.5, over a year ago, it still might be
too new for some of us.
2014-10-09 22:35:17 +02:00
Marco Hinz
8fa7aea4b3 Use 'git -C' 2014-10-09 18:58:23 +02:00
Marco Hinz
fe3bafce11 Introduce smarter sign management 2014-10-04 15:56:10 +02:00
Marco Hinz
4d3674d431 Perforce: check for server availability before requesting a diff
References #131.
2014-09-07 16:11:07 +02:00
James McCoy
e270560349 Replace all uses of "cd … && do_something" with sy#util#run_in_dir
Signed-off-by: James McCoy <vega.james@gmail.com>
2014-01-30 23:04:39 -05:00
Marco Hinz
0e66e0963f Fix matching of the "first line deleted" sign
Closes #112.
2014-01-15 09:48:43 +01:00
James McCoy
159b171e4a Use _> for more than 99 deletes lines (again)
Closes #110.
2014-01-04 09:40:10 +01:00
Marco Hinz
5db82c4d2a Let counter overflow if more than 100 lines deleted
If there are more than 99 deleted lines, the actual count isn't being
important anymore. Thus we just let it overflow and save another
conditional.

100 deleted lines -> "00"

Closes #109.
2014-01-01 22:54:49 +01:00
James McCoy
7f57ee5af6 Use two digit numbers for SignifyDelete signs
Defining the SignifyDelete set of signs on the fly provides the ability
to specify the exact line deletion count for up to 99 lines, rather than
the current limit of 9 lines.

This also has the benefit of reducing the number of signs defined when
there aren't many hunks of deleted lines.  On the flip side, if there
are other sign-placing plugins in use, then it also increases the chance
of nearing the ~120 sign definition limit if there are many hunks of
varying line deletions.
2013-12-11 10:04:52 +01:00
Marco Hinz
824b186ce5 Perforce: make it use g:signify_diffoptions
References #89.
2013-11-22 19:50:51 +01:00
James McCoy
5211c19ee7 Move Sy's data from g:sy to b:sy 2013-11-22 13:48:49 +01:00
Marco Hinz
1c762af02e Fix typo 2013-11-20 19:39:53 +01:00
Marco Hinz
2fbdc52ad7 Fix handling of certain git implementations
Closes #87.
2013-11-20 16:31:53 +01:00
Marco Hinz
5817de27c8 Merge pull request 86 from @thallett
Closes #86.
2013-11-18 23:36:56 +01:00
Timothy Hallett
ea5d13ce46 Dynamically re-apply diff options on every diff
Prior to this patch, it was not possible to dynamically apply arguments
to diff commands.  The g:signify_diffoptions variable was only read when
the plugin was loaded.

This patch changes the behavior so that before each diff it checks
g:signify_diffoptions to see what arguments should be passed to the diff
tool.

The motivating use case behind this change is to be able to diff against
a different branch in Git via a key mapping. However, This change will
also allow any other arbitrary diff options to be dynamically updated,
such as whitespace, etc.

Example: Show diff against master instead of against HEAD in Git
  nnoremap \u :let g:signify_diffoptions = { 'git': 'master'}<CR>:SignifyToggle<CR>
2013-11-18 23:34:47 +01:00
Marco Hinz
79cb027b35 Perforce: diff -du0 -> diff -dU0
Closes #89.
2013-11-18 10:26:09 +01:00
Ed Page
9b7ad65ea9 Remove double-dash from perforce call
Closes #85.
2013-11-09 14:22:01 +01:00
Marco Hinz
1499f548a2 Improve repo detection
Prior to this patch a VCS was only detected by checking if a potential
diff was empty or not. Now the combination of return value and diff is
checked, so it detects an underlying VCS properly even when there are no
changes.

This can save many useless calls to the wrong version control systems.

Simple test:

 - open a version-controlled file without any changes
 - :SyDebug should show the correct VCS now (instead of 'unknown')

Closes #82.
2013-11-03 19:31:46 +01:00
Marco Hinz
8fd2d3ce76 Do not use certain VCS if no difftool is available
References #83.
2013-11-03 16:07:15 +01:00
Dario Sneidermanis
e398fc4856 Repo.vim: use correct variable
After one of the recent changes 'deleted' was used in a place where
'removed' should have been used. This could lead errors:

Error detected while processing function
   sy#toggle..sy#start..sy#repo#process_diff..sy#sign#set:
line   10:
E155: Unknown sign: SignifyChangeDelete12
2013-10-01 09:34:17 +02:00
Marco Hinz
50496311c5 Remove guards from autoload files 2013-09-30 10:22:20 +02:00
Marco Hinz
a9284f363c Move modelines to the top 2013-09-30 10:19:31 +02:00
Marco Hinz
b579bd9f8c Code cleanup in repo.vim 2013-09-27 10:45:35 +02:00
James McCoy
ded8213bf6 Calculate correct ChangeDelete sign to use
Using deleted was causing the sign to reflect all the deleted lines so
far in the buffer instead of the deleted line count for this hunk.
2013-09-27 00:13:28 -04:00