Coder Social home page Coder Social logo

gitv's People

Contributors

adamreeve avatar aleksandrs-ledovskis avatar alterdepp avatar aschrab avatar ashcatch avatar blueyed avatar derekschrock avatar dsummersl avatar gregsexton avatar grota avatar idbrii avatar juhasz avatar lgauthie avatar orip avatar ornicar avatar rbong avatar rsrchboy avatar sankhesh avatar zyx-i avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gitv's Issues

need vertical split on range browser

I can’t find a way to make the range browser (as described in http://www.gregsexton.org/2011/05/gitv-range/) do a vert split.

I have a terminal that is much wider than it is tall, and some of the functions I wanted to really test/play with this feature on require as much vert space as possible.

I realise a horizontal split is better if you anticipate opening up a diff view on that file later, so that is certainly a good default but it would be nice to be able to override that.

Thanks...

Buffer list cluttered

Awesome plugin, congrats!
There is a point of detail that unfortunately prevents me from using it in my daily workfow.
The browser mode opens a lot of buffers, and do not close them. I use buffers a lot more than tabs to navigate in my open files, using lusty juggler by tpope. So having the buffer list cluttered with git revisions buffer is a real pain.
Not sure if this can be fixed, and how. Is it possible to destroy automatically git buffers?

Load More puts original commit list on the clipboard

I'm using this with MacVim in a terminal on the Mac.

To reproduce:

  1. Copy something to the clipboard.
  2. Start Gitv.
  3. Go to TextEdit and paste. The original clipboard contents are there.
  4. Go to the end of the Gitv buffer where -- Load More -- is.
  5. Press <CR>
  6. Go to TextEdit and paste. The contents of the Gitv commit list are pasted.

It seems to be related to my having set clipboard=unnamed to share the unnamed register with the clipboard on MacOS. But I can't figure out what in the code is doing it.

Can you help?

Thanks.

Oh, and thanks for a cool plugin. I'm just getting started, but this looks very handy.

<CR> in Gitv doesn't work

When I open a file from a git repository, eg. Ge ^ works as expected.

But if I get a new buffer with Gitv, pressing <CR> on a line says

 E492: Not an editor command Gedit ad61e12

Please see tpope/vim-fugitive#142 for more details.

merging-to-current enhancement

I've got a remote branch that I want to merge (1 commit, ff possible).

After choosing the two lines and pressing 'm' I get asked 3 questions.
This is especially bothersome if one of the points has a few branches defined on it - then I have to read the list at the bottom, find the one I want, and get the correct ID; in about 10 tests I've err'ed at least 3 times (mixed start and end point, choose wrong branch).

How about optimizing for the trivial case (merging onto the current branch), and allow some hotkey to try a merge without asking that much?
Sadly both "M" and "m" are used for normal mode, although I think "m" could be reused -- or at least switch to that if only part of a single line is marked visually.

Ie. I'm standing on a (syntax colored) branchname "remote/branch" - pressing "m" (or, alternatively, visually marking that branch name and then pressing "m") should just call "git merge " and be done.

Thanks a lot,

Phil

can't run gitv from the shell prompt

When I run vim -c Gitv (from inside a directory with a .git/, of course), it gives an error Not a git repository.

If I run vim, then :Gitv<CR>, it works.

(I'd like to alias gitv='vim -c Gitv' to run it directly from the bash prompt, maybe as a substitute to tig.)

Gitv remaps "redraw": Ctrl-L

<C-l> is a vim command to redraw the screen. I often need to make vim redraw after doing some commands (especially ones that cause several lines of output). I think this used to be a problem for gitv, but it looks like it's not any more.

(I also use nnoremap <silent> <C-l> :nohl<CR><C-l> to clear highlighting.)

Can the Ctrl-L remapping be optional (either using <unique> or with a disable variable)?

I'd suggest mapping Ctrl-L for update instead (like netrw).

Ability to turn off specific keybinds

Hi. I'm not sure if this request is appropriate and/or vim already supplies the means for this but; I'm using these maps:

map <C-h> <C-w>h
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>l

and that conflicts in meaning inside Gitv. I'd like to continue to use my maps. Is this possible?

C-CR should open diff folds?

Hello Greg,

here's a small patch that makes gitv no longer assume that all diff paths start with "a/" or "b/" (diff.noprefix=true).

Furthermore I would have thought that C-CR should open the diff folds by default - is that correct?
I see no difference between C-CR and CR from the commit list view, using a current git checkout and vim 7.3.429.

diff --git plugin/fugitive.vim plugin/fugitive.vim
index 041c8be..a9f68f0 100644
--- plugin/fugitive.vim
+++ plugin/fugitive.vim
@@ -2413,8 +2416,8 @@ function! fugitive#foldtext() abort
let [add, remove] = [-1, -1]
let filename = ''
for lnum in range(v:foldstart, v:foldend)

  •  if filename ==# '' && getline(lnum) =~# '^[+-]{3} [ab]/'
    
  •    let filename = getline(lnum)[6:-1]
    
  •  if filename ==# '' && getline(lnum) =~# '^[+-]{3} '
    
  •    let filename = getline(lnum)[4:-1]
    
    endif
    if getline(lnum) =~# '^+'
    let add += 1

Thank you.

question: What's the difference between <Enter> and <C-Enter> in gitv ?

If you find a commit that you’re interested in and you want to view it in more detail you can press ctrl-enter. This will show you the full header of the commit including any extended message. It will also show you a diff so that you can easily view the other changes that this commit made, helping to put things in perspective.

The upper words is from: http://www.gregsexton.org/2011/05/gitv-range/.
I try to press <C-Enter> on a commit in file mode. but no difference with <Enter>...

D (Gdiff) arguments error

Hi, I'm unable to launch a diff with shortcut D. Here is the error:

Error detected while processing BufReadCmd Auto commands for "fugitive://**//[0-9a-f][0-9a-f]*":
fugitive: rev-parse aebbbd335eeb2f753b1650180bd31349c4208209:plugin/gitv-1: fatal: Needed a single revision 

Anyway, thank you for your hard work.

6aa36f79 doesn't work with old Vims

When executing :Gitv with for example Vim 7.2.330 (from Ubuntu 10.04.3 LTS), this happens:

Error detected while processing function <SNR>14_OpenGitv..<SNR>14_OpenBrowserMode..<SNR>14_LoadGitv..<SNR>14_ConstructAndExecuteCmd..Gitv_OpenGitCommand:
line   54:
E518: Unknown option: norelativenumber
Press ENTER or type command to continue

Setting HEAD to cdccf20 (tag: v1.1) makes it work again.

feature request: return from diff to overview

One feature that I am really missing is to return from a file diff to the diff overview:

  1. :Gitv
  2. Select a commit with
  3. Switch to the new buffer and select a file(fold) with
  4. Look at changes ..

What I am missing is a quick way back from 4) to 2). Its the most common use case for me when I am reviewing code: I want to look at all changes in all files .. Should probably not be too hard ?

Cannot close last tab page

I'm using the bash alias gitv='vim .git/index -c "Gitv --all" -c "tabonly" to open gitv. But If you try to quit using the q command you will get the following error:

Error detected while processing function <SNR>40_CloseGitv:
line 8:
E784: Cannot close last tab page

:Gitv <Ctrl-R>% depends on getcwd()

Doing :Gitv <Ctrl-R>% gives errors about the file not being versioned; I know that :Gitv % works, but perhaps the cwd should be used if a path is specified.

Using :Gitv <path-within-repo> I don't get the correct output, but only

*  Local uncommitted changes, not checked in to index. 
*  Local changes checked in to index but not committed.
fatal: bad flag '--no-color' used after filename

-- Load more --

and the Load more doesn't work.

Are my expectations wrong? !git log <path> works fine ...

Make it a true gitk replacement

Thank you for creating gitv. It's a promising replacement for gitk and tig. However, make it a true replacement for gitk by adding a Git hook, if possible, to open gitv instead of gitk.

Make foldmethod configurable or do not override it

Similar to commit 64619e4 ("Respect the user's foldlevelstart settings"), the user's foldmethod should not get overwritten to "syntax" probably.

It looks like there are two places where this gets done:

./plugin/gitv.vim:        silent setlocal fdm=syntax
./plugin/gitv.vim:        call s:MoveIntoPreviewAndExecute('setlocal fdm=syntax', 0)

This should be made either configurable, or documented how to accomplish this using autocommands (e.g. by matching for "fugitive://" buffers).

"foldmethod=syntax" causes the diff hunks to be closed, while I would like to have them open by default instead.

A way to make the commit column shorter.

It would be great if there was a way to make the first column in the commit browser shorter so that it would be possible to see who is the author of the commit.
Is this possible already?

View file at revison

Gitk has the option to view file at specific revision. This would be awesome to have in vim plugin.

`hlsearch` causes " " to be highlighted in the preview/commit buffer (redraw issue)

When hlsearch is enabled, " " (space) gets highlighted in the preview window during browser mode (after switching to a new commit for example).

It looks like "gitv" does a search for " " somewhere and this gets stuck/remembered in the preview window.

Executing :redraw or moving to the window fixes it.

Also, highlighting of " " pops up during Gitv initialization in the tree window - this appears to be another (although related) issue and should be avoided.

Pressing RETURN Outputs Errors

Pressing return outputs an error before updating the display window. It occurs in both browser mode and single file mode.

Error detected while processing function <SNR>34_OpenGitvCommit..<SNR>34_MoveIntoPreviewAndExecute..<SNR>34_RecordBufferExecAndWipe:
line    7:
E516: No buffers were deleted: bdelete 4

show changes interactively

When doing "git rebase -i" it would be nice to have a vertical split, with one side showing the rebase buffer and the other one the files changed and the diff related to the change the cursor is on.

When moving the cursor in the rebase buffer, the other pane should be updated immediately, without any intervention.

The same could be used for (fugitive's) Gstatus - showing the file diff in the other pane, or for Gitv browse mode - don't require an Enter.

Thank you very much for this very nice plugin!

Window layout broken by '<,'>Gitv!

I'm using a vertically split layout, with two source files open.

Using '<,'>Gitv! to see changes in a range of lines works fine - the window is split, and the top half shows the commits.

But pressing on one of the commits closes the other source window!

Thanks for the nice feature, though!

Browser mode displays the wrong repo for new git submodules

If I try to use browser mode (:Gitv) from a submodule, it displays the parent repo's history. If I use file mode (:Gitv!), it correctly displays the history for the current file. Using :GStatus in the submodule works correctly. I'm using Ubuntu 12.04.

Repro script:

echo Create remote for submodule
mkdir test_remote
cd test_remote
git init
echo first > file
git add file
git ci -m'initial'
cd -

echo Create local
mkdir test_local
cd test_local
git init
echo first > file
git add file
git ci -m'initial'

git submodule add ../test_remote remote
cd remote
echo modify remote >> file
git ci -am'submodule change'
gvim file +Gitv
cd -

The .git file for the submodule is just a text file with the actual location of the .git repo:

$ cat /tmp/tester/test_local/remote/.git 
gitdir: /tmp/tester/test_local/.git/modules/remote

Versions:

$ git --version
git version 1.7.9.5

$ cd ~/.vim/bundle/gitv/ ; git log --oneline -1
582e32b Handle a commit having "[" in the message when yanking the sha.

$ cd ../fugitive ; git log --oneline -1
b0c74e2 Support localized `git status`

Running Gitv! gives me a blank preview-window

When I run Gitv! from a file, a blank preview-window opens called "gitv-* [RO]" (where the * is a number like 1, 2, etc). Does anyone have any ideas about why I am not seeing the file history in this window?

Error when using O map in browser mode

I get this error when pressing O on a commit in browser mode:

Error detected while processing function <SNR>69_OpenGitvCommit..<SNR>69_MoveIntoPreviewAndExecute..<SNR>69_AttemptToCreateAPreviewWindow:
line    5:
No preview window detected.

Aside from that error, the commit is correctly opened in a new tab. I'm not sure why it's trying to use a preview window (or what would be in the preview window).

Using CR opens the commit in the right pane without error. So I guess something with the new tab handling is trying and failing to open a preview window.

can not back to opened file after "D" to diff.

press <Enter> on gitv's --[plugin/vim.vim]-- can back to opened file.
But after I do press D on two commits. then, gitv will give out a diff. but I failed to back to file when I press <Enter> on --[plugin/vim.vim]--.
This is not a big problem. But still hope gitv can solve this.

Options to customize log output?

Is it possible to change the appearance of the log, for example

  • show (shortened) SHA1 to the left of the commit message (instead of far right) or
  • show author/committer immediately after the commit message (without space, unaligned)?

Could this be done with a vim variable (or several variables)?

how to view diff state in file mode ?

I checked out vim help document, and try some keys like S, but shows diff state weird.
I think the diff state in file mode should only current file's diff state.

Suggestions :)

So, I did play a bit with gitv and I have somes questions/suggestions:

  1. Is it possible to create a g:somevar so you can choose wether to open the browser in a new tab or not? do you need it to be in a new tab?
  2. I know you can press enter to naviguate a whole bunch of stuff (tree sha1 shows list of affected files, diff line opens vimdiff mode, etc). Until now to "go back" I use or I go to the browser window and press enter again, is that the intended way?
  3. Can you make it so that when we press enter on a parent sha1, the browser window selection changes to reflect reality?

So far the plugin is great! I realised it pretty much made the extradite plugin useless?!

Anyway, thanks a lot! It's a sweet plugin!
Philippe

filtering by file or directory fails

Issuing :Gitv somedir/ fails with this error:
fatal: bad flag '--no-color' used after filename

I quite frequently filter commits by specific directories or files and it would be nice to see the log with gitv.

Keybinding conflicts

Hi, I'm using <C-l> (along with <C-h>, <C-j>, and <C-k>) to navigate windows in vim. <C-l> is mapped inside the gitv preview window and I cannot come up with a good way to revert it.

Could you perhaps add some configuration where I can disable any bindings I want removed or show me a good way to revert this?

s:fugitive_GitComplete looks out of date

While looking through the source, I stumbled upon s:fugitive_GitComplete. It doesn't sort the output keys. Is this function out of date? There's a comment "These functions are lifted directly from fugitive and modified only to work with gitv." but I can't tell what was modified to make them work with gitv. Are they supposed to be verbatim?

function! s:fugitive_GitComplete(A,L,P) abort "{{{
if !exists('s:exec_path')
    let s:exec_path = s:fugitive_sub(system(g:fugitive_git_executable.' --exec-path'),'\n$','')
endif
let cmds = map(split(glob(s:exec_path.'/git-*'),"\n"),'s:fugitive_sub(v:val[strlen(s:exec_path)+5 : -1],"\\.exe$","")')
if a:L =~ ' [[:alnum:]-]\+ '
    return fugitive#buffer().repo().superglob(a:A)
elseif a:A == ''
    " Fugitive behavior: return sort(cmds+keys(s:repo().aliases()))
    return cmds
else
    " Fugitive behavior: return filter(sort(cmds+keys(s:repo().aliases())),'v:val[0:strlen(a:A)-1] ==# a:A')
    return filter(cmds,'v:val[0 : strlen(a:A)-1] ==# a:A')
endif
endfunction "}}} }}}

question: how to get into "Altering the range" ?

Just like what you said in article http://www.gregsexton.org/2011/05/gitv-range/

This doesn’t always work perfectly. For example, if you choose a function that has recently had it’s arguments changed it won’t match that function for long. Once the arguments change in the start line no more commits will match. This is easily solved by pressing enter on either the start or end regex. Vim will prompt you to alter the line to any regex you like.

But I do now know how to get into this "Altering the range".

Wrap or truncate long commit messages

AWESOME PLUGIN, just what I've been looking for! :Gitv! rules

One suggestion, if there is even one obnoxiously long commit message the buffer is so wide I have to keep hitting $ and ^ to see which names and dates line up with which commits.

An option to wrap or truncate messages would be great. Bonus points for a keystroke to view commit details in case you want to read the whole giant commit message.

Error when use Gitv! file mode on a range.

I visual selected a block of text. and run command:

:`<,`>Gitv!

And press i on a commit message try to show the diff. But get error.

Here is the error in :message

Error detected while processing function <SNR>151_OpenGitvCommit..<SNR>151_MoveIntoPreviewAndExecute..<SNR>151_RecordBufferExecAndWipe:
line    3:
E492: Not an editor command: Gedit 25348c1

And here is the screenshot 1

Release 1.2

Hi @gregsexton

1.1 tag seems to have commits 2 years old.

Perhaps 1.2 could be released so distributions can catch up?

q mapping not working in browser mode

Cool plugin, just found it by checking out Tpope's page. So yeah, a few issues: normal q doesn't work in browser-mode and because the '!' character doesn't expand abbreviations (i thought it did...) and gitv! isn't associated with an abbreviation, vim spits out an error message.
Umm... just tried it again and it worked fine after reloading vim. Still would suggest to create the abbreviation as it wasn't expanding the abr. for some reason.

Will play with it more. Cool stuff.

Cannot search for gitv with lowercase g

Problem is in plugin/gitv.vim:

cabbrev gitv Gitv

This abbreviation is too general and easy to trigger when undesired. It triggers in searches and other commands.

For example, if I'm searching :h gitv for the gitv browser, my search becomes the Gitv browser and has no results. (I use smartcase.)

Or :grep gitv -R . becomes :grep Gitv -R .

This can be avoided with this recipe: Replace a builtin command using cabbrev

Diff results don't strip color correctly

I'm not sure if this is related to fugitive or gitv, but when viewing commits in gitv, the patches do not correctly strip out color or display color:

^[[1mdiff --git a/setup.py b/setup.py^[[m
^[[1mindex c323a41..2de261b 100644^[[m
^[[1m--- a/setup.py^[[m
^[[1m+++ b/setup.py^[[m
^[[36m@@ -31,7 +31,7 @@^[[m ^[[msetup(^[[m

(Obviously, special characters converted to text)

This is on git 1.7.4.1, and the HEAD of master for both vim-fugitive (f112f9b830a8f42375183c9a47965270ae8b3ae4) and gitv (efe9404).

Andrew

Do not fold on first open

Please prevent folding when first displaying gitv. After zo, on each subsequent pressing of RETURN, it no longer folds.

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.