zielu / GitToolBox

GitToolBox IntelliJ plugin
GNU General Public License v3.0
604 stars 71 forks source link

[BUG] Inline blame stuck on one commit #463

Closed ThHareau closed 1 year ago

ThHareau commented 1 year ago

Describe the bug Inline blame is showing the same commit for every line.

To Reproduce Steps to reproduce the behavior:

  1. Click on a line
  2. notice a commit
  3. launch a git blame on the same line (git blame, or any other tool)
  4. notice that it's not the same commit

Expected behavior inline blame commit is aligned with the actual commit

Plugin version 500.0.4+213

IDE version RubyMine 2022.3.2 Build #RM-223.8617.48, built on January 24, 2023

Subscription is active until November 24, 2023. Runtime version: 17.0.5+1-b653.25 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Linux 6.1.13-200.fc37.x86_64 GC: G1 Young Generation, G1 Old Generation Memory: 2048M Cores: 8 Registry: debugger.new.tool.window.layout=true documentation.show.toolbar=true ide.experimental.ui=true

Non-Bundled Plugins: fr.gabrielcolson.prisma.prisma-intellij-plugin (1.2.5) PlantUML integration (5.22.0) String Manipulation (9.6.1) org.rust.lang (0.4.189.5234-223) org.toml.lang (223.8214.6) com.toocol.plugin.anisEscapeTooltip (1.0.7) zielu.gittoolbox (500.0.4+213) ru.adelf.idea.dotenv (2022.3)

Current Desktop: GNOME


I don't know if / how I can help you more. I've tried uninstalling the plugin and resinstalling it, it's still the exact same commit. I don't know if there is a cache that I can clean ?

zielu commented 1 year ago

Hi, there is a cache (persistent so it will survive reinstall) - you can clean it like this https://github.com/zielu/GitToolBox/wiki/Manual#cache-invalidation.

Another thing you could do is run from CLI this command git blame --incremental -l -t -w --encoding=UTF-8 <commit from HEAD> <path to file> and share the output.

As last resort persistent cache can be disabled: Help > Find Action > Registry... find zielu.gittoolbox.blame.cache.persistent, disable it and restart.

So what you are seeing is as if entire content of file was added in single commit, correct ?

ThHareau commented 1 year ago

I'm quite in shock actually, the output of git blame is wrong as well. I did not notice because the commit history shows something different, but the output of the git blame you sent is showing the same wrong commit.

It seems it has nothing to do with your plugin, sorry for bothering

zielu commented 1 year ago

On one hand it's good to hear, on the other I feel your pain :). This gave me an idea to add some diagnostic option to dump blame output of command I'm using for easy inspection.

ThHareau commented 1 year ago

Yeah it's a massive project, I don't want to fork it again :D

ThHareau commented 1 year ago

If anyone finds this in the future, I managed to fix my issue.

My issue is that the whole project was assigned to a single commit, and what happened is that I somehow removed my local commit history. to check if it is hapenning, do a git blame and if the commit hash begins with a ^ (which means that it's the first commit in the history). If it isn't, do a git pull --unshallow and then invalidate the cache. It solved it for me :)