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

Use id column for commit id only #1056

Merged
merged 1 commit into from
Dec 22, 2020
Merged

Conversation

koutcher
Copy link
Collaborator

That way, you can better figure out identical references when browsing
the reflog view. Show the reflog name in the title window instead. In
the stash view, the id column also shows the commit id instead of the
reference.

Closes #1025

@koutcher koutcher force-pushed the gh-1025-id-column branch 2 times, most recently from 6db4fb6 to 710f905 Compare December 13, 2020 11:40
@koutcher koutcher changed the title Use id column for commit id only RFC Use id column for commit id only Dec 13, 2020
@koutcher koutcher force-pushed the gh-1025-id-column branch 2 times, most recently from 8373b8b to e3d4629 Compare December 14, 2020 17:57
@krobelus
Copy link
Contributor

I wonder if it makes sense to color-code the commit ids like in the blame view, so it's even easier to spot identical refereences. Probably a bit too noisy though, since most references are different.

@koutcher
Copy link
Collaborator Author

From the test suite point of view, this PR doesn't break anything... @jonas, I tried to track the origin of this behaviour (i.e. using the id column to display reflog) and went as far as e32cad8 but I can't figure out why it was introduced. Maybe you can remember. It looks it was related to the stash view. Was it a way to show the stash reference when it was not displayed in the title window ?

@koutcher
Copy link
Collaborator Author

koutcher commented Dec 14, 2020

I wonder if it makes sense to color-code the commit ids like in the blame view, so it's even easier to spot identical refereences. Probably a bit too noisy though, since most references are different.

We just need a small change in tigrc: id:yes,color. As it is hash based and the palette is quite small it is not bullet proof but it helps already.

Edit: with only 14 colours in the palette, there are too many collisions and enabling this would trigger too many complaints that successive entries have the same colour.

@koutcher koutcher force-pushed the gh-1025-id-column branch 3 times, most recently from 93e557c to 749b415 Compare December 21, 2020 17:33
@jonas
Copy link
Owner

jonas commented Dec 22, 2020

Yes, the ID colouring was mainly for the blame view and as you say very limited and confusing to use it outside for other views due to collisions. It might make sense to be able to set a specific colour where color=by-id could be the current behavior.

@jonas
Copy link
Owner

jonas commented Dec 22, 2020

@jonas, I tried to track the origin of this behaviour (i.e. using the id column to display reflog) and went as far as e32cad8 but I can't figure out why it was introduced. Maybe you can remember. It looks it was related to the stash view. Was it a way to show the stash reference when it was not displayed in the title window ?

Yes, from what I remember, the idea was to show the @stash{...} but the ID column was later hidden?!? I agree that using the ID column for SHAs only makes sense. A future change could change the reflog view to show the "symbolic name" in the title bar, similar to what we do in the stash view.

if (state->reflogs) {
assert(state->reflogs >= line->lineno);
string_ncopy(view->ref, state->reflog[line->lineno - 1],
strlen(state->reflog[line->lineno - 1]));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 This will show the reflog ID in the title bar.

That way, you can better figure out identical references when browsing
the reflog view. Show the reflog name in the title window instead. In
the stash view, the id column also shows the commit id instead of the
reference.

Closes jonas#1025
@koutcher
Copy link
Collaborator Author

Thanks @jonas.

@koutcher koutcher changed the title RFC Use id column for commit id only Use id column for commit id only Dec 22, 2020
@koutcher koutcher merged commit 4b342f1 into jonas:master Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

field 'id' in reflog-view does not show SHA hash
3 participants