Project

General

Profile

Actions

Misc #15843

closed

Make "trunk" a symbolic-ref of "master" on git.ruby-lang.org

Added by k0kubun (Takashi Kokubun) almost 5 years ago. Updated about 4 years ago.


Description

Background

  • We're using trunk branch as a canonical development branch because it has been mirrored to there by git-svn.
  • In a usual git repository, a HEAD branch is master by default. Using trunk instead of master is confusing and causes typo on git operations or typing git-related URLs.
  • We can make an alias branch by using symbolic-ref on git.ruby-lang.org:ruby.git. We can start using master branch without disturbing any trunk usage. Why not use it?

Proposed schedule

  • 2019
    • 5/22: Announce this schedule (done)
    • 5/23: Make master symbolic-ref pointing to trunk on git.ruby-lang.org (done)
    • 5/23~6/30: Ask maintainers of CI (or whatever integrated with the repository) to explicitly use master branch instead of trunk at ruby-core mailing list. (asked)
    • 7/1: Switch HEAD on git.ruby-lang.org from trunk to master, and reverse the symbolic-ref direction (change the default branch of GitHub ruby/ruby to master too) (done)
      • sudo -u git bash -c "cd /var/git/ruby.git && mv refs/heads/trunk refs/heads/master && git symbolic-ref refs/heads/trunk refs/heads/master"
  • 2020
    • 1/1: Drop trunk branch on git.ruby-lang.org
      • sudo -u git bash -c "cd /var/git/ruby.git && rm refs/heads/trunk"

Expected outcome

  • 2019
    • 5/23:
      • git push to trunk branch of git.ruby-lang.org will be reflected to both trunk and master branches of git.ruby-lang.org immediately.
      • git push to master branch of git.ruby-lang.org will also be reflected to both trunk and master branches of git.ruby-lang.org immediately.
      • Both of trunk and master branches on GitHub will be always mirrored.
    • 7/1:
      • git clone checks out master instead of trunk by default.
  • 2020
    • 1/1:
      • trunk branch cannot be git fetched and git pushed anymore.

Related issues 2 (0 open2 closed)

Related to Ruby master - Misc #14632: [ANN] git.ruby-lang.orgClosedhsbt (Hiroshi SHIBATA)Actions
Related to Ruby master - Misc #17828: Deprecate use of master and slaveClosedActions
Actions #1

Updated by k0kubun (Takashi Kokubun) almost 5 years ago

  • Related to Misc #14632: [ANN] git.ruby-lang.org added

Updated by usa (Usaku NAKAMURA) almost 5 years ago

I don't disagree this proposal.
But, I want to know what do you mean in the term "Out of scope (for a short term)".
What is "short" ?

Updated by ko1 (Koichi Sasada) almost 5 years ago

If you change something, pls tell your schedule and we can check the CI system.

Updated by nobu (Nobuyoshi Nakada) almost 5 years ago

I'm negative against the Main part (moving the branch) immediately, which seems a too big change.
Why not making "master" as a symbolic-ref at first?

Updated by k0kubun (Takashi Kokubun) almost 5 years ago

  • Description updated (diff)

If you change something, pls tell your schedule and we can check the CI system.

Sure. I updated the description.
Once I make a symbolic-ref tomorrow, I'll post an email to ruby-core to share the schedule and ask for updating CI system to use master branch.

But, I want to know what do you mean in the term "Out of scope (for a short term)".
What is "short" ?

I included a concrete schedule for all related operations in the new description. Because @mame (Yusuke Endoh) is going to make a big change in ruby-commit-hook check-email.rb in 2020, I'm thinking about making the last operation happen at the similar timing.

I'm negative against the Main part (moving the branch) immediately, which seems a too big change.
Why not making "master" as a symbolic-ref at first?

The new schedule adopted your proposal. "making master as a symbolic-ref at first" will be done tomorrow as the first step.

For "moving the branch", I split the operation to "changing HEAD" and "mv refs/heads/trunk refs/heads/master", and planned to make the former on 2019/7/1 and the latter on 2020/1/1.

Actions #6

Updated by k0kubun (Takashi Kokubun) almost 5 years ago

  • Description updated (diff)
Actions #7

Updated by k0kubun (Takashi Kokubun) almost 5 years ago

  • Description updated (diff)

Updated by k0kubun (Takashi Kokubun) almost 5 years ago

  • Status changed from Open to Assigned
  • Assignee set to k0kubun (Takashi Kokubun)

Updated by duerst (Martin Dürst) almost 5 years ago

Please not only give us a schedule, but tell us exactly (in terms of git commands) what this means for people which are not totally familiar with git. Please do NOT assume that everybody "just knows".

Updated by k0kubun (Takashi Kokubun) almost 5 years ago

  • Description updated (diff)

Sorry for your inconvenience, it was originally written in the ticket but I somehow deleted that in the later edit. I just resurrected the "Expected outcome" section in the original description.

Actions #11

Updated by k0kubun (Takashi Kokubun) almost 5 years ago

  • Description updated (diff)
Actions #12

Updated by k0kubun (Takashi Kokubun) almost 5 years ago

  • Description updated (diff)
Actions #13

Updated by k0kubun (Takashi Kokubun) almost 5 years ago

  • Description updated (diff)

Updated by MSP-Greg (Greg L) almost 5 years ago

Maybe the changes to RUBY_DESCRIPTION (ruby -v) and RUBY_REVISION could be noted somewhere...

Updated by k0kubun (Takashi Kokubun) almost 5 years ago

If you're talking about 5da52d1210625fb00acd573b3f32281b4bde1730 and a205e24747497391390ef7c004293a8a7934dd96, that's not related to this ticket. Please comment on #14632 or in a new ticket instead.

Updated by k0kubun (Takashi Kokubun) over 4 years ago

Log:

k0kubun@svn:/var/git/ruby.git$ pwd
/var/git/ruby.git
k0kubun@svn:/var/git/ruby.git$ cat refs/heads/trunk
c5eb24349a4535948514fe765c3ddb0628d81004
k0kubun@svn:/var/git/ruby.git$ cat refs/heads/master
ref: refs/heads/trunk
k0kubun@svn:/var/git/ruby.git$ sudo -u git bash -c "mv refs/heads/trunk refs/heads/master && git symbolic-ref refs/heads/trunk refs/heads/mast
er"
[sudo] password for k0kubun:
k0kubun@svn:/var/git/ruby.git$ cat refs/heads/master
c5eb24349a4535948514fe765c3ddb0628d81004
k0kubun@svn:/var/git/ruby.git$ cat refs/heads/trunk
ref: refs/heads/master

Updated by k0kubun (Takashi Kokubun) over 4 years ago

Switching "trunk" to "master" in both git.ruby-lang.org/ruby.git and github.com/ruby.git is finished. I'll update some CI configurations and notify some details to you after that.

Updated by k0kubun (Takashi Kokubun) over 4 years ago

  • Status changed from Assigned to Closed

Hi all,

Switching the default branch "trunk" to "master" is successfully completed.
You can continue to git push to trunk, but it's recommended to switch to use master on your local workflow.

For your pull requests on GitHub, if your base revision is newer than 3d1536e61812dab1f4c226eb60356fd238ab6bb8, you'd like to point your PR to master, and trunk otherwise, so that CIs on PR will run correctly.
This applies to your old PRs too. If you rebase your PR against a revision newer than 3d1536e61812dab1f4c226eb60356fd238ab6bb8, that's the time you should switch your PR's merge target from trunk to master.

I'm going to close this ticket now. Though there's still a remaining operation, deleting the trunk branch on Jan 1st, 2020.
From now on, you're encouraged to stop referring to trunk branch at all, while it's supposed to work for about 6 months from now.

Thank you,
k0kubun

Actions #19

Updated by k0kubun (Takashi Kokubun) over 4 years ago

  • Description updated (diff)

Updated by k0kubun (Takashi Kokubun) over 4 years ago

In https://bugs.ruby-lang.org/issues/15843#note-16, I forgot to switch git.ruby-lang.org's HEAD to master (but it actually worked maybe because symbolic-ref is recursively resolved). Anyway, now I did:

k0kubun@svn:/var/git/ruby.git$ cat HEAD
ref: refs/heads/trunk
k0kubun@svn:/var/git/ruby.git$ cat refs/heads/trunk
ref: refs/heads/master
k0kubun@svn:/var/git/ruby.git$ cat refs/heads/master
dbe834ab5ac4f90df5db9fc314b45890726cca3b
k0kubun@svn:/var/git/ruby.git$ sudo -u git bash -c "git symbolic-ref HEAD refs/heads/master"
[sudo] password for k0kubun:
k0kubun@svn:/var/git/ruby.git$ cat HEAD
ref: refs/heads/master
k0kubun@svn:/var/git/ruby.git$ cat refs/heads/trunk
ref: refs/heads/master
k0kubun@svn:/var/git/ruby.git$ cat refs/heads/master
dbe834ab5ac4f90df5db9fc314b45890726cca3b

Updated by duerst (Martin Dürst) over 4 years ago

For people who haven't yet switched from trunk to master, when you push, you'll get a message saying:

remote: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
remote: @   WARNING: THE TRUNK BRANCH OF RUBY.GIT IS DEPRECATED!  @
remote: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
remote:
remote: You pushed commits to 'trunk' branch, but the branch will be deleted soon.
remote: Please delete your local 'trunk' branch, and use the 'master' branch instead.

Here's an easy way to do this:

Check that you have the remote master branch (remotes/origin/master) with git branch -a. If you don't, use git fetch --all or so to make sure you have it. Then use 'git checkout -b master remotes/origin/master` to create your local master branch.

Updated by jonathanhefner (Jonathan Hefner) over 4 years ago

Related to this change, would it be possible to redirect https://docs.ruby-lang.org/en/trunk/ to https://docs.ruby-lang.org/en/master/ ? There are links in various third-party docs and online articles which still point to https://docs.ruby-lang.org/en/trunk/.

Updated by k0kubun (Takashi Kokubun) over 4 years ago

I don't have a control on docs.ruby-lang.org. Please file another ticket or issue on https://github.com/ruby/docs.ruby-lang.org/issues to get its maintainer's attention.

Updated by k0kubun (Takashi Kokubun) over 4 years ago

Reminder to everyone:

2020 1/1: trunk branch cannot be git fetched and git pushed anymore.

The ruby.git's "trunk" branch will be deleted within 10 days.

Updated by k0kubun (Takashi Kokubun) about 4 years ago

Related to this branch rename from "trunk" to "master", we previously renamed the Redmine project name from "Ruby trunk" to "Ruby master". Today, for consistency I also renamed its internal identifier ruby-trunk to ruby-master which is shown at the Redmine URLs.

For the backward compatibility, I made the following changes:

  • Whatever https://bugs.ruby-lang.org/projects/ruby-trunk/* is redirected to https://bugs.ruby-lang.org/projects/ruby-master/* now
    • Note: With the current implementation, query string is not redirected. However an anchor is redirected and I believe it works in most cases.
    • I left https://bugs.ruby-lang.org/projects/ruby-trunk/* URL references (fixed one place in Wiki though) because we have this redirection.
  • Changed project:ruby-trunk to project:ruby-master in Wiki and tickets.
  • Changed [[ruby-trunk:*]] to [[ruby-master:*]] in Wiki and tickets.

Please let me know if you find any trouble related to this.

Updated by k0kubun (Takashi Kokubun) about 4 years ago

FYI: rvm ruby-head was fixed to use master branch in https://github.com/rvm/rvm/pull/4840 (thanks havenwood!) and therefore Travis ruby-head is also using master branch. I think we have no significant blocker for removing trunk branch anymore. So I'll delete the trunk branch as scheduled.

Actions #27

Updated by k0kubun (Takashi Kokubun) about 4 years ago

Done

k0kubun@svn:/var/git/ruby.git/refs/heads$ cat /var/git/ruby.git/refs/heads/trunk
ref: refs/heads/master
k0kubun@svn:/var/git/ruby.git/refs/heads$ sudo rm /var/git/ruby.git/refs/heads/trunk
$ git push github :trunk
To github.com:ruby/ruby
 - [deleted]               trunk

Updated by mame (Yusuke Endoh) about 4 years ago

JustJosh (Joshua Stowers) wrote:

The "List of maintainers" link is now broken on this page: https://bugs.ruby-lang.org/projects/ruby/wiki/Maintainers

It currently links to: https://github.com/ruby/ruby/blob/trunk/doc/maintainers.rdoc
instead of: https://github.com/ruby/ruby/blob/master/doc/maintainers.rdoc

Fixed, thanks!

Actions #31

Updated by duerst (Martin Dürst) almost 3 years ago

  • Related to Misc #17828: Deprecate use of master and slave added
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0