Giter Site home page Giter Site logo

Perforce support? about vim-signify HOT 11 CLOSED

mhinz avatar mhinz commented on June 4, 2024
Perforce support?

from vim-signify.

Comments (11)

mhinz avatar mhinz commented on June 4, 2024

Sure, I look into the "Free 20-User Edition" edition and learn the basics. Afterwards I'll decide if it would be easy enough to include! :-)

from vim-signify.

ssteinbach avatar ssteinbach commented on June 4, 2024

Cool, let me know if you want help. Is there a tutorial for adding vcs support to signify? I didn't see anything in the docs on what it takes to add a new architecture.

Great plugin by the way!

thanks!
-s.

On Jul 29, 2013, at 9:25 AM, Marco Hinz [email protected] wrote:

Sure, I look into the "Free 20-User Edition" edition and try to learn the basics. Afterwards I'll decide if it would be easy enough to include! :-)


Reply to this email directly or view it on GitHub.

from vim-signify.

mhinz avatar mhinz commented on June 4, 2024

So.. I just downloaded the p4 commandline client, but it obviously needs a "valid Perforce server network address 'P4PORT' for most operations". Let's see if I can set that up.

Basically one just need to figure out how to get a unified diff from the VCS. Afterwars I'd just add a function "sy#repo#get_diff_perforce()" and extend the internal list in "sy#repo#detect()" by 'perforce'.

Example for hg:

function! sy#repo#get_diff_hg(path) abort
  if executable('hg')
    let diff = system('hg diff --nodates -U0 -- '. sy#util#escape(a:path))
    return v:shell_error ? '' : diff
  endif
endfunction

No magic at all. It's really just reading the stdout of one external command. (The -U0 option is important in this case, so all diffs look the same for all VCS.)

from vim-signify.

ssteinbach avatar ssteinbach commented on June 4, 2024

So perforce uses external diff tools, but you can set it via the P4DIFF variable. So you could do:
env P4DIFF=diff p4 diff -du
To generate the unified diff…

So I think that would look like:

function! sy#repo#get_diff_perforce(path) abort
if executable('perforce')
let diff = system('env P4DIFF=diff p4 diff -du '. sy#util#escape(a:path))
return v:shell_error ? '' : diff
endif
endfunction

Thanks! Does that help?

On Jul 29, 2013, at 9:39 AM, Marco Hinz [email protected] wrote:

So.. I just downloaded the p4 commandline client, but it obviously needs a "valid Perforce server network address 'P4PORT' for most operations". Let's see if I can set that up.

Basically one just need to figure out how to get a unified diff from the VCS. Afterwars I'd just add a function "sy#repo#get_diff_perforce()" and extend the internal list in "sy#repo#detect()" by 'perforce'.

Example for hg:

function! sy#repo#get_diff_hg(path) abort
if executable('hg')
let diff = system('hg diff --nodates -U0 -- '. sy#util#escape(a:path))
return v:shell_error ? '' : diff
endif
endfunction

Reply to this email directly or view it on GitHub.

from vim-signify.

mhinz avatar mhinz commented on June 4, 2024

Okay, so when -d is used to provide options to diff(1), then it should be -dU0. Otherwise it looks good to me.

EDIT:

git fetch && git checkout perforce-support

Does this work as intended?

from vim-signify.

ssteinbach avatar ssteinbach commented on June 4, 2024

yup, looks great! Thanks!

from vim-signify.

mhinz avatar mhinz commented on June 4, 2024

Okay, this was easy. :-)

I'll merge it into master then. Thanks for the feedback!

BTW, make sure to set g:signify_vcs_list to only those VCS you really use.

from vim-signify.

ssteinbach avatar ssteinbach commented on June 4, 2024

Awesome, thanks for the quick response!

I just set that up today actually. Very nice!

Another thing you might consider is integration with vim-airline, but that is an issue for another thread :-).

Again - great work and thanks for the plugin!

On Jul 29, 2013, at 4:11 PM, Marco Hinz [email protected] wrote:

Okay, this was easy. :-)

Awesome, I'll merge it into master then. Thanks for the feedback!

BTW, make sure to set g:signify_vcs_list to only those VCS you really use.


Reply to this email directly or view it on GitHub.

from vim-signify.

mhinz avatar mhinz commented on June 4, 2024

I'm glad you like it!

Out of curiousity: do you mean a function that can be included in the statusline? (re: airline integration)

from vim-signify.

ssteinbach avatar ssteinbach commented on June 4, 2024

Yeah, exactly. Something simple like # of lines changed? Or even that a file differs from the repo.

On Jul 29, 2013, at 4:32 PM, Marco Hinz [email protected] wrote:

I'm glad you like it!

Out of curiousity: do you mean a function that can be included in a statusline? (re: airline integration)


Reply to this email directly or view it on GitHub.

from vim-signify.

mhinz avatar mhinz commented on June 4, 2024

Actually I'm playing around with something similar at the moment. autoload/sy/repo.vim already contains sy#repo#get_stat_git() which populates the quickfix list of all changed files (plus number of added/deleted lines) in the repo. Because of this you could easily navigate between changed files via :cn/:cp (which I have mapped to the left/right arrow keys) etc.

from vim-signify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.