zielu / GitToolBox

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

[Feature] Squashed Commit shall be ignored after switching branch? #402

Closed stefango closed 2 years ago

stefango commented 2 years ago

Hi. I create my MR with squash commit option checked on Gitlab. Commit A (the first commit in this MR) and B are combined into commit A. When I switch into develop branch, commit B will still show inline until restart my Webstorm. I am wondering that is it just designed like this.

zielu commented 2 years ago

Hi @stefango digging deeper into this. My thoughts on scenario and some questions:

  1. have a feature branch with commit A & B
  2. merge it into develop with squash - question does it also create merge commit or does develop only have squashed commit ? Could you compare commit hashes for A before and after it is merged ? afaik commit in develop should have the same message as A but hash should be different
  3. after switching to develop could you also check Git tool window ? which commit (hash) does it have on develop ?

This looks like there might be smth wrong with refreshing inline blame. I'll review the code but that mechanism is triggered when commit hash changes when switching branches / pulling

stefango commented 2 years ago

@zielu Thx for response. My reply is as below:

  1. Yep. Merge feat branch into develop branch.
  2. MR Page shows that 'The changes were merged into develop HASH_C' and my commits are commit A (HASH_A) & B (HASH_B). That's to say, commit hashes for A before and after it is merged are different.
  3. Git tool window means the git log tab in Webstorm? If so, the commit hash on develop is HASH_C.

I also think there might be smth wrong with refreshing inline blame.

zielu commented 2 years ago

@stefango could you check one more thing ? Does invoking action under Git > GitToolBox > Refresh Blame fix things ? You could also try moving caret to different line and back.

I see two reasons why old data might be shown:

stefango commented 2 years ago

@zielu Sorry for the late response. I think update develop (the target branch) branch before switching branches is a must. I don't reproduce this issue any more by doing this. Thx.

zielu commented 2 years ago

Ok, I get it now - there was no update done. Plugin does not do any such modifications by design, only thing it does is fetching which is safe as it does not modify the workspace in any way.