Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show commits of current branch #293

Closed
borekb opened this issue Feb 22, 2018 · 13 comments
Closed

Show commits of current branch #293

borekb opened this issue Feb 22, 2018 · 13 comments
Assignees
Labels
feature New feature or request

Comments

@borekb
Copy link

borekb commented Feb 22, 2018

Use case: I want to see a list of commits in my current branch, and just those. Both Show Current Branch History and the branch view in the sidebar list all commits reachable from HEAD which is technically correct but I'm often interested only in "my commits".

The Git command that produces the desired output is

git log $(git merge-base master HEAD)..HEAD

(Most commonly, it can be just git log master..HEAD.)

In the UI, I think this could be another top-level node in the sidebar, something like Current branch.

BTW, it could also be useful for content comparison as there are some usability issues with it current, see e.g. "Compare selected ancestor with working tree" needs "select for compare" #279.

So the sidebar could look like this:

- Current branch
    - Diff
       - ... here is a file tree, introduced in #240 ...
    - Commits
       - [avatar] My second commit
       - [avatar] My first commit
- Branches
- Remotes
- Stashes
- Tags
@eamodio
Copy link
Member

eamodio commented Feb 22, 2018

Ah interesting, I think the biggest challenge here, is picking the branch that is the base -- here you are always using master, but that isn't always the case.

@eamodio eamodio added needs-more-info Needs further information, steps, details, etc. feature New feature or request labels Feb 22, 2018
@borekb
Copy link
Author

borekb commented Feb 22, 2018

You're right. git-tree-compare deals with that using Change Base...:

image

@jabacchetta
Copy link

jabacchetta commented Feb 1, 2019

For reference, the "commits behind master" view that Bitbucket gives is helpful, and I believe this feature would essentially be the equivalent.

@eamodio
Copy link
Member

eamodio commented May 16, 2019

@borekb I've added a new experimental new Compare with... node to each repository. It will let you pick the comparison and it persists based on the workspace/repo/branch. You must set "gitlens.insiders": true before it will show up.

gitlens-9.7.4.vsix.zip

Could you try it out and let me know if this will solve this issue for you? Thanks!

@eamodio eamodio self-assigned this May 16, 2019
@eamodio eamodio added this to the Soon™ milestone May 16, 2019
@borekb
Copy link
Author

borekb commented May 16, 2019

Thanks, I like the contents of that node but I'd prefer if this was just directly under the branch. Here's how I see it:

Screenshot 2019-05-16 at 09 06 14

I understand the challenge with the "base branch" but still think this can be a global setting as per #293 (comment).

@eamodio eamodio removed the needs-more-info Needs further information, steps, details, etc. label May 22, 2019
@eamodio
Copy link
Member

eamodio commented May 22, 2019

While I see what you are saying, I find the branch history regularly quite valuable. In 9.8 I've add the new comparison node similar to the above. Hopefully that meets your need closely enough.

@eamodio eamodio closed this as completed May 22, 2019
@eamodio eamodio removed this from the Soon™ milestone Jul 19, 2019
@borekb
Copy link
Author

borekb commented Jul 22, 2019

There seems to be many good changes around this in v9.9:

Screen Recording 2019-07-22 at 15 06 05_05 (1)

The number of commits (12) in case of a two-dot mode is correct, however, the files are not correct: there's not 28 of them but 13 – Git Tree Compare & GitHub Pull Requests extensions show that correctly. Is that a bug or is this feature supposed to work differently?

@Morikko
Copy link

Morikko commented Jul 22, 2019

I just spot the same behavior. It looks like the files changed are always diff with the 2 dot approach.

@eamodio
Copy link
Member

eamodio commented Jul 22, 2019

@borekb @Morikko sorry, that is a bug -- can you pls open a new issue for this?

@borekb
Copy link
Author

borekb commented Jul 22, 2019

👍 , done that in #797.

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants
@borekb @eamodio @Morikko @jabacchetta and others