Gitea: Feature request - changing default branch name

Created on 30 Dec 2019  路  11Comments  路  Source: go-gitea/gitea

Right now, gitea always defaults to creating a master branch as the default, and the default can be changed per repo with a setting. It would be nice if we could change the default branch name so that new repos would be created with the given name, e.g. if you wanted to use prod instead of master.

kinfeature revieweconfirmed

Most helpful comment

Ok.

Fairly simple thing to do - good first pr.

If you want it quickly stick a bounty on bounty source.

All 11 comments

The first branch you push to an empty repository will become the default.

You're given the option to initialise the repo with a readme and license, which always chooses master.

Ok.

Fairly simple thing to do - good first pr.

If you want it quickly stick a bounty on bounty source.

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

Still would like this.

No it's a go fmt related change. (The Depth: 1 option is used when generating from template repos.)

@zeripath: fun that you did not notice it, i could be wrong. But before the commit it's only use one white-space with the commit two white-spaces are used.

And you say that it is "Depth: 1" and not "Depth:  1" as the code says, that's why i asked if it was a typo or not, but even if the code works it could be a typo i think depending on how you see on it :)

It's a go fmt change.

I don't know what that means, i don't code in go language, i just think it was worth a notice :)

Sorry if bother you...

Instead of looking at the diff take a look at the file:

https://github.com/go-gitea/gitea/blob/cf4f2cfa3ee0e71632df971e154c7b926c39ba80/modules/repository/generate.go#L115-L118

See how the values now align vertically. Look elsewhere in that file and you'll see various other places where there is vertical aligning.

If you add an attribute to a struct initialiser or definition go fmt will align them.

Go is quite opinionated on its formatting - code should and often must be formatted with gofmt.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jorise7 picture jorise7  路  3Comments

haytona picture haytona  路  3Comments

flozz picture flozz  路  3Comments

ghost picture ghost  路  3Comments

jonasfranz picture jonasfranz  路  3Comments