Giter VIP home page Giter VIP logo

Comments (17)

junegunn avatar junegunn commented on August 15, 2024

I've tested it on linux and osx. Haven't tried it on Windows though.

Let's make sure that we are on the same page. The diff, PlugDiff command or D key inside plug window, will only show the updated changes from the last PlugUpdate command. So if you repeat PlugUpdate, the list will eventually become empty.

  1. Try resetting one of your plugin like so: git reset --hard HEAD^^
  2. PlugUpdate [PLUGIN NAME] will update the reverted commits
  3. D key will show you those commits. You can review/rollback the changes there.
  4. PlugUpdate again until the buffer shows Already up-to-date.
  5. D will show nothing

from vim-plug.

justinmk avatar justinmk commented on August 15, 2024

That makes sense. In every case I was updating already-existing repos after having just installed vim-plug. So I assume the next update will show something. I was expecting it to capture the SHA before updating and then show me the relative logs.

from vim-plug.

junegunn avatar junegunn commented on August 15, 2024

No, vim-plug does not keep track of commit hashes and just uses git reflogs to show the changes between the pulls.

git log --pretty=format:"%h %s (%cr)" "HEAD...HEAD@{1}"

The upside is that PlugDiff is immediately available on a new Vim session where you haven't run PlugUpdate. (And the code is much simpler of course.)

from vim-plug.

justinmk avatar justinmk commented on August 15, 2024

Hmm. All the existing repos would have reflogs dating back many months...

from vim-plug.

junegunn avatar junegunn commented on August 15, 2024

Could you check the output of the following commands inside a plugin directory?

git log --pretty=format:"%h %s (%cr)" "HEAD...HEAD@{1}"

git reset --hard HEAD^^
git checkout master
git pull origin master
git log --pretty=format:"%h %s (%cr)" "HEAD...HEAD@{1}"

git checkout master
git pull origin master
git log --pretty=format:"%h %s (%cr)" "HEAD...HEAD@{1}"

from vim-plug.

justinmk avatar justinmk commented on August 15, 2024

Running those commands, the git log output is always empty. Maybe --walk-reflogs is needed?

git version 1.9.4.msysgit.1 (Windows)

Here's the full results from a unite.vim repo:

git log --pretty=format:"%h %s (%cr)" "HEAD...HEAD@{1}"
[no output]

$ git reset --hard HEAD^^
HEAD is now at ecddf02 Merge pull request #720 from fluecke/master
$ git checkout master
Already on 'master'
Your branch is behind 'origin/master' by 2 commits, and can be fast-forwarded.
$ git pull origin master
From https://github.com/Shougo/unite.vim
 * branch            master     -> FETCH_HEAD
First, rewinding head to replay your work on top of it...
Fast-forwarded master to df431e741fd3631c59c000c0ee7021c9efbff7b2.
$ git log --pretty=format:"%h %s (%cr)" "HEAD...HEAD@{1}"
[no output]

$ git checkout master
Already on 'master'
Your branch is up-to-date with 'origin/master'.
$ git pull origin master
From https://github.com/Shougo/unite.vim
 * branch            master     -> FETCH_HEAD
Current branch master is up to date.
$ git log --pretty=format:"%h %s (%cr)" "HEAD...HEAD@{1}"
[ no output]

Here's a snippet from git log --walk-reflogs --boundary --pretty=format:"%ci %h %gd %gs"

2014-09-02 20:12:07 +0900 df431e7 HEAD@{0} checkout: moving from master to master
2014-09-02 20:12:07 +0900 df431e7 HEAD@{1} rebase finished: returning to refs/heads/master
2014-09-02 20:12:07 +0900 df431e7 HEAD@{2} pull origin master: checkout df431e741fd3631c59c000c0ee7021c9efbff7b2
2014-09-02 19:20:01 +0900 ecddf02 HEAD@{3} checkout: moving from master to master
2014-09-02 19:20:01 +0900 ecddf02 HEAD@{4} reset: moving to HEAD^^
2014-09-02 20:12:07 +0900 df431e7 HEAD@{5} rebase finished: returning to refs/heads/master
2014-09-02 20:12:07 +0900 df431e7 HEAD@{6} pull origin master: checkout df431e741fd3631c59c000c0ee7021c9efbff7b2
2014-08-30 00:33:37 +0900 9973e20 HEAD@{7} checkout: moving from master to master
2014-08-30 00:33:37 +0900 9973e20 HEAD@{8} rebase finished: returning to refs/heads/master
2014-08-30 00:33:37 +0900 9973e20 HEAD@{9} pull origin master: checkout 9973e2032923ad0c6077fcaa82ef5ba336ce14ee
2014-08-28 22:30:03 +0900 6324d27 HEAD@{10} checkout: moving from master to master
2014-08-28 22:30:03 +0900 6324d27 HEAD@{11} checkout: moving from master to master
2014-08-28 22:30:03 +0900 6324d27 HEAD@{12} rebase finished: returning to refs/heads/master
2014-08-28 22:30:03 +0900 6324d27 HEAD@{13} pull origin master: checkout 6324d27461d5fc3f3b90a68581ce18a15b6b01a9
2014-08-26 21:12:48 +0900 f28c81e HEAD@{14} checkout: moving from master to master
2014-08-26 21:12:48 +0900 f28c81e HEAD@{15} rebase finished: returning to refs/heads/master
2014-08-26 21:12:48 +0900 f28c81e HEAD@{16} pull: checkout f28c81e0b5a6b99dba171b8715195a43ce4b63bc
2014-08-26 00:14:08 +0900 d738fa2 HEAD@{17} rebase finished: returning to refs/heads/master
2014-08-26 00:14:08 +0900 d738fa2 HEAD@{18} pull: checkout d738fa2f3c7a34493ef56cac24ff1bae453947e8
2014-08-25 22:48:16 +0900 0aa9cee HEAD@{19} rebase finished: returning to refs/heads/master
2014-08-25 22:48:16 +0900 0aa9cee HEAD@{20} pull: checkout 0aa9ceeb704dd5e7029497da393d89cd0f1558d0
2014-08-21 17:09:37 +0900 dbb7461 HEAD@{21} rebase finished: returning to refs/heads/master
2014-08-21 17:09:37 +0900 dbb7461 HEAD@{22} pull: checkout dbb7461f25ec2e8fa05c7265f39c49c4d0c83561
2014-08-15 22:44:24 +0900 6b7b079 HEAD@{23} checkout: moving from master to master
2014-08-15 22:44:24 +0900 6b7b079 HEAD@{24} rebase finished: returning to refs/heads/master
2014-08-15 22:44:24 +0900 6b7b079 HEAD@{25} pull: checkout 6b7b079b2582594f8285ffd07173169aaef2aaa2
2014-08-13 19:54:52 +0900 543d210 HEAD@{26} rebase finished: returning to refs/heads/master
2014-08-13 19:54:52 +0900 543d210 HEAD@{27} pull: checkout 543d210c21a38666649c3fce368336ddc3056ace
2014-08-11 22:26:37 +0900 11443f1 HEAD@{28} rebase finished: returning to refs/heads/master
2014-08-11 22:26:37 +0900 11443f1 HEAD@{29} pull: checkout 11443f1d0565ddff35bf23314c797bbfde06e0f5
2014-08-08 07:51:48 +0900 fb922f0 HEAD@{30} rebase finished: returning to refs/heads/master
2014-08-08 07:51:48 +0900 fb922f0 HEAD@{31} pull: checkout fb922f08c25d0bb43facce30f714bcb0a179c04a

from vim-plug.

justinmk avatar justinmk commented on August 15, 2024
  1. Try resetting one of your plugin like so: git reset --hard HEAD^^
  2. PlugUpdate [PLUGIN NAME] will update the reverted commits
  3. D key will show you those commits. You can review/rollback the changes there.

Step 1 resulted in:

Updated. Elapsed time: 2.972608 sec.
[=]

- Finishing ... Done!
- unite.vim: Fast-forwarded master to df431e741fd3631c59c000c0ee7021c9efbff7b2.

Step 2 still shows "No updates".

from vim-plug.

justinmk avatar justinmk commented on August 15, 2024

Also tried deleting my .gitconfig and .gitexcludes. No effect.

from vim-plug.

junegunn avatar junegunn commented on August 15, 2024

Thanks, interesting. Here's my output:

> git log --pretty=format:"%h %s (%cr)" "HEAD...HEAD@{1}"
> git reset --hard HEAD^^
HEAD is now at ecddf02 Merge pull request #720 from fluecke/master
> git pull origin master
From https://github.com/Shougo/unite.vim
 * branch            master     -> FETCH_HEAD
Updating ecddf02..df431e7
Fast-forward
 autoload/unite.vim            | 3 +++
 autoload/unite/candidates.vim | 1 +
 2 files changed, 4 insertions(+)
> git log --pretty=format:"%h %s (%cr)" "HEAD...HEAD@{1}"
df431e7 Fix #715 quick match candidates position problem (6 hours ago)
e32e00b Fix #717 unite#get_unite_winnr() (6 hours ago)
> git checkout master
Already on 'master'
Your branch is up-to-date with 'origin/master'.
> git pull origin master
From https://github.com/Shougo/unite.vim
 * branch            master     -> FETCH_HEAD
Already up-to-date.
> git log --pretty=format:"%h %s (%cr)" "HEAD...HEAD@{1}"
> git log --walk-reflogs --boundary --pretty=format:"%ci %h %gd %gs"

2014-09-02 20:12:07 +0900 df431e7 HEAD@{0} checkout: moving from master to master
2014-09-02 20:12:07 +0900 df431e7 HEAD@{1} pull origin master: Fast-forward
2014-09-02 19:20:01 +0900 ecddf02 HEAD@{2} reset: moving to HEAD^^
2014-09-02 20:12:07 +0900 df431e7 HEAD@{3} checkout: moving from master to master
2014-09-02 20:12:07 +0900 df431e7 HEAD@{4} pull origin master: Fast-forward
2014-09-02 19:20:01 +0900 ecddf02 HEAD@{5} checkout: moving from master to master
2014-09-02 19:20:01 +0900 ecddf02 HEAD@{6} reset: moving to HEAD^^
2014-09-02 20:12:07 +0900 df431e7 HEAD@{7} clone: from https://github.com/Shougo/unite.vim

The difference is that in your --walk-reflogs, rebase follows pull, which is not found in my log. Do you have any idea about it? It looks like git pull has --rebase=false option, maybe I should add it to the command?

from vim-plug.

justinmk avatar justinmk commented on August 15, 2024

git pull origin master at least will behave differently for users who have set pull.rebase=true in their .gitconfig. Not sure if it matters though.

Also, swapping the order of the git log args and changing the reflog id to 2 shows these results:

$ git log --pretty=format:"%h %s (%cr)" "HEAD@{2}...HEAD"
df431e7 Fix #715 quick match candidates position problem (6 hours ago)
e32e00b Fix #717 unite#get_unite_winnr() (6 hours ago)

from vim-plug.

junegunn avatar junegunn commented on August 15, 2024

Could you try the routine again with --no-rebase option? git pull --no-rebase origin master
I think it will resolve the issue.

from vim-plug.

justinmk avatar justinmk commented on August 15, 2024

It looks like git pull has --rebase=false option, maybe I should add it to the command?

Yes I think so. I must have missed a step somewhere when I removed my .gitconfig.

from vim-plug.

junegunn avatar junegunn commented on August 15, 2024

Hmm, I'm not sure about the difference between --rebase=false and --no-rebase.
--rebase=false seems like a more obvious choice.

from vim-plug.

justinmk avatar justinmk commented on August 15, 2024

Looks like that was the issue.

$ git reset --hard HEAD^^
HEAD is now at ecddf02 Merge pull request #720 from fluecke/master
$ git pull --no-rebase origin master
From https://github.com/Shougo/unite.vim
 * branch            master     -> FETCH_HEAD
Updating ecddf02..df431e7
Fast-forward
 autoload/unite.vim            | 3 +++
 autoload/unite/candidates.vim | 1 +
 2 files changed, 4 insertions(+)
$ git log --pretty=format:"%h %s (%cr)" "HEAD...HEAD@{1}"
df431e7 Fix #715 quick match candidates position problem (6 hours ago)
e32e00b Fix #717 unite#get_unite_winnr() (6 hours ago)

from vim-plug.

junegunn avatar junegunn commented on August 15, 2024

Ah, thanks. I'll add it to the command.
(I realized that only --no-rebase is available on older versions of git, so we should use it instead of --rebase=false)

from vim-plug.

junegunn avatar junegunn commented on August 15, 2024

The code is updated. Let me know if you still see the problem. Thank you for your help!

from vim-plug.

justinmk avatar justinmk commented on August 15, 2024

It's working now, thanks!

from vim-plug.

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.