Skip to content

default branch is random after git push --mirror #3913

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

Closed
1 of 6 tasks
davidlt opened this issue May 7, 2018 · 9 comments
Closed
1 of 6 tasks

default branch is random after git push --mirror #3913

davidlt opened this issue May 7, 2018 · 9 comments
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented issue/regression Indicates a previously functioning feature or behavior that has broken or regressed after a change type/bug

Comments

@davidlt
Copy link

davidlt commented May 7, 2018

  • Gitea version (or commit ref):
    Official 1.4.1 from github
  • Git version:
    git version 2.17.0
  • Operating system:
    Fedora 27 (server) / Fedora 28 (client)
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • [x ] SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

[..]
To https://try.gitea.io/blah/restic.git

  • [new branch] refs/changes/38/232138/1 -> refs/changes/38/232138/1
  • [new branch] refs/changes/39/232139/1 -> refs/changes/39/232139/1
  • [new branch] refs/changes/40/232140/1 -> refs/changes/40/232140/1
  • [new branch] refs/changes/41/232141/1 -> refs/changes/41/232141/1
  • [new branch] refs/changes/42/232142/1 -> refs/changes/42/232142/1
  • [new branch] refs/changes/43/232143/1 -> refs/changes/43/232143/1
  • [new branch] refs/changes/60/231960/1 -> refs/changes/60/231960/1
  • [new branch] refs/changes/61/231961/1 -> refs/changes/61/231961/1
  • [new branch] refs/changes/62/231962/1 -> refs/changes/62/231962/1
  • [new branch] refs/changes/63/231963/1 -> refs/changes/63/231963/1
  • [new branch] refs/changes/64/231964/1 -> refs/changes/64/231964/1
  • [new branch] refs/changes/65/231965/1 -> refs/changes/65/231965/1
  • [new branch] refs/changes/66/231966/1 -> refs/changes/66/231966/1
  • [new branch] refs/changes/67/231967/1 -> refs/changes/67/231967/1
  • [new branch] refs/changes/68/231968/1 -> refs/changes/68/231968/1
  • [new branch] refs/changes/69/231969/1 -> refs/changes/69/231969/1
  • [new branch] refs/changes/70/231970/1 -> refs/changes/70/231970/1
  • [new branch] add-coc -> add-coc
  • [new branch] add-webdav-server -> add-webdav-server
  • [new branch] master -> master
  • [new branch] prune-aggressive -> prune-aggressive
  • [new branch] refs/pull/1002/head -> refs/pull/1002/head
  • [new branch] refs/pull/1003/head -> refs/pull/1003/head
  • [new branch] refs/pull/1004/head -> refs/pull/1004/head
    [..]

Default branch: refs/changes/60/231960/1 (which is not even the first pushed?)
[..]

  • [new branch] refs/changes/60/231960/1 -> refs/changes/60/231960/1
    [..]

So now for each "forked" repo you need to change settings to set default branch to master or whatever else.

This change happened with 1.4.1 (most likely due to #3715 ).

@lafriks lafriks added type/bug issue/regression Indicates a previously functioning feature or behavior that has broken or regressed after a change labels May 7, 2018
@lafriks lafriks added this to the 1.4.2 milestone May 7, 2018
@lafriks lafriks modified the milestones: 1.4.2, 1.4.3 Jun 4, 2018
@davidlt
Copy link
Author

davidlt commented Jun 14, 2018

Any plans to fix it before 1.5.0 hits?

@techknowlogick techknowlogick modified the milestones: 1.4.3, 1.4.4 Jun 26, 2018
@techknowlogick
Copy link
Member

@davidlt This is unlikely be be released in 1.5.0, but perhaps 1.5.1.

The way we could fix this is keep existing logic, but perhaps if we see a "master" branch is there then we assume it is default. That way edge case that was resolved with the linked PR could still be covered, but for everyone else this stays the same.

@davidlt
Copy link
Author

davidlt commented Aug 19, 2018

Maybe this should be moved to 1.5.1 milestone?

@lunny lunny modified the milestones: 1.4.4, 1.5.1 Aug 19, 2018
@daviian
Copy link
Member

daviian commented Aug 21, 2018

Basically the problem's origin is here

for scanner.Scan() {

The first reference with at least one commit will become the default branch, because it is only set for a "bare" repository.
The orderof references depends on the git cmd output.

@daviian daviian self-assigned this Aug 21, 2018
@techknowlogick techknowlogick modified the milestones: 1.5.1, 1.5.2 Sep 2, 2018
@daviian daviian removed their assignment Sep 10, 2018
@techknowlogick techknowlogick modified the milestones: 1.5.2, 1.7.0 Oct 9, 2018
@lafriks lafriks modified the milestones: 1.7.0, 1.8.0 Dec 27, 2018
@techknowlogick techknowlogick modified the milestones: 1.8.0, 1.9.0 Feb 19, 2019
@stale
Copy link

stale bot commented Apr 20, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale stale bot added the issue/stale label Apr 20, 2019
@stale
Copy link

stale bot commented May 4, 2019

This issue has been automatically closed because of inactivity. You can re-open it if needed.

@stale stale bot closed this as completed May 4, 2019
@lafriks lafriks reopened this May 4, 2019
@stale stale bot removed the issue/stale label May 4, 2019
@lafriks lafriks removed this from the 1.9.0 milestone May 4, 2019
@stale
Copy link

stale bot commented Jul 3, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale stale bot added the issue/stale label Jul 3, 2019
@jvstein
Copy link
Contributor

jvstein commented Jul 3, 2019

I saw this issue while migrating data from another git server using git push --mirror.

I tried pushing the default branch first and then using --mirror, but that resulted in extremely poor performance on the mirror command as it added the new branches.

It would be very helpful to be able to update the default branch via the API. I ended up doing it manually, which took a while.

@stale stale bot removed the issue/stale label Jul 3, 2019
@lunny lunny added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label Jul 4, 2019
@zeripath
Copy link
Contributor

I believe this is fixed now. Please reopen if this is still a problem.

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented issue/regression Indicates a previously functioning feature or behavior that has broken or regressed after a change type/bug
Projects
None yet
Development

No branches or pull requests

7 participants