gregsexton / gitv

gitk for Vim.
936 stars 59 forks source link

how to view diff state in file mode ? #29

Closed stardiviner closed 12 years ago

stardiviner commented 12 years ago

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.

gregsexton commented 12 years ago

I see what you're saying, but I think that diffstats are more useful when you can see what has changed in relation to other files in the repository. That's why it shows all files that have changed including the file that you're looking at.

stardiviner commented 12 years ago

=> On [2012-06-02 01:57:30 -0700]: Greg Sexton Said:

I see what you're saying, but I think that diffstats are more useful when you can see what has changed in relation to other files in the repository. That's why it shows all files that have changed including the file that you're looking at. But this should be in browse mode, file mode I think it is diff for only current file. That's the difference between browse mode and file mode.


Reply to this email directly or view it on GitHub: https://github.com/gregsexton/gitv/issues/29#issuecomment-6075958

[ stardiviner ] ^^&^^ {I hate all of you ! Leave me alone} IRC(freenode): stardiviner \ Twitter: @numbchild \ GnuPG Key fingerprint

9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 2433

gregsexton commented 12 years ago

If you're looking at file mode commits, you know that the file has changed. You don't need a diff stat to tell you that. It's only really useful to tell you what else has changed around the file.

stardiviner commented 12 years ago

=> On [2012-06-02 02:11:03 -0700]: Greg Sexton Said:

If you're looking at file mode commits, you know that the file has changed. You don't need a diff stat to tell you that. It's only really useful to tell you what else has changed around the file. I think it is important, for example: a config file. I need to know what changes in every commit of current file. Assume a situation: Open file mode commit view for current MPD config file. When scrolling through commits object window, the diff output of every commit of current one file can show the history of everything changes which happened on this config file. If this feature is not there, use browse mode, then I will see a lot of diff output from one commit, but may not from one file, those mixed diff output will waste user's time to search what on earth changed. I think that why you create the file mode feature, right ? I like file mode very much.


Reply to this email directly or view it on GitHub: https://github.com/gregsexton/gitv/issues/29#issuecomment-6076037

[ stardiviner ] ^^&^^ {I hate all of you ! Leave me alone} IRC(freenode): stardiviner \ Twitter: @numbchild \ GnuPG Key fingerprint

9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 2433

gregsexton commented 12 years ago

I'm a little confused. Are we still talking about diffstats here?

If you want to see the changes to a file, open it in file mode and press D on a commit to see what has changed since then. If you want to compare the file between two commits, select them in visual mode and press D.

stardiviner commented 12 years ago

=> On [2012-06-02 03:47:27 -0700]: Greg Sexton Said:

I'm a little confused. Are we still talking about diffstats here? Sorry, maybe I said a wrong thing at first. I review back, you're right, I mixed them up. Now let me clear my words.

  • the every changes in every commit on current file.
    • so only list out commits relative with current file in "file mode"
    • only show diff in upper commit and happened on current file. So here is a simple UI. ` commit 1 which has changes from current file (because commit 2 does not have changes from current file, so do not display in file mode) commit 3 which has changes from current file ...

      (the changes output,) diff ++--- 3,2 c ... .. print('hi') etc `

If you want to see the changes to a file, open it in file mode and press D on a commit to see what has changed since then. If you want to compare the file between two commits, select them in visual mode and press D. The first D can work. But the second visual select seems can not work.

Bellowing is what I do:

  1. Open file mode with command :Gitv!
  2. Press V to select two continuous commit.
  3. Press D to check out the diff between this two commit. But I found the upper commit is opened in right window, and nothing content in this window. Left is from lower commit, has content. So that this diff is weird.

I suggest you to select commit with <Space> to mark. And let mark can mark on any commits which are not continuous. So that user can do diff one two non-continuous commits, instead of visual two continuous commits.


Reply to this email directly or view it on GitHub: https://github.com/gregsexton/gitv/issues/29#issuecomment-6076541

[ stardiviner ] ^^&^^ {I hate all of you ! Leave me alone} IRC(freenode): stardiviner \ Twitter: @numbchild \ GnuPG Key fingerprint

9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 2433

gregsexton commented 12 years ago

I don't really understand what you're saying.

File mode only displays commits where the current file was modified.

When you select two commits and press D, the newer will open in the right split, the older in the left. Vim will then diff these two files. If you are seeing something 'weird' and not expected maybe you could explain that further? Or a screenshot would be very helpful.

There is no need to mark commits. You can select as many as you like in visual mode, pressing D will then diff the top commit and the bottom in the selected range.

I hope this helps?

stardiviner commented 12 years ago

[1] ERROR: http://ompldr.org/vZTNtaQ here is the screenshot, I execute command :Gitv!, and I do press D on two commits, the right side is empty. This is where it is wrong. [2] ERROR: I execute :Gitv! on current file, then press Enter on a commit object, there is not diff output. here is the screenshot. http://ompldr.org/vZTNtbA here is a screenshot from another plugin "Extradit", http://ompldr.org/vZTNtbw

gregsexton commented 12 years ago

Ok.

1) Are you sure that this is wrong? In this situation it will diff what changed in your vimrc from one commit to the other. In the screenshot it looks like you added a bunch of lines?

gitv isn't doing anything complicated in this scenario and I'm fairly confident it works correctly. I think that if there is a fault it's possibly fugitive or your git repo that's causing the problem. Possibly it just doesn't work as you expect?

2) This is the intended behaviour. When you press enter it opens the file as it was in that commit. If you want to view the diff you have 3 options:

If you're still having problems maybe write down the exact steps you're taking. Screenshots are very helpful.

stardiviner commented 12 years ago

After I do update for plugins, this problem solved. Really thanks for helps.

gregsexton commented 12 years ago

Oh cool. No problems.