gitkraken / vscode-gitlens

Supercharge Git inside VS Code and unlock untapped knowledge within each repository — Visualize code authorship at a glance via Git blame annotations and CodeLens, seamlessly navigate and explore Git repositories, gain valuable insights via rich visualizations and powerful comparison commands, and so much more
http://gitkraken.com/gitlens
Other
9.03k stars 1.35k forks source link

Compare against permanently #747

Closed jpan127 closed 5 years ago

jpan127 commented 5 years ago

Hi, I have been using Gitlens for a few weeks now and it is better than anything I have used before. There is one functionality that is either missing, or I just can't find it.

I see there is a way to set the branch / reference to compare against, and a diff view will pop up showing pretty diffs.

However, what I would like to see is to set a reference to compare against, then for everything thereafter compare against that. For example, the gutter, current line blame, hovers, everything. I am not looking for a diff view, I am looking for permanent diffing against my origin/master, so while I am adding new commits to my branch, I can see the cumulative diffs against origin/master.

Is there such a feature? Thanks!

eamodio commented 5 years ago

@jpan127 I'm not sure I understand what you are asking for with regards to the current line blame, hovers, etc. Those are always a snapshot of the current state of the file to its previous point in history (regardless of branch). Can you elaborate on what you would actually want to see?

As for the direct compare, I am adding a new feature that is coming soon: https://github.com/eamodio/vscode-gitlens/issues/293 which I think will address some of what you are asking for.

jpan127 commented 5 years ago

Hi, yea happy to elaborate. I believe by default, all diff features diff against HEAD, which I believe is what you are saying too. I would like to not diff against HEAD. I want to diff against origin/master.

Let's say origin/master has some file version.txt.

# version.txt
1.0.0

I branch off to release.

# version.txt
1.0.0

I modify this file. The diff shows this line has changed.

# version.txt
1.0.1

I commit this in my release branch so this branch is 1 commit ahead of origin/master. Now the diff is gone (gutter, heatmap). The diff is gone because my current working state is equal to HEAD. But I am not interested in that, I am interested in what is different between my working state and origin/master.

jpan127 commented 5 years ago

Hi, bumping this again 😄

eamodio commented 5 years ago

@jpan127 There are a few pieces to this (as far as I understand).

  1. A desired way to compare the current branch to another branch -- this is available today with #293.
  2. Showing change gutters like vscode does before a file is stages -- currently GitLens has no ability to provide this (as vscode doesn't provide any apis to create those type of gutters)
  3. Having the blame/heatmap/current line blame/etc use a base branch -- this one I don't understand. Git blame (which underpins those GitLens features) doesn't really have anything to do with a base branch

I think you are mostly asking for # 2 here which unfortunately isn't possible today.

Let me know if this makes sense.

jpan127 commented 5 years ago

Thanks for the response. To clarify on your #2, which I believe is what I want.

I think I may have been confused. It seems like the gutters are from VS code and not from gitlens? I installed gitlens the moment I installed VS code so that probably contributed to my confusion.

I guess ultimately I wanted the gutters to diff against origin/master and if gitlens doesn't control that, I'm sorry and I will close this ticket 😅 .

eamodio commented 5 years ago

@jpan127 Yeah, GitLens can't control the gutters currently.

github-actions[bot] commented 3 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.