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

Gogs chooses the wrong README sometimes #877

Open
jiphex opened this issue Jan 28, 2015 · 7 comments
Open

Gogs chooses the wrong README sometimes #877

jiphex opened this issue Jan 28, 2015 · 7 comments
Labels
💊 bug Something isn't working

Comments

@jiphex
Copy link

jiphex commented Jan 28, 2015

If I have a repo with a file named (for example) README-stuff.md as well as README.md, Gogs will choose to display the former instead of the latter which would be expected. This is different from the behaviour of say, Github.

It looks like this is because the check for whether a file is a README just checks if filename[:6] is "README", and the view gives up when it finds the first file.

I've used this for extra documentation about specific aspects of the project, e.g README-Building.md. Github does the right thing here.

@unknwon unknwon added the 💊 bug Something isn't working label Jan 28, 2015
@unknwon
Copy link
Member

unknwon commented Jan 28, 2015

Thanks your feedback!

You're right, Gogs should also check that the 7th character is . as my quick think of solution.

@jiphex
Copy link
Author

jiphex commented Jan 29, 2015

Wouldn't that break repos which just have a file named "README"? (no .md)

@unknwon
Copy link
Member

unknwon commented Jan 29, 2015

Good catch, just check length first, then see if the 7th is . or not.

@unknwon
Copy link
Member

unknwon commented Feb 3, 2015

Hi @jiphex , @jcracknell , I've pushed fix on dev branch and feel free to test on https://try.gogs.io/

@unknwon unknwon added the status: needs feedback Tell me more about it label Feb 3, 2015
@jiphex
Copy link
Author

jiphex commented Feb 3, 2015

Seems OK: https://try.gogs.io/testzz/issue877

@unknwon unknwon closed this as completed in bfce0de Feb 3, 2015
@unknwon
Copy link
Member

unknwon commented Feb 3, 2015

Great!

@unknwon unknwon removed the status: needs feedback Tell me more about it label Feb 3, 2015
ethantkoenig added a commit to ethantkoenig/gogs that referenced this issue Feb 11, 2017
@AdrianVerde
Copy link

AdrianVerde commented Dec 17, 2019

It still chooses the wrong README as in the case of this mirror
https://try.gogs.io/AdrianVerde/PHP
Where it prefers README.REDIST.BINS instead of README.md

@unknwon unknwon reopened this Dec 18, 2019
@unknwon unknwon added this to the 0.12 milestone Dec 18, 2019
@unknwon unknwon added this to To do in 0.12 Jan 28, 2020
@unknwon unknwon modified the milestones: 0.12, Triaging priority Mar 17, 2020
@unknwon unknwon removed this from To do in 0.12 Mar 17, 2020
@unknwon unknwon removed this from the Triaging priority milestone Mar 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💊 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants