Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| gitworkflow [2015/04/22 22:17] – CraigRodrigues | gitworkflow [2021/12/14 20:46] (current) – Since this is the top Google result, Give users half a chance of finding the official git repo and 'git clone' URI. DavidOBrien | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | The official %%FreeBSD%% Git repo is now at https:// | ||
| + | |||
| + | Clone TL;DR: | ||
| + | (public-mirror) | ||
| + | https:// | ||
| + | ssh: | ||
| + | (developers-only) | ||
| + | ssh: | ||
| + | |||
| + | The content of this page needs to be updated, please refer to the latest doc from git migration WG at https:// | ||
| + | |||
| + | Update: 2020-12-14: These are not the repositories for the 2020/2021 svn to git conversion, please see the note above. The below is mostly historic information and will soon be entirely obsolete. | ||
| + | |||
| ====== Introduction ====== | ====== Introduction ====== | ||
| - | There are a couple of %%FreeBSD%% git repositories that have been converted with | + | This page used to describe |
| - | various programs and various parameters. | + | |
| - | git-branches | + | |
| base other work on. | base other work on. | ||
| - | The repositories | + | The repositories |
| - | src, doc and, ports repositories at http://svn.FreeBSD.org/base, http://svn.FreeBSD.org/ | + | |
| - | Using git to commit changes to | + | |
| - | these repositories | + | |
| - | a collaboration point by using additional tools like Github, Gitorious, or | + | |
| - | Gerrit, etc. | + | |
| - | Bear in mind that git will not replace | + | Bear in mind that git does not replace use of Subversion |
| - | repository is only offered on a best-effort basis. The steps to redo the | + | repository is currently |
| - | conversion are outlined below, so that people can move the process in-house | + | |
| - | should they see the need for it. | + | |
| - | CAVEAT EMPTOR: It is possible | + | CAVEAT EMPTOR: It is possible that the repositories might need to be re-done due to bugs in the converter. |
| This would result in changed commit IDs for the impacted branches. | This would result in changed commit IDs for the impacted branches. | ||
| As the actual tree objects for a certain SVN revision will remain identical, it will always be possible to rebase or merge your work on these new branches and not run into any merge conflicts. | As the actual tree objects for a certain SVN revision will remain identical, it will always be possible to rebase or merge your work on these new branches and not run into any merge conflicts. | ||
| Advance notice will be provided if this proves necessary, along with advice on the required git commands. | Advance notice will be provided if this proves necessary, along with advice on the required git commands. | ||
| - | ====== The Repositories ====== | + | In fact, "bad SVN metadata" |
| - | The beta repository-mirrors are updated at least hourly, should they lag the svn repository by more than a day, please contact %%< | + | ====== Repositories ====== |
| - | * **[[https://github.com/ | + | The repository mirrors are updated at least hourly. Should they lag the SVN repository by more than a day, please create a [[https://bugs.freebsd.org/bugzilla/enter_bug.cgi? |
| - | * **[[https://github.com/ | + | |
| - | * **[[https:// | + | |
| - | * git: | + | |
| - | * git: | + | |
| - | * git: | + | |
| - | ====== Known Problems ====== | + | As of 2020-12-14, canonical repository of doc has been migrate to git: |
| - | * SVN merges for single revisions | + | * https:// |
| + | * '' | ||
| + | * anongit@git.%%FreeBSD%%.org: | ||
| + | * git@gitrepo.%%FreeBSD%%.org: | ||
| + | |||
| + | ports: | ||
| + | * **[[https:// | ||
| + | * https://cgit-beta.freebsd.org/ | ||
| + | * '' | ||
| + | |||
| + | src: | ||
| + | * **[[https:// | ||
| + | * https://cgit-beta.freebsd.org/src/ (the canonical sources, web repository browser) | ||
| + | * '' | ||
| ====== Quick Start ====== | ====== Quick Start ====== | ||
| + | |||
| + | * Fork your own copy of https:// | ||
| + | * Keep your fork in sync: [[https:// | ||
| < | < | ||
| - | $ git clone --config remote.origin.fetch=' | + | $ git clone --config remote.origin.fetch=' |
| $ cd freebsd && git pull # For some reason, the notes will not be fetched during the clone operation ... | $ cd freebsd && git pull # For some reason, the notes will not be fetched during the clone operation ... | ||
| - | $ hack, hack, hack | + | (hack, hack, hack) |
| $ git commit | $ git commit | ||
| </ | </ | ||
| Line 55: | Line 70: | ||
| See any other git howto or documentation if you're stuck on the basics. | See any other git howto or documentation if you're stuck on the basics. | ||
| - | A useful reference for the issue with notes is http:// | + | A useful reference for the issue with notes is [[https:// |
| ===== Adding SVN Revision Notes to an Existing Clone ===== | ===== Adding SVN Revision Notes to an Existing Clone ===== | ||
| Line 75: | Line 90: | ||
| ====== Integration ====== | ====== Integration ====== | ||
| - | ===== Using git-svn (FreeBSD committers only) ===== | ||
| - | If you install the [[http:// | + | ===== Using git-svn |
| - | you can use [[http:// | + | |
| - | from a git tree. | + | |
| - | < | + | [[GitWorkflow/ |
| - | # for ports committers: | + | ===== Merging pull requests from GitHub using git-svn |
| - | $ GIT_REPO=git:// | + | |
| - | $ GIT_SVN_URI=svn.freebsd.org/ | + | |
| - | # for source | + | Note: This only applies to, and works for committers |
| - | $ GIT_REPO=git:// | + | |
| - | $ GIT_SVN_URI=svn.freebsd.org/ | + | |
| - | # do the cloning | + | [[GitWorkflow/ |
| - | $ git clone $GIT_REPO freebsd | + | |
| - | $ cd freebsd | + | |
| - | # init git-svn to point to the subversion repo: | + | ====== FAQ ====== |
| - | $ git svn init -Thead svn+ssh:// | + | |
| - | # Now you' | + | * I want authornames! Use the .gitauthors file in the root of the ports tree. |
| - | # it has a config section that looks like this: | + | * Why the full history |
| - | # | + | |
| - | # url = svn+ssh:// | + | |
| - | # fetch = head: | + | |
| - | # | + | |
| - | # People w/o write access to SVN can use this instead: | + | |
| - | # $ git svn init -Thead --rewrite-root=svn+ssh:// | + | |
| - | # Now what we have to do is get ' | + | Everything done is so that everybody can verify the integrity of the conversion using the tools mentioned in this article. Hence the focus on repeat-ability of the process. |
| - | # Now make a git branch ' | + | ====== Known Problems ====== |
| - | $ git update-ref refs/ | + | |
| - | # Sync with the FreeBSD svn repo and reconstruct the necessary metadata. | + | * SVN merges for single revisions (that span only parts of the tree then), are not really representable as merges in git and instead are called cherry-picks there. The converter tries to be smart about whole tree merges however -- this heuristic is only activated for the head/, user/, |
| - | # This should | + | |
| - | $ git svn fetch | + | |
| - | # Arrange to have ' | + | ===== September 2019 notes/ |
| - | $ git checkout trunk; git branch -D master # delete master | + | |
| - | $ git checkout -b master trunk # and have master hang off trunk | + | |
| - | # Get pull requests from the repos: | + | Sometime around September 2019, refs/notes/commits was force-pushed, |
| - | $ git config --add remote.origin.fetch '+refs/pull/*: | + | |
| - | $ git fetch | + | |
| - | + | ||
| - | # Finally do a final update from head. | + | |
| - | $ git svn rebase | + | |
| - | </ | + | |
| - | + | ||
| - | Now you can periodically sync to svn using '' | + | |
| - | + | ||
| - | Things to keep in mind: | + | |
| - | + | ||
| - | * Never '' | + | |
| - | * Always '' | + | |
| - | * Always double-check with '' | + | |
| - | * While you can use '' | + | |
| - | * While '' | + | |
| - | + | ||
| - | ===== Merging pull requests from github using git-svn (FreeBSD committers only) ===== | + | |
| < | < | ||
| - | + | $ git fetch -f < | |
| - | # | + | |
| - | # Begin single port submit via pull request: | + | |
| - | # | + | |
| - | + | ||
| - | # Get most up to date version of everything from github (all the new pull requests) | + | |
| - | $ git fetch | + | |
| - | + | ||
| - | # Make sure you local copy is up to date | + | |
| - | $ git svn rebase | + | |
| - | + | ||
| - | # Now get the user's change onto the git-svn branch: | + | |
| - | # ...an editor will pop up right after you run this command, see the next section for what to do. | + | |
| - | $ git rebase -i --onto master origin/master origin/pull/ | + | |
| - | + | ||
| - | # Inside the editor you'll want to " | + | |
| - | # If there is only a SINGLE " | + | |
| - | # " | + | |
| - | # then just save+quit out of your editor. | + | |
| - | # | + | |
| - | # However if there are multiple " | + | |
| - | # | + | |
| - | # Example, if you see this: | + | |
| - | # | + | |
| - | # pick 251f162 Try to fix @sample usage. | + | |
| - | # pick 6c96c06 using VAR as both OPTION and PLIST_SUB doesn' | + | |
| - | # pick c259e63 Use auto PLIST_SUB stuff. | + | |
| - | # | + | |
| - | # Change it to this: | + | |
| - | # | + | |
| - | # pick 251f162 Try to fix @sample usage. | + | |
| - | # s 6c96c06 using VAR as both OPTION and PLIST_SUB doesn' | + | |
| - | # s c259e63 Use auto PLIST_SUB stuff. | + | |
| - | # | + | |
| - | # Save+quit the editor, then another editor will pop up for you to combine the commit messages. | + | |
| - | # Then cleanup the commit message and save+quit. | + | |
| - | # | + | |
| - | + | ||
| - | # Now you are ready for commit... almost, you must add freebsd properties. | + | |
| - | # | + | |
| - | # Now add FreeBSD required properties. | + | |
| - | # | + | |
| - | # XXX: at this point you'll need to add svn properties to the files, I have proposed modification to the | + | |
| - | # freebsd port for git that supports this propset. | + | |
| - | # | + | |
| - | # this only works if you have git port compiled with these patches: | + | |
| - | # https:// | + | |
| - | # $ git svn propset REQUIRED_PROPNAME REQUIRED_PROPVAL files... | + | |
| - | # | + | |
| - | # Probably something like: | + | |
| - | $ git svn propset svn: | + | |
| - | $ git svn propset fbsd: | + | |
| - | $ git svn propset fbsd: | + | |
| - | + | ||
| - | # make sure the commits look OK: | + | |
| - | $ git svn dcommit -n | + | |
| - | + | ||
| - | # Show the actual diff. | + | |
| - | $ git diff `git svn dcommit -n | grep ' | + | |
| - | + | ||
| - | # actually commit it... | + | |
| - | $ git svn dcommit | + | |
| </ | </ | ||
| - | ==== Experimental git-svn bootstrap ==== | + | Where '' |
| - | + | ||
| - | There is an experimental git-svn bootstrap for quickly getting a complete git-svn enabled repository | + | |
| - | + | ||
| - | Visit https:// | + | |
| - | + | ||
| - | ====== FAQ ====== | + | |
| - | + | ||
| - | * I want authornames! Good for you, and this has been done but abandoned again for various reasons: There's no authoritative, complete and //stable// mapping of svn users to " | + | |
| - | * Why the full history and not only since day X It would make the history incompatible with other people's repository and the space savings are simply not worth the hassle. As of Oct/2012, all revisions make up about 933MB. | + | |
| - | + | ||
| - | Everything done is so that everybody can verify the integrity | + | |
| ====== Verification ====== | ====== Verification ====== | ||
| Line 227: | Line 131: | ||
| ... | ... | ||
| Exported revision 243246. | Exported revision 243246. | ||
| - | $ git clone --config remote.origin.fetch=' | + | $ git clone --config remote.origin.fetch=' |
| $ cd freebsd.git && git pull | $ cd freebsd.git && git pull | ||
| $ git log | $ git log | ||
| Line 276: | Line 180: | ||
| See the project branch at [[http:// | See the project branch at [[http:// | ||
| + | |||
| + | ---- | ||
| + | |||
| + | {{tag> | ||