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

git reflog would benefit from including the branch names on entries #170

Open
corbob opened this issue May 4, 2023 · 2 comments
Open

git reflog would benefit from including the branch names on entries #170

corbob opened this issue May 4, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@corbob
Copy link

corbob commented May 4, 2023

Take the current output of git reflog:

image

Notice that some of the reflog entries show branches that they are on. This would be beneficial to pass through in ugit, both as a property on the reflog entries, as well as formatted to show similar to native git.

image

Note: The coloring shown here is some done by WindTerm, and some by git itself. I think the colors are helpful, but not needed as part of an initial implementation.

@StartAutomating
Copy link
Owner

@corbob this one will be a good bit trickier than the others (surprisingly)

git reflog maps down to

git log -g --abbrev-commit --pretty=oneline

Which comes back with branch information when pretty-printed, but not when assigned to a string.

This will take some more digging.

@StartAutomating StartAutomating added the enhancement New feature or request label May 6, 2023
@ninmonkey
Copy link
Contributor

ninmonkey commented Jun 2, 2023

Which comes back with branch information when pretty-printed, but not when assigned to a string.

That's caused by the implicit --decorate=auto argument. Log.Decorate

Working args

image

$color = @('--color=always', '--decorate=full')
[string[]]$render = git.exe log -g @color --abbrev-commit --pretty=oneline | select -first 10
$render

note: I'm using git.exe so that I don't have to unload ugit.

$color = @('--color=always', '--decorate=full')
git.exe log -g @color --abbrev-commit --pretty=oneline | select -first 10
git.exe reflog @color | select -first 10

reproduction

# full color invoke
git.exe log --color=always --decorate=auto --abbrev-commit --oneline | select -first 10 

# now only partial color, the hash, is preserved
git.exe log --color=always --decorate=auto --abbrev-commit --oneline

image

Select-Object and assigning to string were both triggering the same auto, behavior, so I used both interchangabliy in some cases.

( [string[]]$render = ... ) | select -first 10 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants