Skip to content

Conversation

@thibaultmeyer
Copy link
Contributor

Short commit references now working with a 7 to 40 SHA length' (Issue #3321) and base.ShortSha() function has been modified to uniformize short SHA's representation (length: 7).

}

func ShortSha(sha1 string) string {
if len(sha1) == 40 {
Copy link
Member

@unknwon unknwon Aug 10, 2016

Choose a reason for hiding this comment

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

We can allow 7-char SHA, does not mean we want to show with 7-char in default, please change to if len() > 10, then cut.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have done this to always have uniform short tag on all pages regardless of what users use (7-char, 8-char, ..., 40-char commit SHA).

Ok if you want remove this; I will do needed modifications tonight.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, please do the modification, we still want to show 10-char on the UI. Thought people could just use 7-char in other cases.

@unknwon unknwon added the status: needs feedback Tell me more about it label Aug 10, 2016
@unknwon unknwon removed the status: needs feedback Tell me more about it label Aug 11, 2016
@unknwon
Copy link
Member

unknwon commented Aug 11, 2016

Thanks!

@unknwon unknwon merged commit 7eafe32 into gogs:develop Aug 11, 2016
ethantkoenig added a commit to ethantkoenig/gogs that referenced this pull request Feb 6, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants