diff --git a/documentation/content/en/articles/bsdl-gpl/_index.adoc b/documentation/content/en/articles/bsdl-gpl/_index.adoc index 6ee939f367..01b9cbebec 100644 --- a/documentation/content/en/articles/bsdl-gpl/_index.adoc +++ b/documentation/content/en/articles/bsdl-gpl/_index.adoc @@ -24,53 +24,102 @@ toc::[] [[intro]] == Introduction -This document makes a case for using a BSD style license for software and data; specifically it recommends using a BSD style license in place of the GPL. It can also be read as a BSD versus GPL Open Source License introduction and summary. +This document makes a case for using a BSD style license for software and data; +specifically it recommends using a BSD style license in place of the GPL. +It can also be read as a BSD versus GPL Open Source License introduction and summary. [[history]] == Very Brief Open Source History -Long before the term "Open Source" was used, software was developed by loose associations of programmers and freely exchanged. Starting in the early 1950's, organizations such as http://www.share.org[SHARE] and http://www.decus.org[DECUS] developed much of the software that computer hardware companies bundled with their hardware offerings. At that time computer companies were in the hardware business; anything that reduced software cost and made more programs available made the hardware companies more competitive. +Long before the term "Open Source" was used, software was developed by loose associations of programmers and freely exchanged. +Starting in the early 1950's, organizations such as http://www.share.org[SHARE] and http://www.decus.org[DECUS] developed much of the software that computer hardware companies bundled with their hardware offerings. +At that time computer companies were in the hardware business; +anything that reduced software cost and made more programs available made the hardware companies more competitive. -This model changed in the 1960's. In 1965 ADR developed the first licensed software product independent of a hardware company. ADR was competing against a free IBM package originally developed by IBM customers. ADR patented their software in 1968. To stop sharing of their program, they provided it under an equipment lease in which payment was spread over the lifetime of the product. ADR thus retained ownership and could control resale and reuse. +This model changed in the 1960's. +In 1965 ADR developed the first licensed software product independent of a hardware company. +ADR was competing against a free IBM package originally developed by IBM customers. +ADR patented their software in 1968. +To stop sharing of their program, they provided it under an equipment lease in which payment was spread over the lifetime of the product. +ADR thus retained ownership and could control resale and reuse. -In 1969 the US Department of Justice charged IBM with destroying businesses by bundling free software with IBM hardware. As a result of this suit, IBM unbundled its software; that is, software became independent products separate from hardware. +In 1969 the US Department of Justice charged IBM with destroying businesses by bundling free software with IBM hardware. +As a result of this suit, IBM unbundled its software; that is, software became independent products separate from hardware. -In 1968 Informatics introduced the first commercial killer-app and rapidly established the concept of the software product, the software company, and very high rates of return. Informatics developed the perpetual license which is now standard throughout the computer industry, wherein ownership is never transferred to the customer. +In 1968 Informatics introduced the first commercial killer-app and rapidly established the concept of the software product, +the software company, and very high rates of return. +Informatics developed the perpetual license which is now standard throughout the computer industry, +wherein ownership is never transferred to the customer. [[unix-license]] == Unix from a BSD Licensing Perspective -AT&T, who owned the original Unix implementation, was a publicly regulated monopoly tied up in anti-trust court; it was legally unable to sell a product into the software market. It was, however, able to provide it to academic institutions for the price of media. +AT&T, who owned the original Unix implementation, +was a publicly regulated monopoly tied up in anti-trust court; +it was legally unable to sell a product into the software market. +It was, however, able to provide it to academic institutions for the price of media. -Universities rapidly adopted Unix after an OS conference publicized its availability. It was extremely helpful that Unix ran on the PDP-11, a very affordable 16-bit computer, and was coded in a high-level language that was demonstrably good for systems programming. The DEC PDP-11 had, in effect, an open hardware interface designed to make it easy for customers to write their own OS, which was common. As DEC founder Ken Olsen famously proclaimed, "software comes from heaven when you have good hardware". +Universities rapidly adopted Unix after an OS conference publicized its availability. +It was extremely helpful that Unix ran on the PDP-11, a very affordable 16-bit computer, +and was coded in a high-level language that was demonstrably good for systems programming. +The DEC PDP-11 had, in effect, an open hardware interface designed to make it easy for customers to write their own OS, which was common. +As DEC founder Ken Olsen famously proclaimed, "software comes from heaven when you have good hardware". -Unix author Ken Thompson returned to his alma mater, University of California Berkeley (UCB), in 1975 and taught the kernel line-by-line. This ultimately resulted in an evolving system known as BSD (Berkeley Standard Distribution). UCB converted Unix to 32-bits, added virtual memory, and implemented the version of the TCP/IP stack upon which the Internet was essentially built. UCB made BSD available for the cost of media, under what became known as "the BSD license". A customer purchased Unix from AT&T and then ordered a BSD tape from UCB. +Unix author Ken Thompson returned to his alma mater, University of California Berkeley (UCB), in 1975 and taught the kernel line-by-line. +This ultimately resulted in an evolving system known as BSD (Berkeley Standard Distribution). +UCB converted Unix to 32-bits, added virtual memory, and implemented the version of the TCP/IP stack upon which the Internet was essentially built. +UCB made BSD available for the cost of media, under what became known as "the BSD license". +A customer purchased Unix from AT&T and then ordered a BSD tape from UCB. -In the mid-1980s a government anti-trust case against AT&T ended with the break-up of AT&T. AT&T still owned Unix and was now able to sell it. AT&T embarked on an aggressive licensing effort and most commercial Unixes of the day became AT&T-derived. +In the mid-1980s a government anti-trust case against AT&T ended with the break-up of AT&T. +AT&T still owned Unix and was now able to sell it. +AT&T embarked on an aggressive licensing effort and most commercial Unixes of the day became AT&T-derived. -In the early 1990's AT&T sued UCB over license violations related to BSD. UCB discovered that AT&T had incorporated, without acknowledgment or payment, many improvements due to BSD into AT&T's products, and a lengthy court case, primarily between AT&T and UCB, ensued. During this period some UCB programmers embarked on a project to rewrite any AT&T code associated with BSD. This project resulted in a system called BSD 4.4-lite (lite because it was not a complete system; it lacked 6 key AT&T files). +In the early 1990's AT&T sued UCB over license violations related to BSD. +UCB discovered that AT&T had incorporated, without acknowledgment or payment, +many improvements due to BSD into AT&T's products, and a lengthy court case, primarily between AT&T and UCB, ensued. +During this period some UCB programmers embarked on a project to rewrite any AT&T code associated with BSD. +This project resulted in a system called BSD 4.4-lite (lite because it was not a complete system; it lacked 6 key AT&T files). -A lengthy series of articles published slightly later in Dr. Dobbs magazine described a BSD-derived 386 PC version of Unix, with BSD-licensed replacement files for the 6 missing 4.4 lite files. This system, named 386BSD, was due to ex-UCB programmer William Jolitz. It became the original basis of all the PC BSDs in use today. +A lengthy series of articles published slightly later in Dr. Dobbs magazine described a BSD-derived 386 PC version of Unix, with BSD-licensed replacement files for the 6 missing 4.4 lite files. +This system, named 386BSD, was due to ex-UCB programmer William Jolitz. +It became the original basis of all the PC BSDs in use today. -In the mid 1990s, Novell purchased AT&T's Unix rights and a (then secret) agreement was reached to terminate the lawsuit. UCB soon terminated its support for BSD. +In the mid 1990s, Novell purchased AT&T's Unix rights and a (then secret) agreement was reached to terminate the lawsuit. +UCB soon terminated its support for BSD. [[current-bsdl]] == The Current State of FreeBSD and BSD Licenses -The so-called http://www.opensource.org/licenses/bsd-license.php[new BSD license] applied to FreeBSD within the last few years is effectively a statement that you can do anything with the program or its source, but you do not have any warranty and none of the authors has any liability (basically, you cannot sue anybody). This new BSD license is intended to encourage product commercialization. Any BSD code can be sold or included in proprietary products without any restrictions on the availability of your code or your future behavior. +The so-called http://www.opensource.org/licenses/bsd-license.php[new BSD license] applied to FreeBSD within the last few years is effectively a statement that you can do anything with the program or its source, +but you do not have any warranty and none of the authors has any liability (basically, you cannot sue anybody). +This new BSD license is intended to encourage product commercialization. +Any BSD code can be sold or included in proprietary products without any restrictions on the availability of your code or your future behavior. -Do not confuse the new BSD license with "public domain". While an item in the public domain is also free for all to use, it has no owner. +Do not confuse the new BSD license with "public domain". +While an item in the public domain is also free for all to use, it has no owner. [[origins-gpl]] == The origins of the GPL -While the future of Unix had been so muddled in the late 1980s and early 1990s, the GPL, another development with important licensing considerations, reached fruition. +While the future of Unix had been so muddled in the late 1980s and early 1990s, the GPL, +another development with important licensing considerations, reached fruition. -Richard Stallman, the developer of Emacs, was a member of the staff at MIT when his lab switched from home-grown to proprietary systems. Stallman became upset when he found that he could not legally add minor improvements to the system. (Many of Stallman's co-workers had left to form two companies based on software developed at MIT and licensed by MIT; there appears to have been disagreement over access to the source code for this software). Stallman devised an alternative to the commercial software license and called it the GPL, or "GNU Public License". He also started a non-profit foundation, the http://www.fsf.org[Free Software Foundation] (FSF), which intended to develop an entire operating system, including all associated software, that would not be subject to proprietary licensing. This system was called GNU, for "GNU is Not Unix". +Richard Stallman, the developer of Emacs, was a member of the staff at MIT when his lab switched from home-grown to proprietary systems. +Stallman became upset when he found that he could not legally add minor improvements to the system. +(Many of Stallman's co-workers had left to form two companies based on software developed at MIT and licensed by MIT; +there appears to have been disagreement over access to the source code for this software). +Stallman devised an alternative to the commercial software license and called it the GPL, or "GNU Public License". +He also started a non-profit foundation, the http://www.fsf.org[Free Software Foundation] (FSF), +which intended to develop an entire operating system, including all associated software, that would not be subject to proprietary licensing. +This system was called GNU, for "GNU is Not Unix". -The GPL was designed to be the antithesis of the standard proprietary license. To this end, any modifications that were made to a GPL program were required to be given back to the GPL community (by requiring that the source of the program be available to the user) and any program that used or linked to GPL code was required to be under the GPL. The GPL was intended to keep software from becoming proprietary. As the last paragraph of the GPL states: +The GPL was designed to be the antithesis of the standard proprietary license. +To this end, any modifications that were made to a GPL program were required to be given back to the GPL community (by requiring that the source of the program be available to the user) and any program that used or linked to GPL code was required to be under the GPL. +The GPL was intended to keep software from becoming proprietary. +As the last paragraph of the GPL states: -"This General Public License does not permit incorporating your program into proprietary programs."[1] +"This General Public License does not permit incorporating your program into proprietary programs."<> The http://www.opensource.org/licenses/gpl-license.php[GPL] is a complex license so here are some rules of thumb when using the GPL: @@ -81,53 +130,90 @@ The http://www.opensource.org/licenses/gpl-license.php[GPL] is a complex license * output of a program does not count as a derivative work. This enables the gcc compiler to be used in commercial environments without legal problems. * since the Linux kernel is under the GPL, any code statically linked with the Linux kernel must be GPLed. This requirement can be circumvented by dynamically linking loadable kernel modules. This permits companies to distribute binary drivers, but often has the disadvantage that they will only work for particular versions of the Linux kernel. -Due in part to its complexity, in many parts of the world today the legalities of the GPL are being ignored in regard to Linux and related software. The long-term ramifications of this are unclear. +Due in part to its complexity, in many parts of the world today the legalities of the GPL are being ignored in regard to Linux and related software. +The long-term ramifications of this are unclear. [[origins-lgpl]] == The origins of Linux and the LGPL -While the commercial Unix wars raged, the Linux kernel was developed as a PC Unix clone. Linus Torvalds credits the existence of the GNU C compiler and the associated GNU tools for the existence of Linux. He put the Linux kernel under the GPL. +While the commercial Unix wars raged, the Linux kernel was developed as a PC Unix clone. +Linus Torvalds credits the existence of the GNU C compiler and the associated GNU tools for the existence of Linux. +He put the Linux kernel under the GPL. -Remember that the GPL requires anything that statically links to any code under the GPL also be placed under the GPL. The source for this code must thus be made available to the user of the program. Dynamic linking, however, is not considered a violation of the GPL. Pressure to put proprietary applications on Linux became overwhelming. Such applications often must link with system libraries. This resulted in a modified version of the GPL called the http://www.opensource.org/licenses/lgpl-license.php[LGPL] ("Library", since renamed to "Lesser", GPL). The LGPL allows proprietary code to be linked to the GNU C library, glibc. You do not have to release the source code which has been dynamically linked to an LGPLed library. +Remember that the GPL requires anything that statically links to any code under the GPL also be placed under the GPL. +The source for this code must thus be made available to the user of the program. +Dynamic linking, however, is not considered a violation of the GPL. +Pressure to put proprietary applications on Linux became overwhelming. +Such applications often must link with system libraries. +This resulted in a modified version of the GPL called the http://www.opensource.org/licenses/lgpl-license.php[LGPL] ("Library", since renamed to "Lesser", GPL). +The LGPL allows proprietary code to be linked to the GNU C library, glibc. +You do not have to release the source code which has been dynamically linked to an LGPLed library. -If you statically link an application with glibc, such as is often required in embedded systems, you cannot keep your application proprietary, that is, the source must be released. Both the GPL and LGPL require any modifications to the code directly under the license to be released. +If you statically link an application with glibc, such as is often required in embedded systems, +you cannot keep your application proprietary, that is, the source must be released. +Both the GPL and LGPL require any modifications to the code directly under the license to be released. [[orphaning]] == Open Source licenses and the Orphaning Problem -One of the serious problems associated with proprietary software is known as "orphaning". This occurs when a single business failure or change in a product strategy causes a huge pyramid of dependent systems and companies to fail for reasons beyond their control. Decades of experience have shown that the momentary size or success of a software supplier is no guarantee that their software will remain available, as current market conditions and strategies can change rapidly. +One of the serious problems associated with proprietary software is known as "orphaning". +This occurs when a single business failure or change in a product strategy causes a huge pyramid of dependent systems and companies to fail for reasons beyond their control. +Decades of experience have shown that the momentary size or success of a software supplier is no guarantee that their software will remain available, as current market conditions and strategies can change rapidly. The GPL attempts to prevent orphaning by severing the link to proprietary intellectual property. -A BSD license gives a small company the equivalent of software-in-escrow without any legal complications or costs. If a BSD-licensed program becomes orphaned, a company can simply take over, in a proprietary manner, the program on which they are dependent. An even better situation occurs when a BSD code-base is maintained by a small informal consortium, since the development process is not dependent on the survival of a single company or product line. The survivability of the development team when they are mentally in the zone is much more important than simple physical availability of the source code. +A BSD license gives a small company the equivalent of software-in-escrow without any legal complications or costs. +If a BSD-licensed program becomes orphaned, a company can simply take over, in a proprietary manner, the program on which they are dependent. +An even better situation occurs when a BSD code-base is maintained by a small informal consortium, since the development process is not dependent on the survival of a single company or product line. +The survivability of the development team when they are mentally in the zone is much more important than simple physical availability of the source code. [[license-cannot]] == What a license cannot do -No license can guarantee future software availability. Although a copyright holder can traditionally change the terms of a copyright at anytime, the presumption in the BSD community is that such an attempt simply causes the source to fork. +No license can guarantee future software availability. +Although a copyright holder can traditionally change the terms of a copyright at anytime, the presumption in the BSD community is that such an attempt simply causes the source to fork. -The GPL explicitly disallows revoking the license. It has occurred, however, that a company (Mattel) purchased a GPL copyright (cphack), revoked the entire copyright, went to court, and prevailed [2]. That is, they legally revoked the entire distribution and all derivative works based on the copyright. Whether this could happen with a larger and more dispersed distribution is an open question; there is also some confusion regarding whether the software was really under the GPL. +The GPL explicitly disallows revoking the license. +It has occurred, however, that a company (Mattel) purchased a GPL copyright (cphack), revoked the entire copyright, went to court, and prevailed <>. +That is, they legally revoked the entire distribution and all derivative works based on the copyright. +Whether this could happen with a larger and more dispersed distribution is an open question; +there is also some confusion regarding whether the software was really under the GPL. -In another example, Red Hat purchased Cygnus, an engineering company that had taken over development of the FSF compiler tools. Cygnus was able to do so because they had developed a business model in which they sold support for GNU software. This enabled them to employ some 50 engineers and drive the direction of the programs by contributing the preponderance of modifications. As Donald Rosenberg states "projects using licenses like the GPL...live under constant threat of having someone take over the project by producing a better version of the code and doing it faster than the original owners." [3] +In another example, Red Hat purchased Cygnus, an engineering company that had taken over development of the FSF compiler tools. +Cygnus was able to do so because they had developed a business model in which they sold support for GNU software. +This enabled them to employ some 50 engineers and drive the direction of the programs by contributing the preponderance of modifications. +As Donald Rosenberg states "projects using licenses like the GPL...live under constant threat of having someone take over the project by producing a better version of the code and doing it faster than the original owners." <> [[gpl-advantages]] == GPL Advantages and Disadvantages -A common reason to use the GPL is when modifying or extending the gcc compiler. This is particularly apt when working with one-off specialty CPUs in environments where all software costs are likely to be considered overhead, with minimal expectations that others will use the resulting compiler. +A common reason to use the GPL is when modifying or extending the gcc compiler. +This is particularly apt when working with one-off specialty CPUs in environments where all software costs are likely to be considered overhead, with minimal expectations that others will use the resulting compiler. -The GPL is also attractive to small companies selling CDs in an environment where "buy-low, sell-high" may still give the end-user a very inexpensive product. It is also attractive to companies that expect to survive by providing various forms of technical support, including documentation, for the GPLed intellectual property world. +The GPL is also attractive to small companies selling CDs in an environment where "buy-low, sell-high" may still give the end-user a very inexpensive product. +It is also attractive to companies that expect to survive by providing various forms of technical support, including documentation, for the GPLed intellectual property world. -A less publicized and unintended use of the GPL is that it is very favorable to large companies that want to undercut software companies. In other words, the GPL is well suited for use as a marketing weapon, potentially reducing overall economic benefit and contributing to monopolistic behavior. +A less publicized and unintended use of the GPL is that it is very favorable to large companies that want to undercut software companies. +In other words, the GPL is well suited for use as a marketing weapon, potentially reducing overall economic benefit and contributing to monopolistic behavior. -The GPL can present a real problem for those wishing to commercialize and profit from software. For example, the GPL adds to the difficulty a graduate student will have in directly forming a company to commercialize his research results, or the difficulty a student will have in joining a company on the assumption that a promising research project will be commercialized. +The GPL can present a real problem for those wishing to commercialize and profit from software. +For example, the GPL adds to the difficulty a graduate student will have in directly forming a company to commercialize his research results, or the difficulty a student will have in joining a company on the assumption that a promising research project will be commercialized. -For those who must work with statically-linked implementations of multiple software standards, the GPL is often a poor license, because it precludes using proprietary implementations of the standards. The GPL thus minimizes the number of programs that can be built using a GPLed standard. The GPL was intended to not provide a mechanism to develop a standard on which one engineers proprietary products. (This does not apply to Linux applications because they do not statically link, rather they use a trap-based API.) +For those who must work with statically-linked implementations of multiple software standards, the GPL is often a poor license, because it precludes using proprietary implementations of the standards. +The GPL thus minimizes the number of programs that can be built using a GPLed standard. +The GPL was intended to not provide a mechanism to develop a standard on which one engineers proprietary products. +(This does not apply to Linux applications because they do not statically link, rather they use a trap-based API.) -The GPL attempts to make programmers contribute to an evolving suite of programs, then to compete in the distribution and support of this suite. This situation is unrealistic for many required core system standards, which may be applied in widely varying environments which require commercial customization or integration with legacy standards under existing (non-GPL) licenses. Real-time systems are often statically linked, so the GPL and LGPL are definitely considered potential problems by many embedded systems companies. +The GPL attempts to make programmers contribute to an evolving suite of programs, then to compete in the distribution and support of this suite. +This situation is unrealistic for many required core system standards, which may be applied in widely varying environments which require commercial customization or integration with legacy standards under existing (non-GPL) licenses. +Real-time systems are often statically linked, so the GPL and LGPL are definitely considered potential problems by many embedded systems companies. -The GPL is an attempt to keep efforts, regardless of demand, at the research and development stages. This maximizes the benefits to researchers and developers, at an unknown cost to those who would benefit from wider distribution. +The GPL is an attempt to keep efforts, regardless of demand, at the research and development stages. +This maximizes the benefits to researchers and developers, at an unknown cost to those who would benefit from wider distribution. -The GPL was designed to keep research results from transitioning to proprietary products. This step is often assumed to be the last step in the traditional technology transfer pipeline and it is usually difficult enough under the best of circumstances; the GPL was intended to make it impossible. +The GPL was designed to keep research results from transitioning to proprietary products. +This step is often assumed to be the last step in the traditional technology transfer pipeline and it is usually difficult enough under the best of circumstances; +the GPL was intended to make it impossible. [[bsd-advantages]] == BSD Advantages @@ -140,19 +226,32 @@ A BSD style license is a good choice for long duration research or other project This final consideration may often be the dominant one, as it was when the Apache project decided upon its license: -"This type of license is ideal for promoting the use of a reference body of code that implements a protocol for common service. This is another reason why we choose it for the Apache group - many of us wanted to see HTTP survive and become a true multiparty standard, and would not have minded in the slightest if Microsoft or Netscape choose to incorporate our HTTP engine or any other component of our code into their products, if it helped further the goal of keeping HTTP common... All this means that, strategically speaking, the project needs to maintain sufficient momentum, and that participants realize greater value by contributing their code to the project, even code that would have had value if kept proprietary." +"This type of license is ideal for promoting the use of a reference body of code that implements a protocol for common service. +This is another reason why we choose it for the Apache group - many of us wanted to see HTTP survive and become a true multiparty standard, +and would not have minded in the slightest if Microsoft or Netscape choose to incorporate our HTTP engine or any other component of our code into their products, if it helped further the goal of keeping HTTP common... All this means that, strategically speaking, the project needs to maintain sufficient momentum, and that participants realize greater value by contributing their code to the project, even code that would have had value if kept proprietary." -Developers tend to find the BSD license attractive as it keeps legal issues out of the way and lets them do whatever they want with the code. In contrast, those who expect primarily to use a system rather than program it, or expect others to evolve the code, or who do not expect to make a living from their work associated with the system (such as government employees), find the GPL attractive, because it forces code developed by others to be given to them and keeps their employer from retaining copyright and thus potentially "burying" or orphaning the software. If you want to force your competitors to help you, the GPL is attractive. +Developers tend to find the BSD license attractive as it keeps legal issues out of the way and lets them do whatever they want with the code. +In contrast, those who expect primarily to use a system rather than program it, or expect others to evolve the code, or who do not expect to make a living from their work associated with the system (such as government employees), find the GPL attractive, because it forces code developed by others to be given to them and keeps their employer from retaining copyright and thus potentially "burying" or orphaning the software. +If you want to force your competitors to help you, the GPL is attractive. -A BSD license is not simply a gift. The question "why should we help our competitors or let them steal our work?" comes up often in relation to a BSD license. Under a BSD license, if one company came to dominate a product niche that others considered strategic, the other companies can, with minimal effort, form a mini-consortium aimed at reestablishing parity by contributing to a competitive BSD variant that increases market competition and fairness. This permits each company to believe that it will be able to profit from some advantage it can provide, while also contributing to economic flexibility and efficiency. The more rapidly and easily the cooperating members can do this, the more successful they will be. A BSD license is essentially a minimally complicated license that enables such behavior. +A BSD license is not simply a gift. +The question "why should we help our competitors or let them steal our work?" comes up often in relation to a BSD license. +Under a BSD license, if one company came to dominate a product niche that others considered strategic, the other companies can, with minimal effort, form a mini-consortium aimed at reestablishing parity by contributing to a competitive BSD variant that increases market competition and fairness. +This permits each company to believe that it will be able to profit from some advantage it can provide, while also contributing to economic flexibility and efficiency. +The more rapidly and easily the cooperating members can do this, the more successful they will be. +A BSD license is essentially a minimally complicated license that enables such behavior. -A key effect of the GPL, making a complete and competitive Open Source system widely available at cost of media, is a reasonable goal. A BSD style license, in conjunction with ad-hoc-consortiums of individuals, can achieve this goal without destroying the economic assumptions built around the deployment-end of the technology transfer pipeline. +A key effect of the GPL, making a complete and competitive Open Source system widely available at cost of media, is a reasonable goal. +A BSD style license, in conjunction with ad-hoc-consortiums of individuals, can achieve this goal without destroying the economic assumptions built around the deployment-end of the technology transfer pipeline. [[recommendations]] == Specific Recommendations for using a BSD license -* The BSD license is preferable for transferring research results in a way that will widely be deployed and most benefit an economy. As such, research funding agencies, such as the NSF, ONR and DARPA, should encourage in the earliest phases of funded research projects, the adoption of BSD style licenses for software, data, results, and open hardware. They should also encourage formation of standards based around implemented Open Source systems and ongoing Open Source projects. -* Government policy should minimize the costs and difficulties in moving from research to deployment. When possible, grants should require results to be available under a commercialization friendly BSD style license. +* The BSD license is preferable for transferring research results in a way that will widely be deployed and most benefit an economy. +As such, research funding agencies, such as the NSF, ONR and DARPA, should encourage in the earliest phases of funded research projects, the adoption of BSD style licenses for software, data, results, and open hardware. +They should also encourage formation of standards based around implemented Open Source systems and ongoing Open Source projects. +* Government policy should minimize the costs and difficulties in moving from research to deployment. +When possible, grants should require results to be available under a commercialization friendly BSD style license. * In many cases, the long-term results of a BSD style license more accurately reflect the goals proclaimed in the research charter of universities than what occurs when results are copyrighted or patented and subject to proprietary university licensing. Anecdotal evidence exists that universities are financially better rewarded in the long run by releasing research results and then appealing to donations from commercially successful alumni. * Companies have long recognized that the creation of de facto standards is a key marketing technique. The BSD license serves this role well, if a company really has a unique advantage in evolving the system. The license is legally attractive to the widest audience while the company's expertise ensures their control. There are times when the GPL may be the appropriate vehicle for an attempt to create such a standard, especially when attempting to undermine or co-opt others. The GPL, however, penalizes the evolution of that standard, because it promotes a suite rather than a commercially applicable standard. Use of such a suite constantly raises commercialization and legal issues. It may not be possible to mix standards when some are under the GPL and others are not. A true technical standard should not mandate exclusion of other standards for non-technical reasons. * Companies interested in promoting an evolving standard, which can become the core of other companies' commercial products, should be wary of the GPL. Regardless of the license used, the resulting software will usually devolve to whoever actually makes the majority of the engineering changes and most understands the state of the system. The GPL simply adds more legal friction to the result. @@ -163,25 +262,22 @@ A key effect of the GPL, making a complete and competitive Open Source system wi [[conclusion]] == Conclusion -In contrast to the GPL, which is designed to prevent the proprietary commercialization of Open Source code, the BSD license places minimal restrictions on future behavior. This allows BSD code to remain Open Source or become integrated into commercial solutions, as a project's or company's needs change. In other words, the BSD license does not become a legal time-bomb at any point in the development process. +In contrast to the GPL, which is designed to prevent the proprietary commercialization of Open Source code, the BSD license places minimal restrictions on future behavior. +This allows BSD code to remain Open Source or become integrated into commercial solutions, as a project's or company's needs change. +In other words, the BSD license does not become a legal time-bomb at any point in the development process. In addition, since the BSD license does not come with the legal complexity of the GPL or LGPL licenses, it allows developers and companies to spend their time creating and promoting good code rather than worrying if that code violates licensing. [[addenda]] +[bibliography] == Bibliographical References -[.programlisting] -.... -[1] http://www.gnu.org/licenses/gpl.html +* [[[one,1]]] http://www.gnu.org/licenses/gpl.html -[2] http://archives.cnn.com/2000/TECH/computing/03/28/cyberpatrol.mirrors/ +* [[[two,2]]] http://archives.cnn.com/2000/TECH/computing/03/28/cyberpatrol.mirrors/ -[3] Open Source: the Unauthorized White Papers, Donald K. Rosenberg, IDG Books, - 2000. Quotes are from page 114, ``Effects of the GNU GPL''. +* [[[three,3]]] Open Source: the Unauthorized White Papers, Donald K. Rosenberg, IDG Books, 2000. Quotes are from page 114, "Effects of the GNU GPL". -[4] In the "What License to Use?" section of - http://www.oreilly.com/catalog/opensources/book/brian.html +* [[[four,4]]] In the "What License to Use?" section of http://www.oreilly.com/catalog/opensources/book/brian.html -This whitepaper is a condensation of an original work available at -http://alumni.cse.ucsc.edu/~brucem/open_source_license.htm -.... +This whitepaper is a condensation of an original work available at http://alumni.cse.ucsc.edu/~brucem/open_source_license.htm diff --git a/documentation/content/en/articles/building-products/_index.adoc b/documentation/content/en/articles/building-products/_index.adoc index ce85ee3757..8538aea5e8 100644 --- a/documentation/content/en/articles/building-products/_index.adoc +++ b/documentation/content/en/articles/building-products/_index.adoc @@ -24,7 +24,7 @@ include::shared/en/mailing-lists.adoc[] include::shared/en/urls.adoc[] ifeval::["{backend}" == "html5"] -:imagesdir: ../../images/articles/building-products/ +:imagesdir: ../../../images/articles/building-products/ endif::[] ifeval::["{backend}" == "pdf"] @@ -38,9 +38,13 @@ endif::[] [.abstract-title] Abstract -The FreeBSD project is a worldwide, volunteer based, and collaborative project, which develops a portable and high-quality operating system. The FreeBSD project distributes the source code for its product under a liberal license, with the intention of encouraging the use of its code. Collaborating with the FreeBSD project can help organizations reduce their time to market, reduce engineering costs and improve their product quality. +The FreeBSD project is a worldwide, volunteer based, and collaborative project, which develops a portable and high-quality operating system. +The FreeBSD project distributes the source code for its product under a liberal license, with the intention of encouraging the use of its code. +Collaborating with the FreeBSD project can help organizations reduce their time to market, reduce engineering costs and improve their product quality. -This article examines the issues in using FreeBSD code in appliances and software products. It highlights the characteristics of FreeBSD that make it an excellent substrate for product development. The article concludes by suggesting a few "best practices" for organizations collaborating with the FreeBSD project. +This article examines the issues in using FreeBSD code in appliances and software products. +It highlights the characteristics of FreeBSD that make it an excellent substrate for product development. +The article concludes by suggesting a few "best practices" for organizations collaborating with the FreeBSD project. ''' @@ -49,13 +53,18 @@ toc::[] [[introduction]] == Introduction -FreeBSD today is well-known as a high-performance server operating system. It is deployed on millions of web servers and internet-facing hosts worldwide. FreeBSD code also forms an integral part of many products, ranging from appliances such as network routers, firewalls, and storage devices, to personal computers. Portions of FreeBSD have also been used in commercial shrink-wrapped software (see <>). +FreeBSD today is well-known as a high-performance server operating system. +It is deployed on millions of web servers and internet-facing hosts worldwide. +FreeBSD code also forms an integral part of many products, ranging from appliances such as network routers, firewalls, and storage devices, to personal computers. +Portions of FreeBSD have also been used in commercial shrink-wrapped software (see <>). In this article we look at the link:https://www.FreeBSD.org/[FreeBSD project] as a software engineering resource-as a collection of building blocks and processes which you can use to build products. -While FreeBSD's source is distributed freely to the public, to fully enjoy the benefits of the project's work, organizations need to _collaborate_ with the project. In subsequent sections of this article we discuss effective means of collaboration with the project and the pitfalls that need to be avoided while doing so. +While FreeBSD's source is distributed freely to the public, to fully enjoy the benefits of the project's work, organizations need to _collaborate_ with the project. +In subsequent sections of this article we discuss effective means of collaboration with the project and the pitfalls that need to be avoided while doing so. -*Caveat Reader.* The author believes that the characteristics of the FreeBSD Project listed in this article were substantially true at the time the article was conceived and written (2005). However, the reader should keep in mind that the practices and processes used by open-source communities can change over time, and that the information in this article should therefore be taken as indicative rather than normative. +*Caveat Reader.* The author believes that the characteristics of the FreeBSD Project listed in this article were substantially true at the time the article was conceived and written (2005). +However, the reader should keep in mind that the practices and processes used by open-source communities can change over time, and that the information in this article should therefore be taken as indicative rather than normative. === Target Audience @@ -94,7 +103,8 @@ FreeBSD makes an excellent foundation on which to build products: * The project offers exceptional transparency into its workings, allowing organizations using its code to plan effectively for the future. * The culture of the FreeBSD project, carried over from the Computer Science Research Group at The University of California, Berkeley <>, fosters high-quality work. Some features in FreeBSD define the state of the art. -<> examines the business reasons for using open-source in greater detail. For organizations, the benefits of using FreeBSD components in their products include a shorter time to market, lower development costs and lower development risks. +<> examines the business reasons for using open-source in greater detail. +For organizations, the benefits of using FreeBSD components in their products include a shorter time to market, lower development costs and lower development risks. === Building with FreeBSD @@ -108,21 +118,28 @@ By being "downstream" of the project, organizations leverage the new features, b FreeBSD ships with a self-hosting development environment that allows easy creation of such configurations. * As a Unix compatible environment for the management functions of high-end storage and networking devices, running on a separate processor "blade". + -FreeBSD provides the tools for creating dedicated OS and application program images. Its implementation of a BSD unix API is mature and tested. FreeBSD can also provide a stable cross-development environment for the other components of the high-end device. +FreeBSD provides the tools for creating dedicated OS and application program images. +Its implementation of a BSD unix API is mature and tested. +FreeBSD can also provide a stable cross-development environment for the other components of the high-end device. * As a vehicle to get widespread testing and support from a worldwide team of developers for non-critical "intellectual property". + -In this model, organizations contribute useful infrastructural frameworks to the FreeBSD project (for example, see man:netgraph[3]). The widespread exposure that the code gets helps to quickly identify performance issues and bugs. The involvement of top-notch developers also leads to useful extensions to the infrastructure that the contributing organization also benefits from. +In this model, organizations contribute useful infrastructural frameworks to the FreeBSD project (for example, see man:netgraph[3]). +The widespread exposure that the code gets helps to quickly identify performance issues and bugs. +The involvement of top-notch developers also leads to useful extensions to the infrastructure that the contributing organization also benefits from. * As a development environment supporting cross-development for embedded OSes like http://www.rtems.com/[RTEMS] and http://ecos.sourceware.org/[eCOS]. + There are many full-fledged development environments in the {numports}-strong collection of applications ported and packaged with FreeBSD. * As a way to support a Unix-like API in an otherwise proprietary OS, increasing its palatability for application developers. + -Here parts of FreeBSD's kernel and application programs are "ported" to run alongside other tasks in the proprietary OS. The availability of a stable and well tested Unix(TM) API implementation can reduce the effort needed to port popular applications to the proprietary OS. As FreeBSD ships with high-quality documentation for its internals and has effective vulnerability management and release engineering processes, the costs of keeping up-to-date are kept low. +Here parts of FreeBSD's kernel and application programs are "ported" to run alongside other tasks in the proprietary OS. +The availability of a stable and well tested Unix(TM) API implementation can reduce the effort needed to port popular applications to the proprietary OS. +As FreeBSD ships with high-quality documentation for its internals and has effective vulnerability management and release engineering processes, the costs of keeping up-to-date are kept low. [[freebsd-technologies]] === Technologies -There are a large number of technologies supported by the FreeBSD project. A selection of these are listed below: +There are a large number of technologies supported by the FreeBSD project. +A selection of these are listed below: * A complete system that can cross-host itself for link:https://www.FreeBSD.org/platforms/[many architectures:] * A modular symmetric multiprocessing capable kernel, with loadable kernel modules and a flexible and easy to use configuration system. @@ -145,20 +162,25 @@ FreeBSD's organizational structure is non-hierarchical. There are essentially two kinds of contributors to FreeBSD, general users of FreeBSD, and developers with write access (known as _committers_ in the jargon) to the source base. -There are many thousands of contributors in the first group; the vast majority of contributions to FreeBSD come from individuals in this group. Commit rights (write access) to the repository are granted to individuals who contribute consistently to the project. Commit rights come with additional responsibilities, and new committers are assigned mentors to help them learn the ropes. +There are many thousands of contributors in the first group; the vast majority of contributions to FreeBSD come from individuals in this group. +Commit rights (write access) to the repository are granted to individuals who contribute consistently to the project. +Commit rights come with additional responsibilities, and new committers are assigned mentors to help them learn the ropes. .FreeBSD Organization image::freebsd-organization.png[] Conflict resolution is performed by a nine member "Core Team" that is elected from the group of committers. -FreeBSD does not have "corporate" committers. Individual committers are required to take responsibility for the changes they introduce to the code. The link:{committers-guide}[FreeBSD Committer's guide] <> documents the rules and responsibilities for committers. +FreeBSD does not have "corporate" committers. +Individual committers are required to take responsibility for the changes they introduce to the code. +The link:{committers-guide}[FreeBSD Committer's guide] <> documents the rules and responsibilities for committers. FreeBSD's project model is examined in detail in <>. === FreeBSD Release Engineering Processes -FreeBSD's release engineering processes play a major role in ensuring that its released versions are of a high quality. At any point of time, FreeBSD's volunteers support multiple code lines (<>): +FreeBSD's release engineering processes play a major role in ensuring that its released versions are of a high quality. +At any point of time, FreeBSD's volunteers support multiple code lines (<>): * New features and disruptive code enters on the development branch, also known as the _-CURRENT_ branch. * _-STABLE_ branches are code lines that are branched from HEAD at regular intervals. Only tested code is allowed onto a -STABLE branch. New features are allowed once they have been tested and stabilized in the -CURRENT branch. @@ -170,9 +192,11 @@ image::freebsd-branches.png[] Code lines are kept alive for as long as there is user and developer interest in them. -Machine architectures are grouped into "tiers"; _Tier 1_ architectures are fully supported by the project's release engineering and security teams, _Tier 2_ architectures are supported on a best effort basis, and experimental architectures comprise _Tier 3_. The list of link:{committers-guide}#archs[supported architectures] is part of the FreeBSD documentation collection. +Machine architectures are grouped into "tiers"; _Tier 1_ architectures are fully supported by the project's release engineering and security teams, _Tier 2_ architectures are supported on a best effort basis, and experimental architectures comprise _Tier 3_. +The list of link:{committers-guide}#archs[supported architectures] is part of the FreeBSD documentation collection. -The release engineering team publishes a link:https://www.FreeBSD.org/releng/[road map] for future releases of FreeBSD on the project's web site. The dates laid down in the road map are not deadlines; FreeBSD is released when its code and documentation are ready. +The release engineering team publishes a link:https://www.FreeBSD.org/releng/[road map] for future releases of FreeBSD on the project's web site. +The dates laid down in the road map are not deadlines; FreeBSD is released when its code and documentation are ready. FreeBSD's release engineering processes are described in <>. @@ -181,7 +205,10 @@ FreeBSD's release engineering processes are described in <>. Open-source projects like FreeBSD offer finished code of a very high quality. -While access to quality source code can reduce the cost of initial development, in the long-term the costs of managing change begin to dominate. As computing environments change over the years and new security vulnerabilities are discovered, your product too needs to change and adapt. Using open-source code is best viewed not as a one-off activity, but as an __ongoing process__. The best projects to collaborate with are the ones that are __live__; i.e., with an active community, clear goals and a transparent working style. +While access to quality source code can reduce the cost of initial development, in the long-term the costs of managing change begin to dominate. +As computing environments change over the years and new security vulnerabilities are discovered, your product too needs to change and adapt. +Using open-source code is best viewed not as a one-off activity, but as an __ongoing process__. +The best projects to collaborate with are the ones that are __live__; i.e., with an active community, clear goals and a transparent working style. * FreeBSD has an active developer community around it. At the time of writing there are many thousands of contributors from every populated continent in the world and over 300 individuals with write access to the project's source repositories. * The goals of the FreeBSD project are <>: @@ -196,7 +223,8 @@ While access to quality source code can reduce the cost of initial development, To be able to work effectively with the FreeBSD project, you need to understand the project's culture. -Volunteer driven projects operate under different rules than for-profit corporates. A common mistake that companies make when venturing into the open-source world is that of underplaying these differences. +Volunteer driven projects operate under different rules than for-profit corporates. +A common mistake that companies make when venturing into the open-source world is that of underplaying these differences. *Motivation.* Most contributions to FreeBSD are done voluntarily without monetary rewards entering the picture. The factors that motivate individuals are complex, ranging from altruism, to an interest in solving the kinds of problems that FreeBSD attempts to solve. In this environment, "elegance is never optional"<>. @@ -204,13 +232,15 @@ Volunteer driven projects operate under different rules than for-profit corporat The project values long-term perspectives <>. A frequent acronym encountered in the project is DTRT, which stands for "Do The Right Thing". -*Development Processes.* Computer programs are tools for communication: at one level programmers communicate their intentions using a precise notation to a tool (a compiler) that translates their instructions to executable code. At another level, the same notation is used for communication of intent between two programmers. +*Development Processes.* Computer programs are tools for communication: at one level programmers communicate their intentions using a precise notation to a tool (a compiler) that translates their instructions to executable code. +At another level, the same notation is used for communication of intent between two programmers. -Formal specifications and design documents are seldom used in the project. Clear and well-written code and well-written change logs (<>) are used in their place. FreeBSD development happens by "rough consensus and running code"<>. +Formal specifications and design documents are seldom used in the project. +Clear and well-written code and well-written change logs (<>) are used in their place. +FreeBSD development happens by "rough consensus and running code"<>. [.programlisting] .... - r151864 | bde | 2005-10-29 09:34:50 -0700 (Sat, 29 Oct 2005) | 13 lines Changed paths: M /head/lib/msun/src/e_rem_pio2f.c @@ -232,22 +262,25 @@ This speeds up arg reduction by a factor of 2 for |x| between 3*pi/4 and Communication between programmers is enhanced by the use of a common coding standard man:style[9]. -*Communication Channels.* FreeBSD's contributors are spread across the world. Email (and to a lesser extent, IRC) is the preferred means of communication in the project. +*Communication Channels.* FreeBSD's contributors are spread across the world. +Email (and to a lesser extent, IRC) is the preferred means of communication in the project. === Best Practices for collaborating with the FreeBSD project We now look at a few best practices for making the best use of FreeBSD in product development. Plan for the long term:: -Setup processes that help in tracking the development of FreeBSD. For example: +Setup processes that help in tracking the development of FreeBSD. +For example: + *Track FreeBSD source code.* The project makes it easy to mirror its SVN repository using link:{committers-guide}#svn-advanced-use-setting-up-svnsync[svnsync]. Having the complete history of the source is useful when debugging complex problems and offers valuable insight into the intentions of the original developers. Use a capable source control system that allows you to easily merge changes between the upstream FreeBSD code base and your own in-house code. + -<> shows a portion of an annotated listing of the file referenced by the change log in <>. The ancestry of each line of the source is clearly visible. Annotated listings showing the history of every file that is part of FreeBSD are https://svnweb.freebsd.org/[available on the web]. +<> shows a portion of an annotated listing of the file referenced by the change log in <>. +The ancestry of each line of the source is clearly visible. +Annotated listings showing the history of every file that is part of FreeBSD are https://svnweb.freebsd.org/[available on the web]. + [.programlisting] .... - #REV #WHO #DATE #TEXT 176410 bde 2008-02-19 07:42:46 -0800 (Tue, 19 Feb 2008) #include @@ -268,31 +301,48 @@ Setup processes that help in tracking the development of FreeBSD. For example: + *Use a gatekeeper.* Appoint a _gatekeeper_ to monitor FreeBSD development, to keep an eye out for changes that could potentially impact your products. + -*Report bugs upstream.* If you notice bug in the FreeBSD code that you are using, file a https://www.FreeBSD.org/support/bugreports/[bug report]. This step helps ensure that you do not have to fix the bug the next time you take a code drop from upstream. +*Report bugs upstream.* If you notice bug in the FreeBSD code that you are using, file a https://www.FreeBSD.org/support/bugreports/[bug report]. +This step helps ensure that you do not have to fix the bug the next time you take a code drop from upstream. Leverage FreeBSD's release engineering efforts:: -Use code from a -STABLE development branch of FreeBSD. These development branches are formally supported by FreeBSD's release engineering and security teams and comprise of tested code. +Use code from a -STABLE development branch of FreeBSD. +These development branches are formally supported by FreeBSD's release engineering and security teams and comprise of tested code. Donate code to reduce costs:: -A major proportion of the costs associated with developing products is that of doing maintenance. By donating non-critical code to the project, you benefit by having your code see much wider exposure than it would otherwise get. This in turn leads to more bugs and security vulnerabilities being flushed out and performance anomalies being identified and fixed. +A major proportion of the costs associated with developing products is that of doing maintenance. +By donating non-critical code to the project, you benefit by having your code see much wider exposure than it would otherwise get. +This in turn leads to more bugs and security vulnerabilities being flushed out and performance anomalies being identified and fixed. Get support effectively:: -For products with tight deadlines, it is recommended that you hire or enter into a consulting agreement with a developer or firm with FreeBSD experience. The {freebsd-jobs} is a useful communication channel to find talent. The FreeBSD project maintains a link:https://www.FreeBSD.org/commercial/consult_bycat/[gallery of consultants and consulting firms] undertaking FreeBSD work. The http://www.bsdcertification.org/[BSD Certification Group] offers certification for all the major BSD derived OSes. +For products with tight deadlines, it is recommended that you hire or enter into a consulting agreement with a developer or firm with FreeBSD experience. +The {freebsd-jobs} is a useful communication channel to find talent. +The FreeBSD project maintains a link:https://www.FreeBSD.org/commercial/consult_bycat/[gallery of consultants and consulting firms] undertaking FreeBSD work. +The http://www.bsdcertification.org/[BSD Certification Group] offers certification for all the major BSD derived OSes. + -For less critical needs, you can ask for help on the http://lists.FreeBSD.org/mailman/listinfo[project mailing lists]. A useful guide to follow when asking for help is given in <>. +For less critical needs, you can ask for help on the http://lists.FreeBSD.org/mailman/listinfo[project mailing lists]. +A useful guide to follow when asking for help is given in <>. Publicize your involvement:: You are not required to publicize your use of FreeBSD, but doing so helps both your effort as well as that of the project. + -Letting the FreeBSD community know that your company uses FreeBSD helps improve your chances of attracting high quality talent. A large roster of support for FreeBSD also means more mind share for it among developers. This in turn yields a healthier foundation for your future. +Letting the FreeBSD community know that your company uses FreeBSD helps improve your chances of attracting high quality talent. +A large roster of support for FreeBSD also means more mind share for it among developers. +This in turn yields a healthier foundation for your future. Support FreeBSD developers:: -Sometimes the most direct way to get a desired feature into FreeBSD is to support a developer who is already looking at a related problem. Help can range from hardware donations to direct financial assistance. In some countries, donations to the FreeBSD project enjoy tax benefits. The project has a dedicated link:https://www.FreeBSD.org/donations/[donations liaison] to assist donors. The project also maintains a web page where developers link:https://www.FreeBSD.org/donations/wantlist/[list their needs]. +Sometimes the most direct way to get a desired feature into FreeBSD is to support a developer who is already looking at a related problem. +Help can range from hardware donations to direct financial assistance. +In some countries, donations to the FreeBSD project enjoy tax benefits. +The project has a dedicated link:https://www.FreeBSD.org/donations/[donations liaison] to assist donors. +The project also maintains a web page where developers link:https://www.FreeBSD.org/donations/wantlist/[list their needs]. + As a policy the FreeBSD project link:{contributors}[acknowledges] all contributions received on its web site. [[conclusion]] == Conclusion -The FreeBSD project's goals are to create and give away the source code for a high-quality operating system. By working with the FreeBSD project you can reduce development costs and improve your time to market in a number of product development scenarios. +The FreeBSD project's goals are to create and give away the source code for a high-quality operating system. +By working with the FreeBSD project you can reduce development costs and improve your time to market in a number of product development scenarios. -We examined the characteristics of the FreeBSD project that make it an excellent choice for being part of an organization's product strategy. We then looked at the prevailing culture of the project and examined effective ways of interacting with its developers. The article concluded with a list of best-practices that could help organizations collaborating with the project. +We examined the characteristics of the FreeBSD project that make it an excellent choice for being part of an organization's product strategy. +We then looked at the prevailing culture of the project and examined effective ways of interacting with its developers. +The article concluded with a list of best-practices that could help organizations collaborating with the project. :sectnums!: diff --git a/documentation/content/en/articles/committers-guide/_index.adoc b/documentation/content/en/articles/committers-guide/_index.adoc index 5e8e39441f..8237c47680 100644 --- a/documentation/content/en/articles/committers-guide/_index.adoc +++ b/documentation/content/en/articles/committers-guide/_index.adoc @@ -2,7 +2,7 @@ title: Committer's Guide authors: - author: The FreeBSD Documentation Project -copyright: 1999-2019 The FreeBSD Documentation Project +copyright: 1999-2021 The FreeBSD Documentation Project releaseinfo: "$FreeBSD$" trademarks: ["freebsd", "coverity", "ibm", "intel", "general"] --- @@ -25,9 +25,13 @@ include::shared/en/urls.adoc[] [.abstract-title] Abstract -This document provides information for the FreeBSD committer community. All new committers should read this document before they start, and existing committers are strongly encouraged to review it from time to time. +This document provides information for the FreeBSD committer community. +All new committers should read this document before they start, and existing committers are strongly encouraged to review it from time to time. -Almost all FreeBSD developers have commit rights to one or more repositories. However, a few developers do not, and some of the information here applies to them as well. (For instance, some people only have rights to work with the Problem Report database). Please see <> for more information. +Almost all FreeBSD developers have commit rights to one or more repositories. +However, a few developers do not, and some of the information here applies to them as well. +(For instance, some people only have rights to work with the Problem Report database). +Please see <> for more information. This document may also be of interest to members of the FreeBSD community who want to learn more about how the project works. @@ -84,12 +88,15 @@ Useful links: [[pgpkeys]] == OpenPGP Keys for FreeBSD -Cryptographic keys conforming to the OpenPGP (__Pretty Good Privacy__) standard are used by the FreeBSD project to authenticate committers. Messages carrying important information like public SSH keys can be signed with the OpenPGP key to prove that they are really from the committer. See http://www.nostarch.com/pgp_ml.htm[PGP & GPG: Email for the Practical Paranoid by Michael Lucas] and http://en.wikipedia.org/wiki/Pretty_Good_Privacy[] for more information. +Cryptographic keys conforming to the OpenPGP (__Pretty Good Privacy__) standard are used by the FreeBSD project to authenticate committers. +Messages carrying important information like public SSH keys can be signed with the OpenPGP key to prove that they are really from the committer. +See http://www.nostarch.com/pgp_ml.htm[PGP & GPG: Email for the Practical Paranoid by Michael Lucas] and http://en.wikipedia.org/wiki/Pretty_Good_Privacy[] for more information. [[pgpkeys-creating]] === Creating a Key -Existing keys can be used, but should be checked with [.filename]#documentation/tools/checkkey.sh# first. In this case, make sure the key has a FreeBSD user ID. +Existing keys can be used, but should be checked with [.filename]#documentation/tools/checkkey.sh# first. +In this case, make sure the key has a FreeBSD user ID. For those who do not yet have an OpenPGP key, or need a new key to meet FreeBSD security requirements, here we show how to generate one. @@ -156,17 +163,22 @@ You need a Passphrase to protect your secret key. <.> Use your real name here, preferably matching that shown on government-issued ID to make it easier for others to verify your identity. Text that may help others identify you can be entered in the `Comment` section. + -After the email address is entered, a passphrase is requested. Methods of creating a secure passphrase are contentious. Rather than suggest a single way, here are some links to sites that describe various methods: http://world.std.com/~reinhold/diceware.html[], http://www.iusmentis.com/security/passphrasefaq/[], http://xkcd.com/936/[], http://en.wikipedia.org/wiki/Passphrase[]. +After the email address is entered, a passphrase is requested. +Methods of creating a secure passphrase are contentious. +Rather than suggest a single way, here are some links to sites that describe various methods: http://world.std.com/~reinhold/diceware.html[], http://www.iusmentis.com/security/passphrasefaq/[], http://xkcd.com/936/[], http://en.wikipedia.org/wiki/Passphrase[]. ==== -Protect the private key and passphrase. If either the private key or passphrase may have been compromised or disclosed, immediately notify mailto:accounts@FreeBSD.org[accounts@FreeBSD.org] and revoke the key. +Protect the private key and passphrase. +If either the private key or passphrase may have been compromised or disclosed, immediately notify mailto:accounts@FreeBSD.org[accounts@FreeBSD.org] and revoke the key. Committing the new key is shown in <>. [[kerberos-ldap]] == Kerberos and LDAP web Password for FreeBSD Cluster -The FreeBSD cluster requires a Kerberos password to access certain services. The Kerberos password also serves as the LDAP web password, since LDAP is proxying to Kerberos in the cluster. Some of the services which require this include: +The FreeBSD cluster requires a Kerberos password to access certain services. +The Kerberos password also serves as the LDAP web password, since LDAP is proxying to Kerberos in the cluster. +Some of the services which require this include: * https://bugs.freebsd.org/bugzilla[Bugzilla] * https://ci.freebsd.org[Jenkins] @@ -192,13 +204,17 @@ A Kerberos password can also be set manually by logging into `freefall.FreeBSD.o [NOTE] ==== -Unless the Kerberos-authenticated services of the FreeBSD.org cluster have been used previously, `Client unknown` will be shown. This error means that the `ssh kpasswd.freebsd.org` method shown above must be used first to initialize the Kerberos account. +Unless the Kerberos-authenticated services of the FreeBSD.org cluster have been used previously, `Client unknown` will be shown. +This error means that the `ssh kpasswd.freebsd.org` method shown above must be used first to initialize the Kerberos account. ==== [[committer.types]] == Commit Bit Types -The FreeBSD repository has a number of components which, when combined, support the basic operating system source, documentation, third party application ports infrastructure, and various maintained utilities. When FreeBSD commit bits are allocated, the areas of the tree where the bit may be used are specified. Generally, the areas associated with a bit reflect who authorized the allocation of the commit bit. Additional areas of authority may be added at a later date: when this occurs, the committer should follow normal commit bit allocation procedures for that area of the tree, seeking approval from the appropriate entity and possibly getting a mentor for that area for some period of time. +The FreeBSD repository has a number of components which, when combined, support the basic operating system source, documentation, third party application ports infrastructure, and various maintained utilities. +When FreeBSD commit bits are allocated, the areas of the tree where the bit may be used are specified. +Generally, the areas associated with a bit reflect who authorized the allocation of the commit bit. +Additional areas of authority may be added at a later date: when this occurs, the committer should follow normal commit bit allocation procedures for that area of the tree, seeking approval from the appropriate entity and possibly getting a mentor for that area for some period of time. [.informaltable] [cols="1,1,1", frame="none"] @@ -221,7 +237,9 @@ The FreeBSD repository has a number of components which, when combined, support |ports/ |=== -Commit bits allocated prior to the development of the notion of areas of authority may be appropriate for use in many parts of the tree. However, common sense dictates that a committer who has not previously worked in an area of the tree seek review prior to committing, seek approval from the appropriate responsible party, and/or work with a mentor. Since the rules regarding code maintenance differ by area of the tree, this is as much for the benefit of the committer working in an area of less familiarity as it is for others working on the tree. +Commit bits allocated prior to the development of the notion of areas of authority may be appropriate for use in many parts of the tree. +However, common sense dictates that a committer who has not previously worked in an area of the tree seek review prior to committing, seek approval from the appropriate responsible party, and/or work with a mentor. +Since the rules regarding code maintenance differ by area of the tree, this is as much for the benefit of the committer working in an area of less familiarity as it is for others working on the tree. Committers are encouraged to seek review for their work as part of the normal development process, regardless of the area of the tree where the work is occurring. @@ -244,17 +262,14 @@ this section is a work in progress... [[git-basics]] === Git basics -There are many primers on how to use Git on the web. There's a lot of -them (google "Git primer"). This one comes up first, and is generally -good. https://danielmiessler.com/study/git/ and -https://gist.github.com/williewillus/068e9a8543de3a7ef80adb2938657b6b -are good overviews. The Git book is also complete, but much longer -https://git-scm.com/book/en/v2. There is also this website -https://ohshitgit.com/ for common traps and pitfalls of Git, in case -you need guidance to fix things up. +There are many primers on how to use Git on the web. +There's a lot of them (google "Git primer"). +This one comes up first, and is generally good. +https://danielmiessler.com/study/git/ and https://gist.github.com/williewillus/068e9a8543de3a7ef80adb2938657b6b are good overviews. +The Git book is also complete, but much longer https://git-scm.com/book/en/v2. +There is also this website https://ohshitgit.com/ for common traps and pitfalls of Git, in case you need guidance to fix things up. -This document will assume that you've read through it and will try not -to belabor the basics (though it will cover them briefly). +This document will assume that you've read through it and will try not to belabor the basics (though it will cover them briefly). [[git-mini-primer]] === Git Mini Primer @@ -475,7 +490,6 @@ For users, for most things, there is very little difference. However, if you have local changes, you can use the same tool to manage them as you use to pull in changes from FreeBSD. All changes that you have not pushed are local and can easily be modified (git rebase, discussed below does this). - ===== Keeping local changes The simplest way to keep local changes (especially trivial ones) is to use 'git stash'. In its simples form, you use 'git stash' to record the changes (which pushes them onto the stash stack). @@ -685,9 +699,8 @@ Eventually, when you are ready to commit your work back to main, you can perform === MFC (Merge From Current) Procedures ==== Summary -MFC workflow can be summarized as `git cherry-pick -x` plus git commit ---amend to adjust the commit message. For multiple commits, use `git rebase -i` -to squash them together and edit the commit message. +MFC workflow can be summarized as `git cherry-pick -x` plus git commit--amend to adjust the commit message. +For multiple commits, use `git rebase -i` to squash them together and edit the commit message. ==== Single commit MFC @@ -697,8 +710,8 @@ to squash them together and edit the commit message. % git cherry-pick -x $HASH --edit .... -For MFC commits, for example a vendor import, you would need to specify one parent for cherry-pick -purposes. Normally, that would be the "first parent" of the branch you are cherry-picking from, so: +For MFC commits, for example a vendor import, you would need to specify one parent for cherry-pick purposes. +Normally, that would be the "first parent" of the branch you are cherry-picking from, so: [source,shell] .... @@ -706,11 +719,10 @@ purposes. Normally, that would be the "first parent" of the branch you are cher % git cherry-pick -x $HASH -m 1 --edit .... -If things go wrong, you'll either need to abort the cherry-pick with `git cherry-pick --abort` or fix it -up and do a `git cherry-pick --continue`. +If things go wrong, you'll either need to abort the cherry-pick with `git cherry-pick --abort` or fix it up and do a `git cherry-pick --continue`. -Once the cherry-pick is finished, push with `git push`. If you get an error due to losing the commit race, -use `git pull --rebase` and try to push again. +Once the cherry-pick is finished, push with `git push`. +If you get an error due to losing the commit race, use `git pull --rebase` and try to push again. ==== MFC to RELENG branch @@ -764,22 +776,20 @@ Once the MFC is complete, you can delete the temporary branch: ==== MFC a vendor import -Vendor imports are the only thing in the tree that creates a merge -commit in the main line. Cherry picking merge commits into stable/XX -presents an additional difficulty because there are two parents for a -merge commit. Generally, you'll want the first parent's diff since -that's the diff to mainline (though there may be some exceptions). +Vendor imports are the only thing in the tree that creates a merge commit in the main line. +Cherry picking merge commits into stable/XX presents an additional difficulty because there are two parents for a merge commit. +Generally, you'll want the first parent's diff since that's the diff to mainline (though there may be some exceptions). [source,shell] .... % git cherry-pick -x -m 1 $HASH .... -is typically what you want. This will tell cherry-pick to apply the correct diff. +is typically what you want. +This will tell cherry-pick to apply the correct diff. -There are some, hopefully, rare cases where it's possible that the -mainline was merged backwards by the conversion script. Should that be -the case (and we've not found any yet), you'd change the above to '-m 2' -to pickup the proper parent. Just do +There are some, hopefully, rare cases where it's possible that the mainline was merged backwards by the conversion script. +Should that be the case (and we've not found any yet), you'd change the above to '-m 2' to pickup the proper parent. +Just do [source,shell] .... % git cherry-pick --abort @@ -800,8 +810,7 @@ using 'git rebase -i' is better. ==== Considerations when MFCing -When committing source commits to stable and releng branches, we have -the following goals: +When committing source commits to stable and releng branches, we have the following goals: * Clearly mark direct commits distinct from commits that land a change from another branch. * Avoid introducing known breakage into stable and releng branches. @@ -813,118 +822,73 @@ With subversion, we used the following practices to achieve these goals: * Squashing fixup commits into the main commit when merging a change. * Recording mergeinfo so that `svn mergeinfo --show-revs` worked. -With Git, we will need to use different strategies to achieve the same -goals. This document aims to define best practices when merging -source commits using git that achieve these goals. In general, we aim -to use git's native support to achieve these goals rather than -enforcing practices built on subversion's model. +With Git, we will need to use different strategies to achieve the same goals. +This document aims to define best practices when merging source commits using git that achieve these goals. +In general, we aim to use git's native support to achieve these goals rather than enforcing practices built on subversion's model. -One general note: due to technical differences with Git, we will not -be using git "merge commits" (created via `git merge`) in stable or -releng branches. Instead, when this document refers to "merge -commits", it means a commit originally made to `main` that is -replicated or "landed" to a stable branch, or a commit from a stable -branch that is replicated to a releng branch with some varation of -`git cherry-pick`. +One general note: due to technical differences with Git, we will not be using git "merge commits" (created via `git merge`) in stable or releng branches. +Instead, when this document refers to "merge commits", it means a commit originally made to `main` that is replicated or "landed" to a stable branch, or a commit from a stable branch that is replicated to a releng branch with some varation of `git cherry-pick`. ==== Finding Eligible Hashes to MFC -Git provides some built-in support for this via the `git cherry` and -`git log --cherry` commands. These commands compare the raw diffs of -commits (but not other metadata such as log messages) to determine if -two commits are identical. This works well when each commit from head -is landed as a single commit to a stable branch, but it falls over if -multiple commits from main are squashed together as a single commit to -a stable branch. +Git provides some built-in support for this via the `git cherry` and `git log --cherry` commands. +These commands compare the raw diffs of commits (but not other metadata such as log messages) to determine if two commits are identical. +This works well when each commit from head is landed as a single commit to a stable branch, but it falls over if multiple commits from main are squashed together as a single commit to a stable branch. There are a few options for resolving this: -1. We could ban squashing of commits and instead require that committers - stage all of the fixup / follow-up commits to stable into a single - push. This would still achieve the goal of stability in stable and - releng branches since pushes are atomic and users doing a simple pull - will never end up with a tree that has the main commit without the - fixup(s). `git bisect` is also able to cope with this model via - `git bisect skip`. - -2. We could adopt a consistent style for describing MFCs and write - our own tooling to wrap around `git cherry` to determine the list - of eligible commits. A simple approach here might be to use the - syntax from `git cherry-pick -x`, but require that a squashed - commit list all of the hashes (one line per hash) at the end of - the commit message. Developers could do this by using - `git cherry-pick -x` of each individual commit into a branch and - then use `git rebase` to squash the commits down into a single - commit, but collecting the `-x` annotations at the end of the - landed commit log. +1. We could ban squashing of commits and instead require that committers stage all of the fixup / follow-up commits to stable into a single push. +This would still achieve the goal of stability in stable and releng branches since pushes are atomic and users doing a simple pull will never end up with a tree that has the main commit without the fixup(s). +`git bisect` is also able to cope with this model via `git bisect skip`. + +2. We could adopt a consistent style for describing MFCs and write our own tooling to wrap around `git cherry` to determine the list of eligible commits. +A simple approach here might be to use the syntax from `git cherry-pick -x`, but require that a squashed commit list all of the hashes (one line per hash) at the end of the commit message. +Developers could do this by using `git cherry-pick -x` of each individual commit into a branch and then use `git rebase` to squash the commits down into a single commit, but collecting the `-x` annotations at the end of the landed commit log. ==== Commit message standards ===== Marking MFCs The project has adopted the following practice for marking MFCs: -* Use the `-x` flag with `git cherry-pick`. This adds a line to the - commit message that includes the hash of the original commit when - merging. Since it is added by Git directly, committers do not have - to manually edit the commit log when merging. +* Use the `-x` flag with `git cherry-pick`. This adds a line to the commit message that includes the hash of the original commit when merging. Since it is added by Git directly, committers do not have to manually edit the commit log when merging. When merging multiple commits, keep all the "cherry picked from" lines. ===== Trim Metadata? -One area that was not clearly documented with subversion (or even CVS) -is how to format metadata in log messages for MFC commits. Should -it include the metadata from the original commit unchanged, or should -it be altered to reflect information about the MFC commit itself? - -Historical practice has varied, though some of the variance is by -field. For example, MFCs that are relevant to a PR generally -include the PR field in the MFC so that MFC commits are included -in the bug tracker's audit trail. Other fields are less clear. For -example, Phabricator shows the diff of the last commit tagged to a -review, so including Phabricator URLs replaces the `main` commit with -the landed commits. The list of reviewers is also not clear. If a -reviewer has approved a change to `main`, does that mean they have -approved the MFC commit? Is that true if it's identical code only, -or with merely trivial reworkes? It's clearly not true for more -extensive reworks. Even for identical code what if the commit doesn't -conflict but introduces an ABI change? A reviewer may have ok'd a -commit for `main` due to the ABI breakage but may not approve of -merging the same commit as-is. One will have to use one's best -judgement until clear guidelines can be agreed upon. - -For MFCs regulated by re@, new metadata fields are added, such as -the Approved by tag for approved commits. This new metadata will have -to be added via `git commit --amend` or similar after the original -commit has been reviewed and approved. We may also want to reserve -some metadata fields in MFC commits such as Phabricator URLs for use -by re@ in the future. +One area that was not clearly documented with subversion (or even CVS) is how to format metadata in log messages for MFC commits. +Should it include the metadata from the original commit unchanged, or should it be altered to reflect information about the MFC commit itself? + +Historical practice has varied, though some of the variance is by field. +For example, MFCs that are relevant to a PR generally include the PR field in the MFC so that MFC commits are included in the bug tracker's audit trail. +Other fields are less clear. +For example, Phabricator shows the diff of the last commit tagged to a review, so including Phabricator URLs replaces the `main` commit with the landed commits. +The list of reviewers is also not clear. +If a reviewer has approved a change to `main`, does that mean they have approved the MFC commit? Is that true if it's identical code only, or with merely trivial reworkes? It's clearly not true for more extensive reworks. +Even for identical code what if the commit doesn't conflict but introduces an ABI change? A reviewer may have ok'd a commit for `main` due to the ABI breakage but may not approve of merging the same commit as-is. +One will have to use one's best judgement until clear guidelines can be agreed upon. + +For MFCs regulated by re@, new metadata fields are added, such as the Approved by tag for approved commits. +This new metadata will have to be added via `git commit --amend` or similar after the original commit has been reviewed and approved. +We may also want to reserve some metadata fields in MFC commits such as Phabricator URLs for use by re@ in the future. Preserving existing metadata provides a very simple workflow. -Developers can just use `git cherry-pick -x` without having to edit -the log message. +Developers can just use `git cherry-pick -x` without having to edit the log message. -If instead we choose to adjust metadata in MFCs, developers will -have to edit log messages explicitly via the use of `git cherry-pick ---edit` or `git commit --amend`. However, as compared to svn, at -least the existing commit message can be pre-populated and metadata -fields can be added or removed without having to re-enter the entire -commit message. +If instead we choose to adjust metadata in MFCs, developers will have to edit log messages explicitly via the use of `git cherry-pick --edit` or `git commit --amend`. +However, as compared to svn, at least the existing commit message can be pre-populated and metadata fields can be added or removed without having to re-enter the entire commit message. -The bottom line is that developers will likely need to curate their -commit message for MFCs that are non-trivial. +The bottom line is that developers will likely need to curate their commit message for MFCs that are non-trivial. ==== Examples ===== Merging a Single Subversion Commit -This walks through the process of merging a commit to stable/12 that -was originally committed to head in Subversion. In this case, the -original commit is r368685. +This walks through the process of merging a commit to stable/12 that was originally committed to head in Subversion. +In this case, the original commit is r368685. -The first step is to map the Subversion commit to a Git hash. Once -you have fetched refs/notes/commits, you can pass the revision number -to `git log --grep`: +The first step is to map the Subversion commit to a Git hash. +Once you have fetched refs/notes/commits, you can pass the revision number to `git log --grep`: [source,shell] .... @@ -952,10 +916,9 @@ git checkout stable/12 git cherry-pick -x ce8395ecfda2c8e332a2adf9a9432c2e7f35ea81 --edit .... -Git will invoke the editor. Use this to remove the metadata that only -applied to the original commit (Phabricator URL and Reviewed by). -After the editor saves the updated log message, Git completes the -commit: +Git will invoke the editor. +Use this to remove the metadata that only applied to the original commit (Phabricator URL and Reviewed by). +After the editor saves the updated log message, Git completes the commit: [source,shell] .... @@ -1012,12 +975,10 @@ To gitrepo-dev.FreeBSD.org:src.git ===== Merging a Single Subversion Commit with a Conflict -This example is similar to the previous example except that the -commit in question encounters a merge conflict. In this case, the -original commit is r368314. +This example is similar to the previous example except that the commit in question encounters a merge conflict. +In this case, the original commit is r368314. -As above, the first step is to map the Subversion commit to a Git -hash: +As above, the first step is to map the Subversion commit to a Git hash: [source,shell] .... @@ -1056,11 +1017,9 @@ hint: with 'git add ' or 'git rm ' hint: and commit the result with 'git commit' .... -In this case, the commit encountered a merge conflict in -sys/dev/cxge/tom/t4_cpl_io.c as kernel TLS is not present in -stable/12. Note that Git does not invoke an editor to adjust the -commit message due to the conflict. `git status` confirms that this -file has merge conflicts: +In this case, the commit encountered a merge conflict in sys/dev/cxge/tom/t4_cpl_io.c as kernel TLS is not present in stable/12. +Note that Git does not invoke an editor to adjust the commit message due to the conflict. +`git status` confirms that this file has merge conflicts: [source,shell] .... @@ -1080,8 +1039,7 @@ Unmerged paths: no changes added to commit (use "git add" and/or "git commit -a") .... -After editing the file to resolve the conflict, `git status` shows the -conflict as resolved: +After editing the file to resolve the conflict, `git status` shows the conflict as resolved: [source,shell] .... @@ -1183,8 +1141,8 @@ To gitrepo.FreeBSD.org:src.git This section describes the vendor import procedure with Git in detail. ==== Branch naming convention -All vendor branches and tags start with `vendor/`. These branches and -tags are visible by default. + +All vendor branches and tags start with `vendor/`. These branches and tags are visible by default. [NOTE] ==== @@ -1192,19 +1150,21 @@ This chapter follows the convention that the `freebsd` origin is the origin name If you use a different convention, replace `freebsd` with the name you use instead in the examples below. ==== - We will explore an example for updating NetBSD's mtree that is in our tree. The vendor branch for this is `vendor/NetBSD/mtree`. ==== Updating an old vendor import + The vendor trees usually have only the subset of the third-party software that is appropriate to FreeBSD. These trees are usually tiny in comparison to the FreeBSD tree. Git worktrees are thus quite small and fast and the preferred method to use. Make sure that whatever directory you choose below (the `../mtree`) does not currently exist. + [source,shell] .... % git worktree add ../mtree vendor/NetBSD/mtree .... + ==== Update the Sources in the Vendor Branch Prepare a full, clean tree of the vendor sources. Import everything but merge only what is needed. @@ -1212,6 +1172,7 @@ Prepare a full, clean tree of the vendor sources. Import everything but merge on This example assumes the NetBSD checked out from their GitHub mirror in `~/git/NetBSD`. Note that "upstream" might have added or removed files, so we want to make sure deletions are propagated as well. rsync(1) is commonly installed, so I'll use that. + [source,shell] .... % cd ../mtree @@ -1227,9 +1188,8 @@ rsync(1) is commonly installed, so I'll use that. % git tag -a vendor/NetBSD/mtree/20201211 .... -Note: I run the `git diff` and `git status` commands to make sure nothing weird -was present. Also I used `-m` to illustrate, but you should compose a proper -message in an editor (using a commit message template). +Note: I run the `git diff` and `git status` commands to make sure nothing weird was present. +Also I used `-m` to illustrate, but you should compose a proper message in an editor (using a commit message template). It is also important to create an annotated tag, otherwise the push will be rejected. Only annotated tags are allowed to be pushed. @@ -1237,26 +1197,33 @@ The annotated tag gives you a chance to enter a commit message. Enter the version you are importing, along with any salient new features or fixes in that version. ==== Updating the FreeBSD Copy + At this point you can push the import to vendor into our repo. + [source,shell] .... % git push --follow-tags freebsd vendor/NetBSD/mtree .... `--follow-tags` tells `git push` to also push tags associated with the locally committed revision. + ==== Updating the FreeBSD source tree -Now you need to update the mtree in FreeBSD. The sources live in -`contrib/mtree` since it is upstream software. + +Now you need to update the mtree in FreeBSD. +The sources live in `contrib/mtree` since it is upstream software. + [source,shell] .... % cd ../src % git subtree merge -P contrib/mtree vendor/NetBSD/mtree .... -This would generate a subtree merge commit of `contrib/mtree` against the local `vendor/NetBSD/mtree` branch. If there were conflicts, you would need to fix them before committing. + +This would generate a subtree merge commit of `contrib/mtree` against the local `vendor/NetBSD/mtree` branch. +If there were conflicts, you would need to fix them before committing. ==== Rebasing your change against latest FreeBSD source tree -Because the current policy recommends against using merges, if the upstream FreeBSD `main` moved forward -before you get a chance to push, you would have to redo the merge. + +Because the current policy recommends against using merges, if the upstream FreeBSD `main` moved forward before you get a chance to push, you would have to redo the merge. Regular `git rebase` or `git pull --rebase` doesn't know how to rebase a merge commit **as a merge commit**, so instead of that you would have to recreate the commit. @@ -1272,39 +1239,47 @@ The easiest way to do this would be to create a side branch with the **contents* .... Typically, there would be no merge conflicts here (because developers tend to work on different components). -In the worst case scenario, you would still have to resolve merge conflicts, if there was any, but this -should be really rare. +In the worst case scenario, you would still have to resolve merge conflicts, if there was any, but this should be really rare. Now, checkout `freebsd/main` again as `new_merge`, and redo the merge: + [source,shell] .... % git checkout -b new_merge freebsd/main % git subtree merge -P contrib/mtree vendor/NetBSD/mtree .... + Instead of resolving the conflicts, perform this instead: + [source,shell] .... % git checkout merge_result . .... + Which will overwrite the files with conflicts with the version found in `merge_result`. Examine the tree against `merge_result` to make sure that you haven't missed deleted files: + [source,shell] .... % git diff merge_result .... + ==== Pushing the changes + Once you are sure that you have a set of deltas you think is good, you can push it to a fork off github or gitlab for others to review. One nice thing about Git is that it allows you to publish rough drafts of your work for others to review. While phabricator is good for content review, publishing the updated vendor branch and merge commits lets others check the details as they will eventually appear in the repository. After review, when you are sure it is a good change, you can push it to the FreeBSD repo: + [source,shell] .... % git push freebsd main .... === Creating a new vendor branch + There are a number of ways to create a new vendor branch. The recommended way is to create a new repository and then merge that with FreeBSD. If one is importing `glorbnitz` into the FreeBSD tree, release 3.1415. @@ -1312,6 +1287,7 @@ For the sake of simplicity, we will not trim this release. It is a simple user command that puts the nitz device into different magical glorb states and is small enough trimming will not save much. ==== Create the repo + [source,shell] .... % cd /some/where @@ -1320,14 +1296,16 @@ It is a simple user command that puts the nitz device into different magical glo % git init % git checkout -b vendor/glorbnitz .... -At this point, you have a new repo, where all new commits will go on -the `vendor/glorbnitz` branch. + +At this point, you have a new repo, where all new commits will go on the `vendor/glorbnitz` branch. Git experts can also do this right in their FreeBSD clone, using `git checkout --orphan vendor/glorbnitz` if they are more comfortable with that. ==== Copy the sources in + Since this is a new import, you can just cp the sources in, or use tar or even rsync as shown above. And we will add everything, assuming no dot files. + [source,shell] .... % cp -r ~/glorbnitz/* . @@ -1340,26 +1318,29 @@ At this point, you should have a pristine copy of glorbnitz ready to commit. .... % git commit -m"Import GlorbNitz frobnosticator revision 3.1415" .... + As above, I used `-m` for simplicity, but you should likely create a commit message that explains what a Glorb is and why you'd use a Nitz to get it. Not everybody will know. But for your actual commit, you should follow the <> section instead of emulating the brief style used here. ==== Now import it into our repository + Now you need to import the branch into our repository. + [source,shell] .... % cd /path/to/freebsd/repo/src % git remote add glorbnitz /some/where/glorbnitz % git fetch glorbnitz vendor/glorbnitz .... -Note the vendor/glorbnitz branch is in the repo. At this point the -`/some/where/glorbnitz` can be deleted, if you like. It was only a means -to an end. + +Note the vendor/glorbnitz branch is in the repo. At this point the `/some/where/glorbnitz` can be deleted, if you like. +It was only a means to an end. ==== Tag and push -Steps from here on out are much the same as they are in the case of -updating a vendor branch, though without the updating the vendor -branch step. + +Steps from here on out are much the same as they are in the case of updating a vendor branch, though without the updating the vendor branch step. + [source,shell] .... % git worktree add ../glorbnitz vendor/glorbnitz @@ -1368,6 +1349,7 @@ branch step. # Make sure the commit is good with "git show" % git push --follow-tags freebsd vendor/glorbnitz .... + By 'good' we mean: . All the right files are present @@ -1377,6 +1359,7 @@ By 'good' we mean: . The commit message for the tag has a quick summary of what's new since the last tag ==== Time to finally merge it into the base tree + [source,shell] .... % cd ../src @@ -1385,6 +1368,7 @@ By 'good' we mean: % git commit --amend # one last sanity check on commit message % git push freebsd .... + Here 'good' means: . All the right files, and none of the wrong ones, were merged into contrib/glorbnitz. @@ -1421,10 +1405,12 @@ If you have no changes pending, the migration is straightforward. In this, you abandon the Subversion tree and clone the Git repository. It's likely best to retain your subversion tree, in case there's something you've forgotten about there. First, let's clone the repository: + [source,shell] .... % git clone -o freebsd --config remote.freebsd.fetch='+refs/notes/*:refs/notes/*' https://git.freebsd.org/src.git freebsd-src .... + will create a clone of the FreeBSD src repository into a subdirectory called `freebsd-src` and include the 'notes' about the revisions. We are currently mirroring the source repository to https://github.com/freebsd/freebsd-src.git as well. https://github.com/freebsd/freebsd-legacy.git has the old github mirror with the old hashes should you need that for your migration. @@ -1436,16 +1422,19 @@ It's useful to have the old Subversion revisions available. This data is stored using Git notes, but Git doesn't fetch those by default. The --config and the argument above changed the default to fetch the notes. If you've cloned the repository without this, or wish to add notes to a previously cloned repository, use the following commands: + [source,shell] .... % git config --add remote.freebsd.fetch "+refs/notes/*:refs/notes/*" % git fetch .... + At this point you have the src checked out into a Git tree, ready to do other things. ===== But I have changes that I've not committed If you are migrating from a tree that has changes you've not yet committed to FreeBSD, you'll need to follow the steps from the previous section first, and then follow these. + [source,shell] .... % cd path-to-svn-checkout-tree @@ -1453,6 +1442,7 @@ If you are migrating from a tree that has changes you've not yet committed to Fr % cd _mumble_/freebsd-src % git checkout -b working .... + This will create a diff of your current changes. The last command creates a branch called `working` though you can call it whatever you want. @@ -1460,6 +1450,7 @@ The last command creates a branch called `working` though you can call it whatev .... % git apply /tmp/src.diff .... + this will apply all your pending changes to the working tree. This doesn't commit the change, so you'll need to make this permanent: @@ -1489,6 +1480,7 @@ Alternatively, `git pull --rebase` is useful if you have changes staged in the m .... % git config --global pull.ff only .... + You may need to omit the --global if you want this setting to apply to only this repository. [source,shell] @@ -1511,10 +1503,9 @@ The longer form is also recommended. % git merge --ff-only freebsd/main .... -These commands reset your tree to the main branch, and then update it -from where you pulled the tree from originally. It's important to -switch to `main` before doing this so it moves forward. Now, it's time -to move the changes forward: +These commands reset your tree to the main branch, and then update it from where you pulled the tree from originally. +It's important to switch to `main` before doing this so it moves forward. +Now, it's time to move the changes forward: [source,shell] .... @@ -1529,29 +1520,35 @@ https://docs.github.com/en/free-pro-team@latest/github/using-git/resolving-merge ===== Time to push changes upstream -First, ensure that the push URL is properly configured for the upstream -repository. +First, ensure that the push URL is properly configured for the upstream repository. + [source,shell] .... % git remote set-url --push freebsd ssh://git@gitrepo.freebsd.org/src.git .... -Then, verify that user name and email are configured right. We require -that they exactly match the passwd entry in FreeBSD cluster. Use +Then, verify that user name and email are configured right. +We require that they exactly match the passwd entry in FreeBSD cluster. + +Use + [source,shell] .... freefall% gen-gitconfig.sh .... + on freefall.freebsd.org to get a recipe that you can use directly, assuming /usr/local/bin is in the PATH. The below command merges the 'working' branch into the upstream main line. It's important that you curate your changes to be just like you want them in the FreeBSD source repo before doing this. + [source,shell] .... % git push freebsd working:main .... If your push is rejected due to losing a commit race, rebase your branch before trying again: + [source,shell] .... % git checkout working @@ -1562,39 +1559,36 @@ If your push is rejected due to losing a commit race, rebase your branch before ===== Finding the Subversion Revision -You'll need to make sure that you've fetched the notes (see the `No -staged changes migration` section above for details. Once you have -these, notes will show up in the git log command like so: +You'll need to make sure that you've fetched the notes (see the `No staged changes migration` section above for details. +Once you have these, notes will show up in the git log command like so: + [source,shell] .... % git log .... If you have a specific version in mind, you can use this construct: + [source,shell] .... % git log --grep revision=XXXX .... -to find the specific revision. The hex number after 'commit' is the -hash you can use to refer to this commit. +to find the specific revision. +The hex number after 'commit' is the hash you can use to refer to this commit. ==== Migrating from GitHub fork -Note: as of this writing, https://github.com/freebsd/freebsd-src -is mirroring all official branches, along with a `master` branch which -is the legacy svn2git result. The `master` branch will not be updated anymore, -and the [last commit](https://github.com/freebsd/freebsd-src/commit/de1aa3dab23c06fec962a14da3e7b4755c5880cf) -contains the instructions for migrating to the new `main` branch. -We'll retain the `master` branch for a certain time, but in the future it will only be kept in the -[freebsd-legacy](https://github.com/freebsd/freebsd-legacy) repository. - -When migrating branches from a github fork from the old github mirror -to the official repo, the process is straight forward. This assumes that -you have a `freebsd` upstream pointing to github, adjust if necessary. +Note: as of this writing, https://github.com/freebsd/freebsd-src is mirroring all official branches, along with a `master` branch which is the legacy svn2git result. +The `master` branch will not be updated anymore, and the link:https://github.com/freebsd/freebsd-src/commit/de1aa3dab23c06fec962a14da3e7b4755c5880cf[last commit] contains the instructions for migrating to the new `main` branch. +We'll retain the `master` branch for a certain time, but in the future it will only be kept in the link:https://github.com/freebsd/freebsd-legacy[freebsd-legacy] repository. + +When migrating branches from a github fork from the old github mirror to the official repo, the process is straight forward. +This assumes that you have a `freebsd` upstream pointing to github, adjust if necessary. This also assumes a clean tree before starting... ===== Add the new `freebsd` upstream repository: + [source,shell] .... % git remote add freebsd https://git.freebsd.org/src.git @@ -1603,26 +1597,29 @@ This also assumes a clean tree before starting... .... ===== Rebase all your WIP branches. + For each branch FOO, do the following after fetching the `freebsd` sources and creating a local `main` branch with the above checkout: + [source,shell] .... % git rebase -i freebsd/master FOO --onto main .... + And you'll now be tracking the official repository. You can then follow the `Keeping Current` section above to stay up to date. If you need to then commit work to FreeBSD, you can do so following the `Time to push changes upstream` instructions. You'll need to do the following once to update the push URL if you are a FreeBSD committer: + [source,shell] .... % git remote set-url --push freebsd ssh://git@gitrepo.freebsd.org/src.git .... + (note that gitrepo.freebsd.org will be change to repo.freebsd.org in the future.) -You will also need to add `freebsd` as the location to push to. The -author recommends that your upstream github repository remain the default -push location so that you only push things into FreeBSD you intend to -by making it explicit. +You will also need to add `freebsd` as the location to push to. +The author recommends that your upstream github repository remain the default push location so that you only push things into FreeBSD you intend to by making it explicit. [[git-faq]] === Git FAQ @@ -1639,32 +1636,33 @@ people to use that for their own development and to minimize "whoopse" pushes to ===== How do I track -current and -stable with only one copy of the repository? -**Q:** Although disk space is not a huge issue, it's more efficient to use -only one copy of the repository. With SVN mirroring, I could checkout -multiple trees from the same repository. How do I do this with Git? +**Q:** Although disk space is not a huge issue, it's more efficient to use only one copy of the repository. +With SVN mirroring, I could checkout multiple trees from the same repository. +How do I do this with Git? -**A:** You can use Git worktrees. There's a number of ways to do this, -but the simplest way is to use a clone to track -current, and a -worktree to track stable releases. While using a 'bare repository' -has been put forward as a way to cope, it's more complicated and will not -be documented here. +**A:** You can use Git worktrees. +There's a number of ways to do this, but the simplest way is to use a clone to track -current, and a worktree to track stable releases. +While using a 'bare repository' has been put forward as a way to cope, it's more complicated and will not be documented here. + +First, you need to clone the FreeBSD repository, shown here cloning into `freebsd-current` to reduce confusion. +$URL is whatever mirror works best for you: -First, you need to clone the FreeBSD repository, shown here cloning into -`freebsd-current` to reduce confusion. $URL is whatever mirror works -best for you: [source,shell] .... % git clone -o freebsd --config remote.freebsd.fetch='+refs/notes/*:refs/notes/*' $URL freebsd-current .... + then once that's cloned, you can simply create a worktree from it: + [source,shell] .... % cd freebsd-current % git worktree add ../freebsd-stable-12 stable/12 .... -this will checkout `stable/12` into a directory named `freebsd-stable-12` -that's a peer to the `freebsd-current` directory. Once created, it's updated -very similarly to how you might expect: + +this will checkout `stable/12` into a directory named `freebsd-stable-12` that's a peer to the `freebsd-current` directory. +Once created, it's updated very similarly to how you might expect: + [source,shell] .... % cd freebsd-current @@ -1675,10 +1673,8 @@ very similarly to how you might expect: % git merge --ff-only freebsd/stable/12 # now your stable/12 is up to date too .... -I recommend using `--ff-only` because it's safer and you avoid -accidentally getting into a 'merge nightmare' where you have an extra -change in your tree, forcing a complicated merge rather than a simple -one. + +I recommend using `--ff-only` because it's safer and you avoid accidentally getting into a 'merge nightmare' where you have an extra change in your tree, forcing a complicated merge rather than a simple one. Here's https://adventurist.me/posts/00296[a good writeup] that goes into more detail. @@ -1686,17 +1682,16 @@ Here's https://adventurist.me/posts/00296[a good writeup] that goes into more de ===== Ooops! I committed to `main` instead of a branch. -**Q:** From time to time, I goof up and commit to main instead of to a -branch. What do I do? +**Q:** From time to time, I goof up and commit to main instead of to a branch. What do I do? **A:** First, don't panic. -Second, don't push. In fact, you can fix almost anything if you -haven't pushed. All the answers in this section assume no push -has happened. +Second, don't push. +In fact, you can fix almost anything if you haven't pushed. +All the answers in this section assume no push has happened. + +The following answer assumes you committed to `main` and want to create a branch called `issue`: -The following answer assumes you committed to `main` and want to -create a branch called `issue`: [source,shell] .... % git branch issue # Create the 'issue' branch @@ -1706,15 +1701,12 @@ create a branch called `issue`: ===== Ooops! I committed something to the wrong branch! -**Q:** I was working on feature on the `wilma` branch, but -accidentally committed a change relevant to the `fred` branch -in 'wilma'. What do I do? +**Q:** I was working on feature on the `wilma` branch, but accidentally committed a change relevant to the `fred` branch in 'wilma'. +What do I do? -**A:** The answer is similar to the previous one, but with -cherry picking. This assumes there's only one commit on wilma, -but will generalize to more complicated situations. It also -assumes that it's the last commit on wilma (hence using wilma -in the `git cherry-pick` command), but that too can be generalized. +**A:** The answer is similar to the previous one, but with cherry picking. +This assumes there's only one commit on wilma, but will generalize to more complicated situations. +It also assumes that it's the last commit on wilma (hence using wilma in the `git cherry-pick` command), but that too can be generalized. [source,shell] .... @@ -1724,37 +1716,30 @@ in the `git cherry-pick` command), but that too can be generalized. % git checkout wilma # go back to wilma branch % git reset --hard HEAD^ # move what wilma refers to back 1 commit .... -Git experts would first rewind the wilma branch by 1 commit, switch over to -fred and then use `git reflog` to see what that 1 deleted commit was and + +Git experts would first rewind the wilma branch by 1 commit, switch over to fred and then use `git reflog` to see what that 1 deleted commit was and cherry-pick it over. -**Q:** But what if I want to commit a few changes to `main`, but -keep the rest in `wilma` for some reason? +**Q:** But what if I want to commit a few changes to `main`, but keep the rest in `wilma` for some reason? -**A:** The same technique above also works if you are wanting to -'land' parts of the branch you are working on into `main` before the -rest of the branch is ready (say you noticed an unrelated typo, or -fixed an incidental bug). You can cherry pick those changes into main, -then push to the parent repository. Once you've done that, cleanup couldn't -be simpler: just `git rebase -i`. Git will notice you've done -this and skip the common changes automatically (even if you had to -change the commit message or tweak the commit slightly). There's no -need to switch back to wilma to adjust it: just rebase! +**A:** The same technique above also works if you are wanting to 'land' parts of the branch you are working on into `main` before the rest of the branch is ready (say you noticed an unrelated typo, or fixed an incidental bug). +You can cherry pick those changes into main, then push to the parent repository. +Once you've done that, cleanup couldn't be simpler: just `git rebase -i`. +Git will notice you've done this and skip the common changes automatically (even if you had to change the commit message or tweak the commit slightly). +There's no need to switch back to wilma to adjust it: just rebase! **Q:** I want to split off some changes from branch `wilma` into branch `fred` -**A:** The more general answer would be the same as the -previous. You'd checkout/create the `fred` branch, cherry pick the -changes you want from `wilma` one at a time, then rebase `wilma` to -remove those changes you cherry picked. `git rebase -i main wilma` -will toss you into an editor, and remove the `pick` lines that -correspond to the commits you copied to `fred`. If all goes well, -and there are no conflicts, you're done. If not, you'll need to -resolve the conflicts as you go. +**A:** The more general answer would be the same as the previous. +You'd checkout/create the `fred` branch, cherry pick the changes you want from `wilma` one at a time, then rebase `wilma` to remove those changes you cherry picked. +`git rebase -i main wilma` will toss you into an editor, and remove the `pick` lines that correspond to the commits you copied to `fred`. +If all goes well, and there are no conflicts, you're done. +If not, you'll need to resolve the conflicts as you go. The other way to do this would be to checkout `wilma` and then create the branch `fred` to point to the same point in the tree. You can then `git rebase -i` both these branches, selecting the changes you want in `fred` or `wilma` by retaining the pick likes, and deleting the rest from the editor. Some people would create a tag/branch called `pre-split` before starting in case something goes wrong in the split, you can undo it with the following sequence: + [source,shell] .... % git checkout pre-split # Go back @@ -1762,21 +1747,20 @@ Some people would create a tag/branch called `pre-split` before starting in case % git checkout -B wilma # reset the wilma branch % git branch -d pre-split # Pretend it didn't happen .... + The last step is optional. If you are going to try again to split, you'd omit it. -**Q:** But I did things as I read along and didn't see your advice at -the end to create a branch, and now `fred` and `wilma` are all -screwed up. How do I find what `wilma` was before I started. I don't -know how many times I moved things around. +**Q:** But I did things as I read along and didn't see your advice at the end to create a branch, and now `fred` and `wilma` are all screwed up. +How do I find what `wilma` was before I started. +I don't know how many times I moved things around. + +**A:** All is not lost. You can figure out it, so long as it hasn't been too long, or too many commits (hundreds). -**A:** All is not lost. You can figure out it, so long as it hasn't -been too long, or too many commits (hundreds). +So I created a wilma branch and committed a couple of things to it, then decided I wanted to split it into fred and wilma. +Nothing weird happened when I did that, but let's say it did. +The way to look at what you've done is with the `git reflog`: -So I created a wilma branch and committed a couple of things to it, then -decided I wanted to split it into fred and wilma. Nothing weird -happened when I did that, but let's say it did. The way to look at -what you've done is with the `git reflog`: [source,shell] .... % git reflog @@ -1807,16 +1791,19 @@ While we don't need it here, you can figure out exactly what happened. Fortunately, to fix this, you can follow the prior answer's steps, but with the hash `869cbd3` instead of `pre-split`. While that seems a bit verbose, it's easy to remember since you're doing one thing at a time. You can also stack: + [source,shell] .... % git checkout -B wilma 869cbd3 % git branch -D fred .... + and you are ready to try again. The 'checkout -B' with the hash combines checking out and creating a branch for it. The -B instead of -b forces the movement of a pre-existing branch. Either way works, which is what's great (and awful) about Git. One reason I tend to use `git checkout -B xxxx hash` instead of checking out the hash, and then creating / moving the branch is purely to avoid the slightly distressing message about detached heads: + [source,shell] .... % git checkout 869cbd3 @@ -1835,25 +1822,28 @@ do so (now or later) by using -b with the checkout command again. Example: HEAD is now at 869cbd3 Encourage contributions % git checkout -B wilma .... + this produces the same effect, but I have to read a lot more and severed heads aren't an image I like to contemplate. ===== Ooops! I did a 'git pull' and it created a merge commit, what do I do? -**Q:** I was on autopilot and did a 'git pull' for my development tree and -that created a merge commit on the mainline. How do I recover? +**Q:** I was on autopilot and did a 'git pull' for my development tree and that created a merge commit on the mainline. +How do I recover? + +**A:** This can happen when you invoke the pull with your development branch checked out. -**A:** This can happen when you invoke the pull with your development branch -checked out. +Right after the pull, you will have the new merge commit checked out. +Git supports a `HEAD^#` syntax to examine the parents of a merge commit: -Right after the pull, you will have the new merge commit checked out. Git -supports a `HEAD^#` syntax to examine the parents of a merge commit: [source,shell] .... git log --oneline HEAD^1 # Look at the first parent's commits git log --oneline HEAD^2 # Look at the second parent's commits .... -From those logs, you can easily identify which commit is your development -work. Then you simply reset your branch to the corresponding `HEAD^#`: + +From those logs, you can easily identify which commit is your development work. +Then you simply reset your branch to the corresponding `HEAD^#`: + [source,shell] .... git reset --hard HEAD^2 @@ -1861,13 +1851,14 @@ git reset --hard HEAD^2 **Q:** But I also need to fix my 'main' branch. How do I do that? -**A:** Git keeps track of the remote repository branches in a `freebsd/` -namespace. To fix your 'main' branch, just make it point to the remote's -'main': +**A:** Git keeps track of the remote repository branches in a `freebsd/` namespace. +To fix your 'main' branch, just make it point to the remote's 'main': + [source,shell] .... git branch -f main freebsd/main .... + There's nothing magical about branches in git: they are just labels on a graph that are automatically moved forward by making commits. So the above works because you're just moving a label. There's no metadata about the branch that needs to be preserved due to this. @@ -1885,6 +1876,7 @@ while maintaining the commits in both. % git checkout -b feature # create a new branch % git cherry-pick main..async # bring in the changes .... + You now have a new branch called `feature`. This branch combines commits from both branches. You can further curate it with `git rebase`. @@ -1900,23 +1892,23 @@ lifting here. % git checkout -b kernel # Create kernel branch % git checkout -b userland # Create userland branch .... -Now you have two identical branches. So, it's time to separate out the commits. -We'll assume first that all the commits in `driver` go into either the `kernel` -or the `userland` branch, but not both. + +Now you have two identical branches. +So, it's time to separate out the commits. +We'll assume first that all the commits in `driver` go into either the `kernel` or the `userland` branch, but not both. [source,shell] .... % git rebase -i main kernel .... -and just include the changes you want (with a 'p' or 'pick' line) and -just delete the commits you don't (this sounds scary, but if worse -comes to worse, you can throw this all away and start over with the -`driver` branch since you've not yet moved it). + +and just include the changes you want (with a 'p' or 'pick' line) and just delete the commits you don't (this sounds scary, but if worse comes to worse, you can throw this all away and start over with the `driver` branch since you've not yet moved it). [source,shell] .... % git rebase -i main userland .... + and do the same thing you did with the `kernel` branch. **Q:** Oh great! I followed the above and forgot a commit in the `kernel` branch. @@ -1924,6 +1916,7 @@ How do I recover? **A:** You can use the `driver` branch to find the hash of the commit is missing and cherry pick it. + [source,shell] .... % git checkout kernel @@ -1931,38 +1924,41 @@ cherry pick it. % git cherry-pick $HASH .... -**Q:** OK. I have the same situation as the above, but my commits are all mixed up. I need -parts of one commit to go to one branch and the rest to go to the other. In fact, I have -several. Your rebase method to select sounds tricky. +**Q:** OK. I have the same situation as the above, but my commits are all mixed up. +I need parts of one commit to go to one branch and the rest to go to the other. +In fact, I have several. +Your rebase method to select sounds tricky. **A:** In this situation, you'd be better off to curate the original branch to separate out the commits, and then use the above method to split the branch. -So let's assume that there's just one commit with a clean tree. You -can either use `git rebase` with an `edit` line, or you can use this -with the commit on the tip. The steps are the same either way. The -first thing we need to do is to back up one commit while leaving the -changes uncommitted in the tree: +So let's assume that there's just one commit with a clean tree. +You can either use `git rebase` with an `edit` line, or you can use this with the commit on the tip. +The steps are the same either way. +The first thing we need to do is to back up one commit while leaving the changes uncommitted in the tree: + [source,shell] .... % git reset HEAD^ .... + Note: Do not, repeat do not, add `--hard` here since that also removes the changes from your tree. -Now, if you are lucky, the change needing to be split up falls entirely along file lines. In that -case you can just do the usual `git add` for the files in each group than do a `git commit`. Note: -when you do this, you'll lose the commit message when you do the reset, so if you need it for -some reason, you should save a copy (though `git log $HASH` can recover it). +Now, if you are lucky, the change needing to be split up falls entirely along file lines. +In that case you can just do the usual `git add` for the files in each group than do a `git commit`. +Note: when you do this, you'll lose the commit message when you do the reset, so if you need it for some reason, you should save a copy (though `git log $HASH` can recover it). + +If you are not lucky, you'll need to split apart files. +There's another tool to do that which you can apply one file at a time. -If you are not lucky, you'll need to split apart files. There's another tool to do that which you -can apply one file at a time. [source,shell] .... git add -i foo/bar.c .... + will step through the diffs, prompting you, one at time, whether to include or exclude the hunk. -Once you're done, `git commit` and you'll have the remainder in your tree. You can run it -multiple times as well, and even over multiple files (though I find it easier to do one file at a time +Once you're done, `git commit` and you'll have the remainder in your tree. +You can run it multiple times as well, and even over multiple files (though I find it easier to do one file at a time and use the `git rebase -i` to fold the related commits together). ==== Cloning and Mirroring @@ -1970,16 +1966,19 @@ and use the `git rebase -i` to fold the related commits together). **Q:** I'd like to mirror the entire git repository, how do I do that? **A:** If all you want to do is mirror, then + [source,shell] .... % git clone --mirror $URL .... -will do the trick. However, there are two disadvantages to this if you -want to use it for anything other than a mirror you'll reclone. -First, this is a 'bare repository' which has the repository database, but no -checked out worktree. This is great for mirroring, but terrible for day to -day work. There's a number of ways around this with 'git worktree': +will do the trick. +However, there are two disadvantages to this if you want to use it for anything other than a mirror you'll reclone. + +First, this is a 'bare repository' which has the repository database, but no checked out worktree. +This is great for mirroring, but terrible for day to day work. +There's a number of ways around this with 'git worktree': + [source,shell] .... % git clone --mirror https://cgit.freebsd.org/ports.git ports.git @@ -1988,57 +1987,71 @@ day work. There's a number of ways around this with 'git worktree': % git worktree add ../quarterly branches/2020Q4 % cd ../ports .... + But if you aren't using your mirror for further local clones, then it's a poor match. -The second disadvantage is that Git normally rewrites the refs (branch name, tags, etc) -from upstream so that your local refs can evolve independently of -upstream. This means that you'll lose changes if you are committing to -this repository on anything other than private project branches. +The second disadvantage is that Git normally rewrites the refs (branch name, tags, etc) from upstream so that your local refs can evolve independently of upstream. +This means that you'll lose changes if you are committing to this repository on anything other than private project branches. **Q:** So what can I do instead? -**A:** Well, you can stuff all of the upstream repository's refs into a private -namespace in your local repository. Git clones everything via a 'refspec' and -the default refspec is: +**A:** Well, you can stuff all of the upstream repository's refs into a private namespace in your local repository. +Git clones everything via a 'refspec' and the default refspec is: + [source,shell] .... fetch = +refs/heads/*:refs/remotes/freebsd/* .... + which says just fetch the branch refs. -However, the FreeBSD repository has a number of other things in it. To see -those, you can add explicit refspecs for each ref namespace, or you -can fetch everything. To setup your repository to do that: +However, the FreeBSD repository has a number of other things in it. +To see those, you can add explicit refspecs for each ref namespace, or you can fetch everything. +To setup your repository to do that: + [source,shell] .... git config --add remote.freebsd.fetch '+refs/*:refs/freebsd/*' .... + which will put everything in the upstream repository into your local repository's 'ref/freebsd/' namespace. Please note, that this also grabs all the unconverted vendor branches and the number of refs associated with them is quite large. You'll need to refer to these 'refs' with their full name because they aren't in and of Git's regular namespaces. + [source,shell] .... git log refs/freebsd/vendor/zlib/1.2.10 .... -would look at the log for the vendor branch for zlib starting at 1.2.10. +would look at the log for the vendor branch for zlib starting at 1.2.10. [[subversion-primer]] == Subversion Primer -New committers are assumed to already be familiar with the basic operation of Subversion. If not, start by reading the http://svnbook.red-bean.com/[Subversion Book]. +New committers are assumed to already be familiar with the basic operation of Subversion. +If not, start by reading the http://svnbook.red-bean.com/[Subversion Book]. -This section is relevant only for the ports tree. Information on Git is being worked into the handbook and other documents. A draft version can be found at https://github.com/bsdimp/freebsd-git-docs/blob/main/SUMMARY.adoc +This section is relevant only for the ports tree. Information on Git is being worked into the handbook and other documents. +A draft version can be found at https://github.com/bsdimp/freebsd-git-docs/blob/main/SUMMARY.adoc [[svn-intro]] === Introduction -The FreeBSD source repository switched from CVS to Subversion on May 31st, 2008. The first real SVN commit is __r179447__. The source repository switched from Subversion to Git on December 23rd, 2020. The last real svn commit is __r368820__. The first real git commit hash is __5ef5f51d2bef80b0ede9b10ad5b0e9440b60518c__ +The FreeBSD source repository switched from CVS to Subversion on May 31st, 2008. +The first real SVN commit is __r179447__. +The source repository switched from Subversion to Git on December 23rd, 2020. +The last real svn commit is __r368820__. +The first real git commit hash is __5ef5f51d2bef80b0ede9b10ad5b0e9440b60518c__ -The FreeBSD `doc/www` repository switched from CVS to Subversion on May 19th, 2012. The first real SVN commit is __r38821__. The documentation repository switched from Subversion to Git on December 8th, 2020. The last SVN commit is __r54737__. The first real git commit hash is __3be01a475855e7511ad755b2defd2e0da5d58bbe__. +The FreeBSD `doc/www` repository switched from CVS to Subversion on May 19th, 2012. +The first real SVN commit is __r38821__. +The documentation repository switched from Subversion to Git on December 8th, 2020. +The last SVN commit is __r54737__. +The first real git commit hash is __3be01a475855e7511ad755b2defd2e0da5d58bbe__. -The FreeBSD `ports` repository switched from CVS to Subversion on July 14th, 2012. The first real SVN commit is __r300894__. +The FreeBSD `ports` repository switched from CVS to Subversion on July 14th, 2012. +The first real SVN commit is __r300894__. Subversion can be installed from the FreeBSD Ports Collection by issuing these commands: @@ -2050,12 +2063,14 @@ Subversion can be installed from the FreeBSD Ports Collection by issuing these c [[svn-getting-started]] === Getting Started -There are a few ways to obtain a working copy of the tree from Subversion. This section will explain them. +There are a few ways to obtain a working copy of the tree from Subversion. +This section will explain them. [[svn-getting-started-direct-checkout]] ==== Direct Checkout -The first is to check out directly from the main repository. For the `src` tree, use: +The first is to check out directly from the main repository. +For the `src` tree, use: [source,shell] .... @@ -2078,12 +2093,15 @@ For the `ports` tree, use: [NOTE] ==== -Though the remaining examples in this document are written with the workflow of working with the `src` tree in mind, the underlying concepts are the same for working with the `doc` and the `ports` tree. Ports related Subversion operations are listed in <>. +Though the remaining examples in this document are written with the workflow of working with the `src` tree in mind, the underlying concepts are the same for working with the `doc` and the `ports` tree. +Ports related Subversion operations are listed in <>. ==== -The above command will check out a `CURRENT` source tree as [.filename]#/usr/src/#, which can be any target directory on the local filesystem. Omitting the final argument of that command causes the working copy, in this case, to be named "head", but that can be renamed safely. +The above command will check out a `CURRENT` source tree as [.filename]#/usr/src/#, which can be any target directory on the local filesystem. +Omitting the final argument of that command causes the working copy, in this case, to be named "head", but that can be renamed safely. -`svn+ssh` means the SVN protocol tunnelled over SSH. The name of the server is `repo.freebsd.org`, `base` is the path to the repository, and `head` is the subdirectory within the repository. +`svn+ssh` means the SVN protocol tunnelled over SSH. +The name of the server is `repo.freebsd.org`, `base` is the path to the repository, and `head` is the subdirectory within the repository. If your FreeBSD login name is different from the login name used on the local machine, either include it in the URL (for example `svn+ssh://jarjar@repo.freebsd.org/base/head`), or add an entry to [.filename]#~/.ssh/config# in the form: @@ -2097,15 +2115,20 @@ This is the simplest method, but it is hard to tell just yet how much load it wi [NOTE] ==== -The `svn diff` does not require access to the server as SVN stores a reference copy of every file in the working copy. This, however, means that Subversion working copies are very large in size. +The `svn diff` does not require access to the server as SVN stores a reference copy of every file in the working copy. +This, however, means that Subversion working copies are very large in size. ==== [[git-getting-started-base-layout]] ==== `RELENG_*` Branches and General Layout -In `ssh://gitrepo.freebsd.org/src.git`, _src_ refers to the source tree. Similarly, _ports_ refers to the ports tree, and so on. These are separate repositories with their own change number sequences, access controls and commit mail. +In `ssh://gitrepo.freebsd.org/src.git`, _src_ refers to the source tree. +Similarly, _ports_ refers to the ports tree, and so on. +These are separate repositories with their own change number sequences, access controls and commit mail. -For the src repository, `main` refers to the -CURRENT tree. For example, [.filename]#head/bin/ls# is what would go into [.filename]#/usr/src/bin/ls# in a release. Some key branches are: +For the src repository, `main` refers to the -CURRENT tree. +For example, [.filename]#head/bin/ls# is what would go into [.filename]#/usr/src/bin/ls# in a release. +Some key branches are: * _main_ which corresponds to `HEAD`, also known as `-CURRENT`. * _stable/n_ which corresponds to `RELENG_n`. @@ -2122,21 +2145,24 @@ In general, most FreeBSD Documentation Project work will be done within the `mai FreeBSD documentation is written and/or translated to various languages, each in a separate directory in the `main` branch. -Each translation set contains several subdirectories for the various parts of the FreeBSD Documentation Project. A few noteworthy directories are: +Each translation set contains several subdirectories for the various parts of the FreeBSD Documentation Project. +A few noteworthy directories are: * _documentation/_ contains all the source code for the documentation part of the tree. * _documentation/content/LANG/articles/_ contains the source code for articles written by various FreeBSD contributors. * _documentation/content/LANG/books/_ contains the source code for the different books, such as the FreeBSD Handbook. * _website/_ contains the source code for the FreeBSD website. -LANG above is the two character language code. All document source is encoded using Unicode. +LANG above is the two character language code. +All document source is encoded using Unicode. [[svn-getting-started-ports-layout]] ==== FreeBSD Ports Tree Branches and Layout In `svn+ssh://repo.freebsd.org/ports`, _ports_ refers to the repository root of the ports tree. -In general, most FreeBSD port work will be done within the [.filename]#head/# branch of the ports tree which is the actual ports tree used to install software. Some other key locations are: +In general, most FreeBSD port work will be done within the [.filename]#head/# branch of the ports tree which is the actual ports tree used to install software. +Some other key locations are: * /branches/RELENG_n_n_n which corresponds to `RELENG_n_n_n` is used to merge back security updates in preparation for a release. * /tags/RELEASE_n_n_n which corresponds to `RELEASE_n_n_n` represents a release tag of the ports tree. @@ -2150,7 +2176,8 @@ This section will explain how to perform common day-to-day operations with Subve [[svn-daily-use-help]] ==== Help -SVN has built in help documentation. It can be accessed by typing: +SVN has built in help documentation. +It can be accessed by typing: [source,shell] .... @@ -2169,7 +2196,8 @@ As seen earlier, to check out the FreeBSD head branch: % svn checkout svn+ssh://repo.freebsd.org/base/head /usr/src .... -At some point, more than just `HEAD` will probably be useful, for instance when merging changes to stable/7. Therefore, it may be useful to have a partial checkout of the complete tree (a full checkout would be very painful). +At some point, more than just `HEAD` will probably be useful, for instance when merging changes to stable/7. +Therefore, it may be useful to have a partial checkout of the complete tree (a full checkout would be very painful). To do this, first check out the root of the repository: @@ -2180,7 +2208,8 @@ To do this, first check out the root of the repository: This will give `base` with all the files it contains (at the time of writing, just [.filename]#ROADMAP.txt#) and empty subdirectories for `head`, `stable`, `vendor` and so on. -Expanding the working copy is possible. Just change the depth of the various subdirectories: +Expanding the working copy is possible. +Just change the depth of the various subdirectories: [source,shell] .... @@ -2197,7 +2226,8 @@ If at a later date merging to `7-STABLE` is required, expand the working copy: % svn up --set-depth=infinity base/stable/7 .... -Subtrees do not have to be expanded completely. For instance, expanding only `stable/7/sys` and then later expand the rest of `stable/7`: +Subtrees do not have to be expanded completely. +For instance, expanding only `stable/7/sys` and then later expand the rest of `stable/7`: [source,shell] .... @@ -2210,7 +2240,9 @@ Updating the tree with `svn update` will only update what was previously asked f [[svn-daily-use-anonymous-checkout]] ==== Anonymous Checkout -It is possible to anonymously check out the FreeBSD repository with Subversion. This will give access to a read-only tree that can be updated, but not committed back to the main repository. To do this, use: +It is possible to anonymously check out the FreeBSD repository with Subversion. +This will give access to a read-only tree that can be updated, but not committed back to the main repository. +To do this, use: [source,shell] .... @@ -2278,10 +2310,13 @@ There is also a commit wrapper for the ports tree to handle the properties and s [NOTE] ==== -Before adding files, get a copy of https://people.FreeBSD.org/~peter/auto-props.txt[auto-props.txt] (there is also a https://people.FreeBSD.org/~beat/cvs2svn/auto-props.txt[ports tree specific version]) and add it to [.filename]#~/.subversion/config# according to the instructions in the file. If you added something before reading this, use `svn rm --keep-local` for just added files, fix your config file and re-add them again. The initial config file is created when you first run a svn command, even something as simple as `svn help`. +Before adding files, get a copy of https://people.FreeBSD.org/~peter/auto-props.txt[auto-props.txt] (there is also a https://people.FreeBSD.org/~beat/cvs2svn/auto-props.txt[ports tree specific version]) and add it to [.filename]#~/.subversion/config# according to the instructions in the file. +If you added something before reading this, use `svn rm --keep-local` for just added files, fix your config file and re-add them again. +The initial config file is created when you first run a svn command, even something as simple as `svn help`. ==== -Files are added to a SVN repository with `svn add`. To add a file named __foo__, edit it, then: +Files are added to a SVN repository with `svn add`. +To add a file named __foo__, edit it, then: [source,shell] .... @@ -2290,7 +2325,9 @@ Files are added to a SVN repository with `svn add`. To add a file named __foo__, [NOTE] ==== -Most new source files should include a `$FreeBSD$` string near the start of the file. On commit, `svn` will expand the `$FreeBSD$` string, adding the file path, revision number, date and time of commit, and the username of the committer. Files which cannot be modified may be committed without the `$FreeBSD$` string. +Most new source files should include a `$FreeBSD$` string near the start of the file. +On commit, `svn` will expand the `$FreeBSD$` string, adding the file path, revision number, date and time of commit, and the username of the committer. +Files which cannot be modified may be committed without the `$FreeBSD$` string. ==== Files can be removed with `svn remove`: @@ -2317,7 +2354,8 @@ Although `svn mkdir` makes this easier by combining the creation of the director % svn mkdir bar .... -Like files, directories are removed with `svn rm`. There is no separate command specifically for removing directories. +Like files, directories are removed with `svn rm`. +There is no separate command specifically for removing directories. [source,shell] .... @@ -2346,14 +2384,16 @@ To move and rename a file: [[svn-daily-use-log-and-annotate]] ==== Log and Annotate -`svn log` shows revisions and commit messages, most recent first, for files or directories. When used on a directory, all revisions that affected the directory and files within that directory are shown. +`svn log` shows revisions and commit messages, most recent first, for files or directories. +When used on a directory, all revisions that affected the directory and files within that directory are shown. `svn annotate`, or equally `svn praise` or `svn blame`, shows the most recent revision number and who committed that revision for each line of a file. [[svn-daily-use-diffs]] ==== Diffs -`svn diff` displays changes to the working copy. Diffs generated by SVN are unified and include new files by default in the diff output. +`svn diff` displays changes to the working copy. +Diffs generated by SVN are unified and include new files by default in the diff output. `svn diff` can show the changes between two revisions of the same file: @@ -2362,7 +2402,8 @@ To move and rename a file: % svn diff -r179453:179454 ROADMAP.txt .... -It can also show all changes for a specific changeset. This command shows what changes were made to the current directory and all subdirectories in changeset 179454: +It can also show all changes for a specific changeset. +This command shows what changes were made to the current directory and all subdirectories in changeset 179454: [source,shell] .... @@ -2372,12 +2413,14 @@ It can also show all changes for a specific changeset. This command shows what c [[svn-daily-use-reverting]] ==== Reverting -Local changes (including additions and deletions) can be reverted using `svn revert`. It does not update out-of-date files, but just replaces them with pristine copies of the original version. +Local changes (including additions and deletions) can be reverted using `svn revert`. +It does not update out-of-date files, but just replaces them with pristine copies of the original version. [[svn-daily-use-conflicts]] ==== Conflicts -If an `svn update` resulted in a merge conflict, Subversion will remember which files have conflicts and refuse to commit any changes to those files until explicitly told that the conflicts have been resolved. The simple, not yet deprecated procedure is: +If an `svn update` resulted in a merge conflict, Subversion will remember which files have conflicts and refuse to commit any changes to those files until explicitly told that the conflicts have been resolved. +The simple, not yet deprecated procedure is: [source,shell] .... @@ -2391,7 +2434,8 @@ However, the preferred procedure is: % svn resolve --accept=working foo .... -The two examples are equivalent. Possible values for `--accept` are: +The two examples are equivalent. +Possible values for `--accept` are: * `working`: use the version in your working directory (which one presumes has been edited to resolve the conflicts). * `base`: use a pristine copy of the version you had before `svn update`, discarding your own changes, the conflicting changes, and possibly other intervening changes as well. @@ -2414,7 +2458,8 @@ Valid arguments to `--depth` are: The `--depth` option applies to many other commands, including `svn commit`, `svn revert`, and `svn diff`. -Since `--depth` is sticky, there is a `--set-depth` option for `svn update` that will change the selected depth. Thus, given the working copy produced by the previous example: +Since `--depth` is sticky, there is a `--set-depth` option for `svn update` that will change the selected depth. +Thus, given the working copy produced by the previous example: [source,shell] .... @@ -2422,7 +2467,8 @@ Since `--depth` is sticky, there is a `--set-depth` option for `svn update` that % svn update --set-depth=immediates . .... -The above command will populate the working copy in _~/freebsd_ with [.filename]#ROADMAP.txt# and empty subdirectories, and nothing will happen when `svn update` is executed on the subdirectories. However, this command will set the depth for _head_ (in this case) to infinity, and fully populate it: +The above command will populate the working copy in _~/freebsd_ with [.filename]#ROADMAP.txt# and empty subdirectories, and nothing will happen when `svn update` is executed on the subdirectories. +However, this command will set the depth for _head_ (in this case) to infinity, and fully populate it: [source,shell] .... @@ -2432,7 +2478,8 @@ The above command will populate the working copy in _~/freebsd_ with [.filename] [[svn-advanced-use-direct-operation]] ==== Direct Operation -Certain operations can be performed directly on the repository without touching the working copy. Specifically, this applies to any operation that does not require editing a file, including: +Certain operations can be performed directly on the repository without touching the working copy. +Specifically, this applies to any operation that does not require editing a file, including: * `log`, `diff` * `mkdir` @@ -2440,7 +2487,8 @@ Certain operations can be performed directly on the repository without touching * `propset`, `propedit`, `propdel` * `merge` -Branching is very fast. This command would be used to branch `RELENG_8`: +Branching is very fast. +This command would be used to branch `RELENG_8`: [source,shell] .... @@ -2470,15 +2518,21 @@ In all examples below, `$FSVN` refers to the location of the FreeBSD Subversion ===== About Merge Tracking -From the user's perspective, merge tracking information (or mergeinfo) is stored in a property called `svn:mergeinfo`, which is a comma-separated list of revisions and ranges of revisions that have been merged. When set on a file, it applies only to that file. When set on a directory, it applies to that directory and its descendants (files and directories) except for those that have their own `svn:mergeinfo`. +From the user's perspective, merge tracking information (or mergeinfo) is stored in a property called `svn:mergeinfo`, which is a comma-separated list of revisions and ranges of revisions that have been merged. +When set on a file, it applies only to that file. +When set on a directory, it applies to that directory and its descendants (files and directories) except for those that have their own `svn:mergeinfo`. -It is _not_ inherited. For instance, [.filename]#stable/6/contrib/openpam/# does not implicitly inherit mergeinfo from [.filename]#stable/6/#, or [.filename]#stable/6/contrib/#. Doing so would make partial checkouts very hard to manage. Instead, mergeinfo is explicitly propagated down the tree. For merging something into [.filename]#branch/foo/bar/#, these rules apply: +It is _not_ inherited. +For instance, [.filename]#stable/6/contrib/openpam/# does not implicitly inherit mergeinfo from [.filename]#stable/6/#, or [.filename]#stable/6/contrib/#. Doing so would make partial checkouts very hard to manage. +Instead, mergeinfo is explicitly propagated down the tree. +For merging something into [.filename]#branch/foo/bar/#, these rules apply: . If [.filename]#branch/foo/bar/# does not already have a mergeinfo record, but a direct ancestor (for instance, [.filename]#branch/foo/#) does, then that record will be propagated down to [.filename]#branch/foo/bar/# before information about the current merge is recorded. . Information about the current merge will _not_ be propagated back up that ancestor. . If a direct descendant of [.filename]#branch/foo/bar/# (for instance, [.filename]#branch/foo/bar/baz/#) already has a mergeinfo record, information about the current merge will be propagated down to it. -If you consider the case where a revision changes several separate parts of the tree (for example, [.filename]#branch/foo/bar/# and [.filename]#branch/foo/quux/#), but you only want to merge some of it (for example, [.filename]#branch/foo/bar/#), you will see that these rules make sense. If mergeinfo was propagated up, it would seem like that revision had also been merged to [.filename]#branch/foo/quux/#, when in fact it had not been. +If you consider the case where a revision changes several separate parts of the tree (for example, [.filename]#branch/foo/bar/# and [.filename]#branch/foo/quux/#), but you only want to merge some of it (for example, [.filename]#branch/foo/bar/#), you will see that these rules make sense. +If mergeinfo was propagated up, it would seem like that revision had also been merged to [.filename]#branch/foo/quux/#, when in fact it had not been. [[merge-source]] ===== Selecting the Source and Target Branch When Merging @@ -2491,7 +2545,8 @@ Merging to `stable/` branches should originate from `head/`. For example: % svn commit stable/11 .... -Merges to `releng/` branches should always originate from the corresponding `stable/` branch. For example: +Merges to `releng/` branches should always originate from the corresponding `stable/` branch. +For example: [source,shell] .... @@ -2521,7 +2576,9 @@ Note that _checkout_ must be a complete checkout of the branch to which the merg ===== Preparing the Merge Target -Due to the mergeinfo propagation issues described earlier, it is very important to never merge changes into a sparse working copy. Always use a full checkout of the branch being merged into. For instance, when merging from HEAD to 7, use a full checkout of stable/7: +Due to the mergeinfo propagation issues described earlier, it is very important to never merge changes into a sparse working copy. +Always use a full checkout of the branch being merged into. +For instance, when merging from HEAD to 7, use a full checkout of stable/7: [source,shell] .... @@ -2533,7 +2590,8 @@ The target directory must also be up-to-date and must not contain any uncommitte ===== Identifying Revisions -Identifying revisions to be merged is a must. If the target already has complete mergeinfo, ask SVN for a list: +Identifying revisions to be merged is a must. +If the target already has complete mergeinfo, ask SVN for a list: [source,shell] .... @@ -2585,7 +2643,11 @@ If the results are not exactly as shown, assistance may be required before commi ====== Practical Example -As a practical example, consider this scenario. The changes to [.filename]#netmap.4# in r238987 are to be merged from CURRENT to 9-STABLE. The file resides in [.filename]#head/shared/man/man4#. According to <>, this is also where to do the merge. Note that in this example all paths are relative to the top of the svn repository. For more information on the directory layout, see <>. +As a practical example, consider this scenario. +The changes to [.filename]#netmap.4# in r238987 are to be merged from CURRENT to 9-STABLE. +The file resides in [.filename]#head/shared/man/man4#. According to <>, this is also where to do the merge. +Note that in this example all paths are relative to the top of the svn repository. +For more information on the directory layout, see <>. The first step is to inspect the existing mergeinfo. @@ -2606,7 +2668,8 @@ U stable/9/shared/man/man4/netmap.4 U stable/9/shared/man/man4 .... -Check that the revision number of the merged revision has been added. Once this is verified, the only thing left is the actual commit. +Check that the revision number of the merged revision has been added. +Once this is verified, the only thing left is the actual commit. [source,shell] .... @@ -2617,15 +2680,19 @@ Check that the revision number of the merged revision has been added. Once this As always, build world (or appropriate parts of it). -Check the changes with svn diff and `svn stat`. Make sure all the files that should have been added or deleted were in fact added or deleted. +Check the changes with svn diff and `svn stat`. +Make sure all the files that should have been added or deleted were in fact added or deleted. -Take a closer look at any property change (marked by a `M` in the second column of `svn stat`). Normally, no svn:mergeinfo properties should be anywhere except the target directory (or directories). +Take a closer look at any property change (marked by a `M` in the second column of `svn stat`). +Normally, no svn:mergeinfo properties should be anywhere except the target directory (or directories). If something looks fishy, ask for help. ===== Committing -Make sure to commit a top level directory to have the mergeinfo included as well. Do not specify individual files on the command line. For more information about committing files in general, see the relevant section of this primer. +Make sure to commit a top level directory to have the mergeinfo included as well. +Do not specify individual files on the command line. +For more information about committing files in general, see the relevant section of this primer. [[svn-advanced-use-reverting-a-commit]] ==== Reverting a Commit @@ -2658,7 +2725,9 @@ This can also be done directly in the repository: It is important to ensure that the mergeinfo is correct when reverting a file to permit `svn mergeinfo --eligible` to work as expected. ==== -Reverting the deletion of a file is slightly different. Copying the version of the file that predates the deletion is required. For example, to restore a file that was deleted in revision N, restore version N-1: +Reverting the deletion of a file is slightly different. +Copying the version of the file that predates the deletion is required. +For example, to restore a file that was deleted in revision N, restore version N-1: [source,shell] .... @@ -2678,30 +2747,43 @@ Do _not_ simply recreate the file manually and `svn add` it-this will cause hist [[svn-advanced-use-fixing-mistakes]] ==== Fixing Mistakes -While we can do surgery in an emergency, do not plan on having mistakes fixed behind the scenes. Plan on mistakes remaining in the logs forever. Be sure to check the output of `svn status` and `svn diff` before committing. +While we can do surgery in an emergency, do not plan on having mistakes fixed behind the scenes. +Plan on mistakes remaining in the logs forever. +Be sure to check the output of `svn status` and `svn diff` before committing. Mistakes will happen but, they can generally be fixed without disruption. -Take a case of adding a file in the wrong location. The right thing to do is to `svn move` the file to the correct location and commit. This causes just a couple of lines of metadata in the repository journal, and the logs are all linked up correctly. +Take a case of adding a file in the wrong location. +The right thing to do is to `svn move` the file to the correct location and commit. +This causes just a couple of lines of metadata in the repository journal, and the logs are all linked up correctly. -The wrong thing to do is to delete the file and then `svn add` an independent copy in the correct location. Instead of a couple of lines of text, the repository journal grows an entire new copy of the file. This is a waste. +The wrong thing to do is to delete the file and then `svn add` an independent copy in the correct location. +Instead of a couple of lines of text, the repository journal grows an entire new copy of the file. +This is a waste. [[svn-getting-started-checkout-from-a-mirror]] ==== Using a Subversion Mirror -There is a serious disadvantage to this method: every time something is to be committed, a `svn relocate` to the main repository has to be done, remembering to `svn relocate` back to the mirror after the commit. Also, since `svn relocate` only works between repositories that have the same UUID, some hacking of the local repository's UUID has to occur before it is possible to start using it. +There is a serious disadvantage to this method: every time something is to be committed, a `svn relocate` to the main repository has to be done, remembering to `svn relocate` back to the mirror after the commit. +Also, since `svn relocate` only works between repositories that have the same UUID, some hacking of the local repository's UUID has to occur before it is possible to start using it. [[svn-advanced-checkout-from-mirror]] ===== Checkout from a Mirror -Check out a working copy from a mirror by substituting the mirror's URL for `svn+ssh://repo.freebsd.org/base`. This can be an official mirror or a mirror maintained by using `svnsync`. +Check out a working copy from a mirror by substituting the mirror's URL for `svn+ssh://repo.freebsd.org/base`. +This can be an official mirror or a mirror maintained by using `svnsync`. [[svn-advanced-use-setting-up-svnsync]] ===== Setting up a svnsync Mirror -Avoid setting up a svnsync mirror unless there is a very good reason for it. Most of the time a `git` mirror is a better alternative. Starting a fresh mirror from scratch takes a long time. Expect a minimum of 10 hours for high speed connectivity. If international links are involved, expect this to take four to ten times longer. +Avoid setting up a svnsync mirror unless there is a very good reason for it. +Most of the time a `git` mirror is a better alternative. +Starting a fresh mirror from scratch takes a long time. +Expect a minimum of 10 hours for high speed connectivity. +If international links are involved, expect this to take four to ten times longer. -One way to limit the time required is to grab a https://download.freebsd.org/ftp/development/subversion/[seed file]. It is large (~1GB) but will consume less network traffic and take less time to fetch than svnsync will. +One way to limit the time required is to grab a https://download.freebsd.org/ftp/development/subversion/[seed file]. +It is large (~1GB) but will consume less network traffic and take less time to fetch than svnsync will. Extract the file and update it: @@ -2713,7 +2795,9 @@ Extract the file and update it: Now, set that up to run from man:cron[8], do checkouts locally, set up a svnserve server for local machines to talk to, etc. -The seed mirror is set to fetch from `svn://svn.freebsd.org/base`. The configuration for the mirror is stored in `revprop 0` on the local mirror. To see the configuration, try: +The seed mirror is set to fetch from `svn://svn.freebsd.org/base`. +The configuration for the mirror is stored in `revprop 0` on the local mirror. +To see the configuration, try: [source,shell] .... @@ -2725,7 +2809,9 @@ Use `svn propset` to change things. [[svn-advanced-use-committing-high-ascii-data]] ==== Committing High-ASCII Data -Files that have high-ASCII bits are considered binary files in SVN, so the pre-commit checks fail and indicate that the `mime-type` property should be set to `application/octet-stream`. However, the use of this is discouraged, so please do not set it. The best way is always avoiding high-ASCII data, so that it can be read everywhere with any text editor but if it is not avoidable, instead of changing the mime-type, set the `fbsd:notbinary` property with `propset`: +Files that have high-ASCII bits are considered binary files in SVN, so the pre-commit checks fail and indicate that the `mime-type` property should be set to `application/octet-stream`. +However, the use of this is discouraged, so please do not set it. +The best way is always avoiding high-ASCII data, so that it can be read everywhere with any text editor but if it is not avoidable, instead of changing the mime-type, set the `fbsd:notbinary` property with `propset`: [source,shell] .... @@ -2735,9 +2821,16 @@ Files that have high-ASCII bits are considered binary files in SVN, so the pre-c [[svn-advanced-use-maintaining-a-project-branch]] ==== Maintaining a Project Branch -A project branch is one that is synced to head (or another branch) is used to develop a project then commit it back to head. In SVN, "dolphin" branching is used for this. A "dolphin" branch is one that diverges for a while and is finally committed back to the original branch. During development code migration in one direction (from head to the branch only). No code is committed back to head until the end. After the branch is committed back at the end, it is dead (although a new branch with the same name can be created after the dead one is deleted). +A project branch is one that is synced to head (or another branch) is used to develop a project then commit it back to head. +In SVN, "dolphin" branching is used for this. +A "dolphin" branch is one that diverges for a while and is finally committed back to the original branch. +During development code migration in one direction (from head to the branch only). +No code is committed back to head until the end. +After the branch is committed back at the end, it is dead (although a new branch with the same name can be created after the dead one is deleted). -As per https://people.FreeBSD.org/\~peter/svn_notes.txt[https://people.FreeBSD.org/~peter/svn_notes.txt], work that is intended to be merged back into HEAD should be in [.filename]#base/projects/#. If the work is beneficial to the FreeBSD community in some way but not intended to be merged directly back into HEAD then the proper location is [.filename]#base/user/username/#. https://svnweb.freebsd.org/base/projects/GUIDELINES.txt[This page] contains further details. +As per https://people.FreeBSD.org/\~peter/svn_notes.txt[https://people.FreeBSD.org/~peter/svn_notes.txt], work that is intended to be merged back into HEAD should be in [.filename]#base/projects/#. +If the work is beneficial to the FreeBSD community in some way but not intended to be merged directly back into HEAD then the proper location is [.filename]#base/user/username/#. +https://svnweb.freebsd.org/base/projects/GUIDELINES.txt[This page] contains further details. To create a project branch: @@ -2778,7 +2871,8 @@ and then typing mkdir ~/.ssh/sockets .... -Checking out a working copy with a stock Subversion client without FreeBSD-specific patches (`OPTIONS_SET=FREEBSD_TEMPLATE`) will mean that `$FreeBSD$` tags will not be expanded. Once the correct version has been installed, trick Subversion into expanding them like so: +Checking out a working copy with a stock Subversion client without FreeBSD-specific patches (`OPTIONS_SET=FREEBSD_TEMPLATE`) will mean that `$FreeBSD$` tags will not be expanded. +Once the correct version has been installed, trick Subversion into expanding them like so: [source,shell] .... @@ -2788,7 +2882,8 @@ Checking out a working copy with a stock Subversion client without FreeBSD-speci This will wipe out uncommitted patches. -It is possible to automatically fill the "Sponsored by" and "MFC after" commit log fields by setting "freebsd-sponsored-by" and "freebsd-mfc-after" fields in the "[miscellany]" section of the [.filename]#~/.subversion/config# configuration file. For example: +It is possible to automatically fill the "Sponsored by" and "MFC after" commit log fields by setting "freebsd-sponsored-by" and "freebsd-mfc-after" fields in the "[miscellany]" section of the [.filename]#~/.subversion/config# configuration file. +For example: [.programlisting] .... @@ -2799,7 +2894,9 @@ freebsd-mfc-after = 2 weeks [[conventions]] == Setup, Conventions, and Traditions -There are a number of things to do as a new developer. The first set of steps is specific to committers only. These steps must be done by a mentor for those who are not committers. +There are a number of things to do as a new developer. +The first set of steps is specific to committers only. +These steps must be done by a mentor for those who are not committers. [[conventions-committers]] === For New Committers @@ -2965,11 +3062,15 @@ Where _yourlocalusername_ is the SASL username used to connect to the local inst [[mentors]] === Mentors -All new developers have a mentor assigned to them for the first few months. A mentor is responsible for teaching the mentee the rules and conventions of the project and guiding their first steps in the developer community. The mentor is also personally responsible for the mentee's actions during this initial period. +All new developers have a mentor assigned to them for the first few months. +A mentor is responsible for teaching the mentee the rules and conventions of the project and guiding their first steps in the developer community. +The mentor is also personally responsible for the mentee's actions during this initial period. -For committers: do not commit anything without first getting mentor approval. Document that approval with an `Approved by:` line in the commit message. +For committers: do not commit anything without first getting mentor approval. +Document that approval with an `Approved by:` line in the commit message. -When the mentor decides that a mentee has learned the ropes and is ready to commit on their own, the mentor announces it with a commit to [.filename]#conf/mentors#. This file is in the [.filename]#svnadmin# branch of each repository: +When the mentor decides that a mentee has learned the ropes and is ready to commit on their own, the mentor announces it with a commit to [.filename]#conf/mentors#. +This file is in the [.filename]#svnadmin# branch of each repository: [.informaltable] [cols="1,1", frame="none"] @@ -2988,7 +3089,9 @@ When the mentor decides that a mentee has learned the ropes and is ready to comm [[pre-commit-review]] == Pre-Commit Review -Code review is one way to increase the quality of software. The following guidelines apply to commits to the `head` (-CURRENT) branch of the `src` repository. Other branches and the `ports` and `docs` trees have their own review policies, but these guidelines generally apply to commits requiring review: +Code review is one way to increase the quality of software. +The following guidelines apply to commits to the `head` (-CURRENT) branch of the `src` repository. +Other branches and the `ports` and `docs` trees have their own review policies, but these guidelines generally apply to commits requiring review: * All non-trivial changes should be reviewed before they are committed to the repository. * Reviews may be conducted by email, in Bugzilla, in Phabricator, or by another mechanism. Where possible, reviews should be public. @@ -3005,9 +3108,13 @@ Sometimes code reviews will take longer than you would hope for, especially for + When making large changes, it is helpful to keep this in mind from the beginning of the effort as breaking large changes into smaller ones is often difficult after the fact. -Developers should participate in code reviews as both reviewers and reviewees. If someone is kind enough to review your code, you should return the favor for someone else. Note that while anyone is welcome to review and give feedback on a patch, only an appropriate subject-matter expert can approve a change. This will usually be a committer who works with the code in question on a regular basis. +Developers should participate in code reviews as both reviewers and reviewees. +If someone is kind enough to review your code, you should return the favor for someone else. +Note that while anyone is welcome to review and give feedback on a patch, only an appropriate subject-matter expert can approve a change. +This will usually be a committer who works with the code in question on a regular basis. -In some cases, no subject-matter expert may be available. In those cases, a review by an experienced developer is sufficient when coupled with appropriate testing. +In some cases, no subject-matter expert may be available. +In those cases, a review by an experienced developer is sufficient when coupled with appropriate testing. [[commit-log-message]] == Commit Log Messages @@ -3016,83 +3123,68 @@ This section contains some suggestions and traditions for how commit logs are fo === Why are commit messages important? -When you commit a change in Git, Subversion, or another version control system -(VCS), you're prompted to write some text describing the commit -- a commit -message. How important is this commit message? Should you spend some significant -effort writing it? Does it really matter if you write simply fixed a bug? +When you commit a change in Git, Subversion, or another version control system (VCS), you're prompted to write some text describing the commit -- a commit message. +How important is this commit message? Should you spend some significant effort writing it? Does it really matter if you write simply fixed a bug? Most projects have more than one developer and last for some length of time. -Commit messages are a very important method of communicating with other -developers, in the present and for the future. +Commit messages are a very important method of communicating with other developers, in the present and for the future. -FreeBSD has hundreds of active developers and hundreds of thousands of commits -spanning decades of history. Over that time the developer community has learned -how valuable good commit messages are; sometimes these are hard-learned lessons. +FreeBSD has hundreds of active developers and hundreds of thousands of commits spanning decades of history. +Over that time the developer community has learned how valuable good commit messages are; sometimes these are hard-learned lessons. Commit messages serve at least three purposes: * Communicating with other developers + -FreeBSD commits generate email to various mailing lists. These include the -commit message along with a copy of the patch itself. Commit messages are also -viewed through commands like git log. These serve to make other developers -aware of changes that are ongoing; that other developer may want to test the -change, may have an interest in the topic and will want to review in more -detail, or may have their own projects underway that would benefit from -interaction. +FreeBSD commits generate email to various mailing lists. +These include the commit message along with a copy of the patch itself. +Commit messages are also viewed through commands like git log. +These serve to make other developers aware of changes that are ongoing; that other developer may want to test the change, may have an interest in the topic and will want to review in more detail, or may have their own projects underway that would benefit from interaction. * Making Changes Discoverable + -In a large project with a long history it may be difficult to find changes of -interest when investigating an issue or change in behaviour. Verbose, detailed -commit messages allow searches for changes that might be relevant. For example, -`git log --since 1year --grep 'USB timeout'`. +In a large project with a long history it may be difficult to find changes of interest when investigating an issue or change in behaviour. +Verbose, detailed commit messages allow searches for changes that might be relevant. +For example, `git log --since 1year --grep 'USB timeout'`. * Providing historical documentation + -Commit messages serve to document changes for future developers, perhaps years -or decades later. This future developer may even be you, the original author. +Commit messages serve to document changes for future developers, perhaps years or decades later. +This future developer may even be you, the original author. A change that seems obvious today may be decidedly not so much later on. -The `git blame` command annotates each line of a source file with the change -(hash and subject line) that brought it in. +The `git blame` command annotates each line of a source file with the change (hash and subject line) that brought it in. -Having established the importance, here are elements of a good FreeBSD commit -message: +Having established the importance, here are elements of a good FreeBSD commit message: === Start with a subject line -Commit messages should start with a single-line subject that briefly summarizes -the change. The subject should, by itself, allow the reader to quickly -determine if the change is of interest or not. +Commit messages should start with a single-line subject that briefly summarizes the change. +The subject should, by itself, allow the reader to quickly determine if the change is of interest or not. === Keep subject lines short -The subject line should be as short as possible while still retaining the -required information. This is to make browsing git log more efficient, and so -that git log --oneline can display the short hash and subject on a single -80-column line. A good rule of thumb is to stay below 63 characters, and aim -for about 50 or fewer if possible. +The subject line should be as short as possible while still retaining the required information. +This is to make browsing git log more efficient, and so that git log --oneline can display the short hash and subject on a single 80-column line. +A good rule of thumb is to stay below 63 characters, and aim for about 50 or fewer if possible. === Prefix the subject line with a component, if applicable -If the change relates to a specific component the subject line may be prefixed -with that component name and a colon (:). +If the change relates to a specific component the subject line may be prefixed with that component name and a colon (:). ✓ `foo: Add -k option to keep temporary data` -Include the prefix in the 63-character limit suggested above, so that -`git log --oneline` avoids wrapping. +Include the prefix in the 63-character limit suggested above, so that `git log --oneline` avoids wrapping. === Capitalize the first letter of the subject -Capitalize the first letter of the subject itself. The prefix, if any, is not -capitalized unless necessary (e.g., `USB:` is capitalized). +Capitalize the first letter of the subject itself. +The prefix, if any, is not capitalized unless necessary (e.g., `USB:` is capitalized). === Do not end the subject line with punctuation -Do not end with a period or other punctuation. In this regard the subject line -is like a newspaper headline. +Do not end with a period or other punctuation. +In this regard the subject line is like a newspaper headline. === Separate the subject and body with a blank line @@ -3105,18 +3197,15 @@ Some trivial commits do not require a body, and will have only a subject. === Limit messages to 72 columns `git log` and `git format-patch` indent the commit message by four spaces. -Wrapping at 72 columns provides a matching margin on the right edge. Limiting -messages to 72 characters also keeps the commit message in formatted patches -below RFC 2822's suggested email line length limit of 78 characters. This limit -works well with a variety of tools that may render commit messages; line -wrapping might be inconsistent with longer line length. +Wrapping at 72 columns provides a matching margin on the right edge. +Limiting messages to 72 characters also keeps the commit message in formatted patches below RFC 2822's suggested email line length limit of 78 characters. +This limit works well with a variety of tools that may render commit messages; line wrapping might be inconsistent with longer line length. === Use the present tense, imperative mood -This facilitates short subject lines and provides consistency, including with -automatically generated commit messages (e.g., as generated by git revert). -This is important when reading a list of commit subjects. Think of the subject -as finishing the sentence "when applied, this change will ...". +This facilitates short subject lines and provides consistency, including with automatically generated commit messages (e.g., as generated by git revert). +This is important when reading a list of commit subjects. +Think of the subject as finishing the sentence "when applied, this change will ...". ✓ `foo: Implement the -k (keep) option` + ✗ `foo: Implemented the -k option` + @@ -3127,39 +3216,29 @@ as finishing the sentence "when applied, this change will ...". Explain what the change accomplishes and why it is being done, rather than how. -Do not assume that the reader is familiar with the issue. Explain the -background and motivation for the change. Include benchmark data if you have it. +Do not assume that the reader is familiar with the issue. +Explain the background and motivation for the change. +Include benchmark data if you have it. -If there are limitations or incomplete aspects of the change, describe them in -the commit message. +If there are limitations or incomplete aspects of the change, describe them in the commit message. === Consider whether parts of the commit message could be code comments instead -Sometimes while writing a commit message you may find yourself writing a -sentence or two explaining some tricky or confusing aspect of the change. When -this happens consider whether it would be valuable to have that explanation as -a comment in the code itself. +Sometimes while writing a commit message you may find yourself writing a sentence or two explaining some tricky or confusing aspect of the change. When this happens consider whether it would be valuable to have that explanation as a comment in the code itself. === Write commit messages for your future self -While writing the commit message for a change you have all of the context in -mind - what prompted the change, alternate approaches that were considered and -rejected, limitations of the change, and so on. Imagine yourself revisiting the -change a year or two in the future, and write the commit message in a way that -would provide that necessary context. +While writing the commit message for a change you have all of the context in mind - what prompted the change, alternate approaches that were considered and rejected, limitations of the change, and so on. +Imagine yourself revisiting the change a year or two in the future, and write the commit message in a way that would provide that necessary context. === Commit messages should stand alone -You may include references to mailing list postings, benchmark result web -sites, or code review links. However, the commit message should contain all of -the relevant information in case these references are no longer available in -the future. +You may include references to mailing list postings, benchmark result web sites, or code review links. +However, the commit message should contain all of the relevant information in case these references are no longer available in the future. -Similarly, a commit may refer to a previous commit, for example in the case of -a bug fix or revert. In addition to the commit identifier (revision or hash), -include the subject line from the referenced commit (or another suitable brief -reference). With each VCS migration (from CVS to Subversion to Git) revision -identifiers from previous systems may become difficult to follow. +Similarly, a commit may refer to a previous commit, for example in the case of a bug fix or revert. +In addition to the commit identifier (revision or hash), include the subject line from the referenced commit (or another suitable brief reference). +With each VCS migration (from CVS to Subversion to Git) revision identifiers from previous systems may become difficult to follow. === Include appropriate metadata in a footer @@ -3282,7 +3361,8 @@ The commit is based on a patch from a PR submitted by John Smith. The commit mes [example] ==== -The virtual memory system is being changed. After posting patches to the appropriate mailing list (in this case, `freebsd-arch`) and the changes have been approved. +The virtual memory system is being changed. +After posting patches to the appropriate mailing list (in this case, `freebsd-arch`) and the changes have been approved. [.programlisting] .... @@ -3342,7 +3422,9 @@ Where _2_ is the number of days, weeks, or months after which an MFC is planned. It is often necessary to combine these. -Consider the situation where a user has submitted a PR containing code from the NetBSD project. Looking at the PR, the developer sees it is not an area of the tree they normally work in, so they have the change reviewed by the `arch` mailing list. Since the change is complex, the developer opts to MFC after one month to allow adequate testing. +Consider the situation where a user has submitted a PR containing code from the NetBSD project. +Looking at the PR, the developer sees it is not an area of the tree they normally work in, so they have the change reviewed by the `arch` mailing list. +Since the change is complex, the developer opts to MFC after one month to allow adequate testing. The extra information to include in the commit would look something like @@ -3365,7 +3447,10 @@ Relnotes: yes [[pref-license]] == Preferred License for New Files -The FreeBSD Project's full license policy can be found at link:https://www.FreeBSD.org/internal/software-license/[https://www.FreeBSD.org/internal/software-license]. The rest of this section is intended to help you get started. As a rule, when in doubt, ask. It is much easier to give advice than to fix the source tree. +The FreeBSD Project's full license policy can be found at link:https://www.FreeBSD.org/internal/software-license/[https://www.FreeBSD.org/internal/software-license]. +The rest of this section is intended to help you get started. +As a rule, when in doubt, ask. +It is much easier to give advice than to fix the source tree. The FreeBSD Project suggests and uses this text as the preferred license scheme: @@ -3401,20 +3486,33 @@ The FreeBSD Project suggests and uses this text as the preferred license scheme: */ .... -The FreeBSD project strongly discourages the so-called "advertising clause" in new code. Due to the large number of contributors to the FreeBSD project, complying with this clause for many commercial vendors has become difficult. If you have code in the tree with the advertising clause, please consider removing it. In fact, please consider using the above license for your code. +The FreeBSD project strongly discourages the so-called "advertising clause" in new code. +Due to the large number of contributors to the FreeBSD project, complying with this clause for many commercial vendors has become difficult. +If you have code in the tree with the advertising clause, please consider removing it. +In fact, please consider using the above license for your code. -The FreeBSD project discourages completely new licenses and variations on the standard licenses. New licenses require the approval of the {core-email} to reside in the main repository. The more different licenses that are used in the tree, the more problems that this causes to those wishing to utilize this code, typically from unintended consequences from a poorly worded license. +The FreeBSD project discourages completely new licenses and variations on the standard licenses. +New licenses require the approval of the {core-email} to reside in the main repository. +The more different licenses that are used in the tree, the more problems that this causes to those wishing to utilize this code, typically from unintended consequences from a poorly worded license. -Project policy dictates that code under some non-BSD licenses must be placed only in specific sections of the repository, and in some cases, compilation must be conditional or even disabled by default. For example, the GENERIC kernel must be compiled under only licenses identical to or substantially similar to the BSD license. GPL, APSL, CDDL, etc, licensed software must not be compiled into GENERIC. +Project policy dictates that code under some non-BSD licenses must be placed only in specific sections of the repository, and in some cases, compilation must be conditional or even disabled by default. +For example, the GENERIC kernel must be compiled under only licenses identical to or substantially similar to the BSD license. +GPL, APSL, CDDL, etc, licensed software must not be compiled into GENERIC. -Developers are reminded that in open source, getting "open" right is just as important as getting "source" right, as improper handling of intellectual property has serious consequences. Any questions or concerns should immediately be brought to the attention of the core team. +Developers are reminded that in open source, getting "open" right is just as important as getting "source" right, as improper handling of intellectual property has serious consequences. +Any questions or concerns should immediately be brought to the attention of the core team. [[tracking.license.grants]] == Keeping Track of Licenses Granted to the FreeBSD Project -Various software or data exist in the repositories where the FreeBSD project has been granted a special licence to be able to use them. A case in point are the Terminus fonts for use with man:vt[4]. Here the author Dimitar Zhekov has allowed us to use the "Terminus BSD Console" font under a 2-clause BSD license rather than the regular Open Font License he normally uses. +Various software or data exist in the repositories where the FreeBSD project has been granted a special licence to be able to use them. +A case in point are the Terminus fonts for use with man:vt[4]. +Here the author Dimitar Zhekov has allowed us to use the "Terminus BSD Console" font under a 2-clause BSD license rather than the regular Open Font License he normally uses. -It is clearly sensible to keep a record of any such license grants. To that end, the {core-email} has decided to keep an archive of them. Whenever the FreeBSD project is granted a special license we require the {core-email} to be notified. Any developers involved in arranging such a license grant, please send details to the {core-email} including: +It is clearly sensible to keep a record of any such license grants. +To that end, the {core-email} has decided to keep an archive of them. +Whenever the FreeBSD project is granted a special license we require the {core-email} to be notified. +Any developers involved in arranging such a license grant, please send details to the {core-email} including: * Contact details for people or organizations granting the special license. * What files, directories etc. in the repositories are covered by the license grant including the revision numbers where any specially licensed material was committed. @@ -3423,9 +3521,11 @@ It is clearly sensible to keep a record of any such license grants. To that end, * A note of any restrictions, limitations or exceptions that apply specifically to FreeBSD's usage of the licensed material. * Any other relevant information. -Once the {core-email} is satisfied that all the necessary details have been gathered and are correct, the secretary will send a PGP-signed acknowledgement of receipt including the license details. This receipt will be persistently archived and serve as our permanent record of the license grant. +Once the {core-email} is satisfied that all the necessary details have been gathered and are correct, the secretary will send a PGP-signed acknowledgement of receipt including the license details. +This receipt will be persistently archived and serve as our permanent record of the license grant. -The license archive should contain only details of license grants; this is not the place for any discussions around licensing or other subjects. Access to data within the license archive will be available on request to the {core-email}. +The license archive should contain only details of license grants; this is not the place for any discussions around licensing or other subjects. +Access to data within the license archive will be available on request to the {core-email}. [[spdx.tags]] == SPDX Tags in the tree @@ -3444,31 +3544,53 @@ As of March 2021, approximately 25,000 out of 90,000 files in the tree have been [[developer.relations]] == Developer Relations -When working directly on your own code or on code which is already well established as your responsibility, then there is probably little need to check with other committers before jumping in with a commit. Working on a bug in an area of the system which is clearly orphaned (and there are a few such areas, to our shame), the same applies. When modifying parts of the system which are maintained, formally, or informally, consider asking for review just as a developer would have before becoming a committer. For ports, contact the listed `MAINTAINER` in the [.filename]#Makefile#. +When working directly on your own code or on code which is already well established as your responsibility, then there is probably little need to check with other committers before jumping in with a commit. +Working on a bug in an area of the system which is clearly orphaned (and there are a few such areas, to our shame), the same applies. +When modifying parts of the system which are maintained, formally, or informally, consider asking for review just as a developer would have before becoming a committer. +For ports, contact the listed `MAINTAINER` in the [.filename]#Makefile#. -To determine if an area of the tree is maintained, check the MAINTAINERS file at the root of the tree. If nobody is listed, scan the revision history to see who has committed changes in the past. An example script that lists each person who has committed to a given file along with the number of commits each person has made can be found at on `freefall` at [.filename]#~eadler/bin/whodid#. If queries go unanswered or the committer otherwise indicates a lack of interest in the area affected, go ahead and commit it. +To determine if an area of the tree is maintained, check the MAINTAINERS file at the root of the tree. +If nobody is listed, scan the revision history to see who has committed changes in the past. +An example script that lists each person who has committed to a given file along with the number of commits each person has made can be found at on `freefall` at [.filename]#~eadler/bin/whodid#. +If queries go unanswered or the committer otherwise indicates a lack of interest in the area affected, go ahead and commit it. [IMPORTANT] ==== -Avoid sending private emails to maintainers. Other people might be interested in the conversation, not just the final output. +Avoid sending private emails to maintainers. +Other people might be interested in the conversation, not just the final output. ==== -If there is any doubt about a commit for any reason at all, have it reviewed before committing. Better to have it flamed then and there rather than when it is part of the repository. If a commit does results in controversy erupting, it may be advisable to consider backing the change out again until the matter is settled. Remember, with a version control system we can always change it back. +If there is any doubt about a commit for any reason at all, have it reviewed before committing. +Better to have it flamed then and there rather than when it is part of the repository. +If a commit does results in controversy erupting, it may be advisable to consider backing the change out again until the matter is settled. +Remember, with a version control system we can always change it back. -Do not impugn the intentions of others. If they see a different solution to a problem, or even a different problem, it is probably not because they are stupid, because they have questionable parentage, or because they are trying to destroy hard work, personal image, or FreeBSD, but basically because they have a different outlook on the world. Different is good. +Do not impugn the intentions of others. +If they see a different solution to a problem, or even a different problem, it is probably not because they are stupid, because they have questionable parentage, or because they are trying to destroy hard work, personal image, or FreeBSD, but basically because they have a different outlook on the world. +Different is good. -Disagree honestly. Argue your position from its merits, be honest about any shortcomings it may have, and be open to seeing their solution, or even their vision of the problem, with an open mind. +Disagree honestly. +Argue your position from its merits, be honest about any shortcomings it may have, and be open to seeing their solution, or even their vision of the problem, with an open mind. -Accept correction. We are all fallible. When you have made a mistake, apologize and get on with life. Do not beat up yourself, and certainly do not beat up others for your mistake. Do not waste time on embarrassment or recrimination, just fix the problem and move on. +Accept correction. +We are all fallible. +When you have made a mistake, apologize and get on with life. +Do not beat up yourself, and certainly do not beat up others for your mistake. +Do not waste time on embarrassment or recrimination, just fix the problem and move on. -Ask for help. Seek out (and give) peer reviews. One of the ways open source software is supposed to excel is in the number of eyeballs applied to it; this does not apply if nobody will review code. +Ask for help. +Seek out (and give) peer reviews. +One of the ways open source software is supposed to excel is in the number of eyeballs applied to it; this does not apply if nobody will review code. [[if-in-doubt]] == If in Doubt... -When unsure about something, whether it be a technical issue or a project convention be sure to ask. If you stay silent you will never make progress. +When unsure about something, whether it be a technical issue or a project convention be sure to ask. +If you stay silent you will never make progress. -If it relates to a technical issue ask on the public mailing lists. Avoid the temptation to email the individual person that knows the answer. This way everyone will be able to learn from the question and the answer. +If it relates to a technical issue ask on the public mailing lists. +Avoid the temptation to email the individual person that knows the answer. +This way everyone will be able to learn from the question and the answer. For project specific or administrative questions ask, in order: @@ -3482,7 +3604,9 @@ Once your question is answered, if no one pointed you to documentation that spel [[bugzilla]] == Bugzilla -The FreeBSD Project utilizes Bugzilla for tracking bugs and change requests. Be sure that if you commit a fix or suggestion found in the PR database to close it. It is also considered nice if you take time to close any PRs associated with your commits, if appropriate. +The FreeBSD Project utilizes Bugzilla for tracking bugs and change requests. +Be sure that if you commit a fix or suggestion found in the PR database to close it. +It is also considered nice if you take time to close any PRs associated with your commits, if appropriate. Committers with non-``FreeBSD.org`` Bugzilla accounts can have the old account merged with the `FreeBSD.org` account by following these steps: @@ -3502,7 +3626,8 @@ You can find out more about Bugzilla at: [[phabricator]] == Phabricator -The FreeBSD Project utilizes https://reviews.freebsd.org[Phabricator] for code review requests. See the https://wiki.freebsd.org/CodeReview[CodeReview] wiki page for details. +The FreeBSD Project utilizes https://reviews.freebsd.org[Phabricator] for code review requests. +See the https://wiki.freebsd.org/CodeReview[CodeReview] wiki page for details. Committers with non-``FreeBSD.org`` Phabricator accounts can have the old account renamed to the ``FreeBSD.org`` account by following these steps: @@ -3523,28 +3648,48 @@ Phabricator accounts cannot be merged, please do not open a new account. Besides the repository meisters, there are other FreeBSD project members and teams whom you will probably get to know in your role as a committer. Briefly, and by no means all-inclusively, these are: `{doceng}`:: -doceng is the group responsible for the documentation build infrastructure, approving new documentation committers, and ensuring that the FreeBSD website and documentation on the FTP site is up to date with respect to the subversion tree. It is not a conflict resolution body. The vast majority of documentation related discussion takes place on the {freebsd-doc}. More details regarding the doceng team can be found in its https://www.FreeBSD.org/internal/doceng/[charter]. Committers interested in contributing to the documentation should familiarize themselves with the link:{fdp-primer}[Documentation Project Primer]. +doceng is the group responsible for the documentation build infrastructure, approving new documentation committers, and ensuring that the FreeBSD website and documentation on the FTP site is up to date with respect to the subversion tree. +It is not a conflict resolution body. +The vast majority of documentation related discussion takes place on the {freebsd-doc}. +More details regarding the doceng team can be found in its https://www.FreeBSD.org/internal/doceng/[charter]. +Committers interested in contributing to the documentation should familiarize themselves with the link:{fdp-primer}[Documentation Project Primer]. `{re-members}`:: -These are the members of the `{re}`. This team is responsible for setting release deadlines and controlling the release process. During code freezes, the release engineers have final authority on all changes to the system for whichever branch is pending release status. If there is something you want merged from FreeBSD-CURRENT to FreeBSD-STABLE (whatever values those may have at any given time), these are the people to talk to about it. +These are the members of the `{re}`. +This team is responsible for setting release deadlines and controlling the release process. +During code freezes, the release engineers have final authority on all changes to the system for whichever branch is pending release status. +If there is something you want merged from FreeBSD-CURRENT to FreeBSD-STABLE (whatever values those may have at any given time), these are the people to talk to about it. `{so}`:: `{so-name}` is the link:https://www.FreeBSD.org/security/[FreeBSD Security Officer] and oversees the `{security-officer}`. `{wollman}`:: -If you need advice on obscure network internals or are not sure of some potential change to the networking subsystem you have in mind, Garrett is someone to talk to. Garrett is also very knowledgeable on the various standards applicable to FreeBSD. +If you need advice on obscure network internals or are not sure of some potential change to the networking subsystem you have in mind, Garrett is someone to talk to. +Garrett is also very knowledgeable on the various standards applicable to FreeBSD. {committers-name}:: -{svn-src-all}, {svn-ports-all} and {svn-doc-all} are the mailing lists that the version control system uses to send commit messages to. _Never_ send email directly to these lists. Only send replies to this list when they are short and are directly related to a commit. +{svn-src-all}, {svn-ports-all} and {svn-doc-all} are the mailing lists that the version control system uses to send commit messages to. +_Never_ send email directly to these lists. +Only send replies to this list when they are short and are directly related to a commit. {developers-name}:: -All committers are subscribed to -developers. This list was created to be a forum for the committers "community" issues. Examples are Core voting, announcements, etc. +All committers are subscribed to -developers. +This list was created to be a forum for the committers "community" issues. +Examples are Core voting, announcements, etc. + -The {developers-name} is for the exclusive use of FreeBSD committers. To develop FreeBSD, committers must have the ability to openly discuss matters that will be resolved before they are publicly announced. Frank discussions of work in progress are not suitable for open publication and may harm FreeBSD. +The {developers-name} is for the exclusive use of FreeBSD committers. +To develop FreeBSD, committers must have the ability to openly discuss matters that will be resolved before they are publicly announced. +Frank discussions of work in progress are not suitable for open publication and may harm FreeBSD. + -All FreeBSD committers are expected not to not publish or forward messages from the {developers-name} outside the list membership without permission of all of the authors. Violators will be removed from the {developers-name}, resulting in a suspension of commit privileges. Repeated or flagrant violations may result in permanent revocation of commit privileges. +All FreeBSD committers are expected not to not publish or forward messages from the {developers-name} outside the list membership without permission of all of the authors. +Violators will be removed from the {developers-name}, resulting in a suspension of commit privileges. +Repeated or flagrant violations may result in permanent revocation of commit privileges. + -This list is _not_ intended as a place for code reviews or for any technical discussion. In fact using it as such hurts the FreeBSD Project as it gives a sense of a closed list where general decisions affecting all of the FreeBSD using community are made without being "open". Last, but not least __never, never ever, email the {developers-name} and CC:/BCC: another FreeBSD list__. Never, ever email another FreeBSD email list and CC:/BCC: the {developers-name}. Doing so can greatly diminish the benefits of this list. +This list is _not_ intended as a place for code reviews or for any technical discussion. +In fact using it as such hurts the FreeBSD Project as it gives a sense of a closed list where general decisions affecting all of the FreeBSD using community are made without being "open". +Last, but not least __never, never ever, email the {developers-name} and CC:/BCC: another FreeBSD list__. +Never, ever email another FreeBSD email list and CC:/BCC: the {developers-name}. +Doing so can greatly diminish the benefits of this list. [[ssh.guide]] == SSH Quick-Start Guide @@ -3560,7 +3705,9 @@ Only ECDSA, Ed25519 or RSA keys are supported. . Send your public key ([.filename]#$HOME/.ssh/id_ecdsa.pub#, [.filename]#$HOME/.ssh/id_ed25519.pub#, or [.filename]#$HOME/.ssh/id_rsa.pub#) to the person setting you up as a committer so it can be put into [.filename]#yourlogin# in [.filename]#/etc/ssh-keys/# on `freefall`. ==== -Now man:ssh-add[1] can be used for authentication once per session. It prompts for the private key's pass phrase, and then stores it in the authentication agent (man:ssh-agent[1]). Use `ssh-add -d` to remove keys stored in the agent. +Now man:ssh-add[1] can be used for authentication once per session. +It prompts for the private key's pass phrase, and then stores it in the authentication agent (man:ssh-agent[1]). +Use `ssh-add -d` to remove keys stored in the agent. Test with a simple remote command: `ssh freefall.FreeBSD.org ls /usr`. @@ -3571,16 +3718,20 @@ For information on adding, changing, or removing man:ssh[1] keys, see https://wi [[coverity]] == Coverity(R) Availability for FreeBSD Committers -All FreeBSD developers can obtain access to Coverity analysis results of all FreeBSD Project software. All who are interested in obtaining access to the analysis results of the automated Coverity runs, can sign up at http://scan.coverity.com/[Coverity Scan]. +All FreeBSD developers can obtain access to Coverity analysis results of all FreeBSD Project software. +All who are interested in obtaining access to the analysis results of the automated Coverity runs, can sign up at http://scan.coverity.com/[Coverity Scan]. -The FreeBSD wiki includes a mini-guide for developers who are interested in working with the Coverity(R) analysis reports: https://wiki.freebsd.org/CoverityPrevent[https://wiki.freebsd.org/CoverityPrevent]. Please note that this mini-guide is only readable by FreeBSD developers, so if you cannot access this page, you will have to ask someone to add you to the appropriate Wiki access list. +The FreeBSD wiki includes a mini-guide for developers who are interested in working with the Coverity(R) analysis reports: https://wiki.freebsd.org/CoverityPrevent[https://wiki.freebsd.org/CoverityPrevent]. +Please note that this mini-guide is only readable by FreeBSD developers, so if you cannot access this page, you will have to ask someone to add you to the appropriate Wiki access list. Finally, all FreeBSD developers who are going to use Coverity(R) are always encouraged to ask for more details and usage information, by posting any questions to the mailing list of the FreeBSD developers. [[rules]] == The FreeBSD Committers' Big List of Rules -Everyone involved with the FreeBSD project is expected to abide by the _Code of Conduct_ available from link:https://www.FreeBSD.org/internal/code-of-conduct/[https://www.FreeBSD.org/internal/code-of-conduct]. As committers, you form the public face of the project, and how you behave has a vital impact on the public perception of it. This guide expands on the parts of the _Code of Conduct_ specific to committers. +Everyone involved with the FreeBSD project is expected to abide by the _Code of Conduct_ available from link:https://www.FreeBSD.org/internal/code-of-conduct/[https://www.FreeBSD.org/internal/code-of-conduct]. +As committers, you form the public face of the project, and how you behave has a vital impact on the public perception of it. +This guide expands on the parts of the _Code of Conduct_ specific to committers. . Respect other committers. . Respect other contributors. @@ -3594,85 +3745,160 @@ Everyone involved with the FreeBSD project is expected to abide by the _Code of . Test your changes before committing them. . Do not commit to contributed software without _explicit_ approval from the respective maintainers. -As noted, breaking some of these rules can be grounds for suspension or, upon repeated offense, permanent removal of commit privileges. Individual members of core have the power to temporarily suspend commit privileges until core as a whole has the chance to review the issue. In case of an "emergency" (a committer doing damage to the repository), a temporary suspension may also be done by the repository meisters. Only a 2/3 majority of core has the authority to suspend commit privileges for longer than a week or to remove them permanently. This rule does not exist to set core up as a bunch of cruel dictators who can dispose of committers as casually as empty soda cans, but to give the project a kind of safety fuse. If someone is out of control, it is important to be able to deal with this immediately rather than be paralyzed by debate. In all cases, a committer whose privileges are suspended or revoked is entitled to a "hearing" by core, the total duration of the suspension being determined at that time. A committer whose privileges are suspended may also request a review of the decision after 30 days and every 30 days thereafter (unless the total suspension period is less than 30 days). A committer whose privileges have been revoked entirely may request a review after a period of 6 months has elapsed. This review policy is _strictly informal_ and, in all cases, core reserves the right to either act on or disregard requests for review if they feel their original decision to be the right one. - -In all other aspects of project operation, core is a subset of committers and is bound by the __same rules__. Just because someone is in core this does not mean that they have special dispensation to step outside any of the lines painted here; core's "special powers" only kick in when it acts as a group, not on an individual basis. As individuals, the core team members are all committers first and core second. +As noted, breaking some of these rules can be grounds for suspension or, upon repeated offense, permanent removal of commit privileges. +Individual members of core have the power to temporarily suspend commit privileges until core as a whole has the chance to review the issue. +In case of an "emergency" (a committer doing damage to the repository), a temporary suspension may also be done by the repository meisters. +Only a 2/3 majority of core has the authority to suspend commit privileges for longer than a week or to remove them permanently. +This rule does not exist to set core up as a bunch of cruel dictators who can dispose of committers as casually as empty soda cans, but to give the project a kind of safety fuse. +If someone is out of control, it is important to be able to deal with this immediately rather than be paralyzed by debate. +In all cases, a committer whose privileges are suspended or revoked is entitled to a "hearing" by core, the total duration of the suspension being determined at that time. +A committer whose privileges are suspended may also request a review of the decision after 30 days and every 30 days thereafter (unless the total suspension period is less than 30 days). +A committer whose privileges have been revoked entirely may request a review after a period of 6 months has elapsed. +This review policy is _strictly informal_ and, in all cases, core reserves the right to either act on or disregard requests for review if they feel their original decision to be the right one. + +In all other aspects of project operation, core is a subset of committers and is bound by the __same rules__. +Just because someone is in core this does not mean that they have special dispensation to step outside any of the lines painted here; core's "special powers" only kick in when it acts as a group, not on an individual basis. +As individuals, the core team members are all committers first and core second. === Details [[respect]] . Respect other committers. + -This means that you need to treat other committers as the peer-group developers that they are. Despite our occasional attempts to prove the contrary, one does not get to be a committer by being stupid and nothing rankles more than being treated that way by one of your peers. Whether we always feel respect for one another or not (and everyone has off days), we still have to _treat_ other committers with respect at all times, on public forums and in private email. +This means that you need to treat other committers as the peer-group developers that they are. +Despite our occasional attempts to prove the contrary, one does not get to be a committer by being stupid and nothing rankles more than being treated that way by one of your peers. +Whether we always feel respect for one another or not (and everyone has off days), we still have to _treat_ other committers with respect at all times, on public forums and in private email. + Being able to work together long term is this project's greatest asset, one far more important than any set of changes to the code, and turning arguments about code into issues that affect our long-term ability to work harmoniously together is just not worth the trade-off by any conceivable stretch of the imagination. + -To comply with this rule, do not send email when you are angry or otherwise behave in a manner which is likely to strike others as needlessly confrontational. First calm down, then think about how to communicate in the most effective fashion for convincing the other persons that your side of the argument is correct, do not just blow off some steam so you can feel better in the short term at the cost of a long-term flame war. Not only is this very bad "energy economics", but repeated displays of public aggression which impair our ability to work well together will be dealt with severely by the project leadership and may result in suspension or termination of your commit privileges. The project leadership will take into account both public and private communications brought before it. It will not seek the disclosure of private communications, but it will take it into account if it is volunteered by the committers involved in the complaint. +To comply with this rule, do not send email when you are angry or otherwise behave in a manner which is likely to strike others as needlessly confrontational. +First calm down, then think about how to communicate in the most effective fashion for convincing the other persons that your side of the argument is correct, do not just blow off some steam so you can feel better in the short term at the cost of a long-term flame war. +Not only is this very bad "energy economics", but repeated displays of public aggression which impair our ability to work well together will be dealt with severely by the project leadership and may result in suspension or termination of your commit privileges. +The project leadership will take into account both public and private communications brought before it. +It will not seek the disclosure of private communications, but it will take it into account if it is volunteered by the committers involved in the complaint. + -All of this is never an option which the project's leadership enjoys in the slightest, but unity comes first. No amount of code or good advice is worth trading that away. +All of this is never an option which the project's leadership enjoys in the slightest, but unity comes first. +No amount of code or good advice is worth trading that away. . Respect other contributors. + -You were not always a committer. At one time you were a contributor. Remember that at all times. Remember what it was like trying to get help and attention. Do not forget that your work as a contributor was very important to you. Remember what it was like. Do not discourage, belittle, or demean contributors. Treat them with respect. They are our committers in waiting. They are every bit as important to the project as committers. Their contributions are as valid and as important as your own. After all, you made many contributions before you became a committer. Always remember that. +You were not always a committer. +At one time you were a contributor. +Remember that at all times. +Remember what it was like trying to get help and attention. +Do not forget that your work as a contributor was very important to you. +Remember what it was like. Do not discourage, belittle, or demean contributors. +Treat them with respect. They are our committers in waiting. +They are every bit as important to the project as committers. +Their contributions are as valid and as important as your own. +After all, you made many contributions before you became a committer. +Always remember that. + Consider the points raised under <> and apply them also to contributors. . Discuss any significant change _before_ committing. + -The repository is not where changes are initially submitted for correctness or argued over, that happens first in the mailing lists or by use of the Phabricator service. The commit will only happen once something resembling consensus has been reached. This does not mean that permission is required before correcting every obvious syntax error or manual page misspelling, just that it is good to develop a feel for when a proposed change is not quite such a no-brainer and requires some feedback first. People really do not mind sweeping changes if the result is something clearly better than what they had before, they just do not like being _surprised_ by those changes. The very best way of making sure that things are on the right track is to have code reviewed by one or more other committers. +The repository is not where changes are initially submitted for correctness or argued over, that happens first in the mailing lists or by use of the Phabricator service. +The commit will only happen once something resembling consensus has been reached. +This does not mean that permission is required before correcting every obvious syntax error or manual page misspelling, just that it is good to develop a feel for when a proposed change is not quite such a no-brainer and requires some feedback first. +People really do not mind sweeping changes if the result is something clearly better than what they had before, they just do not like being _surprised_ by those changes. +The very best way of making sure that things are on the right track is to have code reviewed by one or more other committers. + When in doubt, ask for review! . Respect existing maintainers if listed. + -Many parts of FreeBSD are not "owned" in the sense that any specific individual will jump up and yell if you commit a change to "their" area, but it still pays to check first. One convention we use is to put a maintainer line in the [.filename]#Makefile# for any package or subtree which is being actively maintained by one or more people; see link:{developers-handbook}#policies[Source Tree Guidelines and Policies] for documentation on this. Where sections of code have several maintainers, commits to affected areas by one maintainer need to be reviewed by at least one other maintainer. In cases where the "maintainer-ship" of something is not clear, look at the repository logs for the files in question and see if someone has been working recently or predominantly in that area. +Many parts of FreeBSD are not "owned" in the sense that any specific individual will jump up and yell if you commit a change to "their" area, but it still pays to check first. +One convention we use is to put a maintainer line in the [.filename]#Makefile# for any package or subtree which is being actively maintained by one or more people; see link:{developers-handbook}#policies[Source Tree Guidelines and Policies] for documentation on this. +Where sections of code have several maintainers, commits to affected areas by one maintainer need to be reviewed by at least one other maintainer. +In cases where the "maintainer-ship" of something is not clear, look at the repository logs for the files in question and see if someone has been working recently or predominantly in that area. . Any disputed change must be backed out pending resolution of the dispute if requested by a maintainer. Security related changes may override a maintainer's wishes at the Security Officer's discretion. + -This may be hard to swallow in times of conflict (when each side is convinced that they are in the right, of course) but a version control system makes it unnecessary to have an ongoing dispute raging when it is far easier to simply reverse the disputed change, get everyone calmed down again and then try to figure out what is the best way to proceed. If the change turns out to be the best thing after all, it can be easily brought back. If it turns out not to be, then the users did not have to live with the bogus change in the tree while everyone was busily debating its merits. People _very_ rarely call for back-outs in the repository since discussion generally exposes bad or controversial changes before the commit even happens, but on such rare occasions the back-out should be done without argument so that we can get immediately on to the topic of figuring out whether it was bogus or not. +This may be hard to swallow in times of conflict (when each side is convinced that they are in the right, of course) but a version control system makes it unnecessary to have an ongoing dispute raging when it is far easier to simply reverse the disputed change, get everyone calmed down again and then try to figure out what is the best way to proceed. +If the change turns out to be the best thing after all, it can be easily brought back. +If it turns out not to be, then the users did not have to live with the bogus change in the tree while everyone was busily debating its merits. +People _very_ rarely call for back-outs in the repository since discussion generally exposes bad or controversial changes before the commit even happens, but on such rare occasions the back-out should be done without argument so that we can get immediately on to the topic of figuring out whether it was bogus or not. . Changes go to FreeBSD-CURRENT before FreeBSD-STABLE unless specifically permitted by the release engineer or unless they are not applicable to FreeBSD-CURRENT. Any non-trivial or non-urgent change which is applicable should also be allowed to sit in FreeBSD-CURRENT for at least 3 days before merging so that it can be given sufficient testing. The release engineer has the same authority over the FreeBSD-STABLE branch as outlined in rule #5. + -This is another "do not argue about it" issue since it is the release engineer who is ultimately responsible (and gets beaten up) if a change turns out to be bad. Please respect this and give the release engineer your full cooperation when it comes to the FreeBSD-STABLE branch. The management of FreeBSD-STABLE may frequently seem to be overly conservative to the casual observer, but also bear in mind the fact that conservatism is supposed to be the hallmark of FreeBSD-STABLE and different rules apply there than in FreeBSD-CURRENT. There is also really no point in having FreeBSD-CURRENT be a testing ground if changes are merged over to FreeBSD-STABLE immediately. Changes need a chance to be tested by the FreeBSD-CURRENT developers, so allow some time to elapse before merging unless the FreeBSD-STABLE fix is critical, time sensitive or so obvious as to make further testing unnecessary (spelling fixes to manual pages, obvious bug/typo fixes, etc.) In other words, apply common sense. +This is another "do not argue about it" issue since it is the release engineer who is ultimately responsible (and gets beaten up) if a change turns out to be bad. +Please respect this and give the release engineer your full cooperation when it comes to the FreeBSD-STABLE branch. +The management of FreeBSD-STABLE may frequently seem to be overly conservative to the casual observer, but also bear in mind the fact that conservatism is supposed to be the hallmark of FreeBSD-STABLE and different rules apply there than in FreeBSD-CURRENT. +There is also really no point in having FreeBSD-CURRENT be a testing ground if changes are merged over to FreeBSD-STABLE immediately. +Changes need a chance to be tested by the FreeBSD-CURRENT developers, so allow some time to elapse before merging unless the FreeBSD-STABLE fix is critical, time sensitive or so obvious as to make further testing unnecessary (spelling fixes to manual pages, obvious bug/typo fixes, etc.) In other words, apply common sense. + Changes to the security branches (for example, `releng/9.3`) must be approved by a member of the `{security-officer}`, or in some cases, by a member of the `{re}`. . Do not fight in public with other committers; it looks bad. + -This project has a public image to uphold and that image is very important to all of us, especially if we are to continue to attract new members. There will be occasions when, despite everyone's very best attempts at self-control, tempers are lost and angry words are exchanged. The best thing that can be done in such cases is to minimize the effects of this until everyone has cooled back down. Do not air angry words in public and do not forward private correspondence or other private communications to public mailing lists, mail aliases, instant messaging channels or social media sites. What people say one-to-one is often much less sugar-coated than what they would say in public, and such communications therefore have no place there - they only serve to inflame an already bad situation. If the person sending a flame-o-gram at least had the grace to send it privately, then have the grace to keep it private yourself. If you feel you are being unfairly treated by another developer, and it is causing you anguish, bring the matter up with core rather than taking it public. Core will do its best to play peace makers and get things back to sanity. In cases where the dispute involves a change to the codebase and the participants do not appear to be reaching an amicable agreement, core may appoint a mutually-agreeable third party to resolve the dispute. All parties involved must then agree to be bound by the decision reached by this third party. +This project has a public image to uphold and that image is very important to all of us, especially if we are to continue to attract new members. +There will be occasions when, despite everyone's very best attempts at self-control, tempers are lost and angry words are exchanged. +The best thing that can be done in such cases is to minimize the effects of this until everyone has cooled back down. +Do not air angry words in public and do not forward private correspondence or other private communications to public mailing lists, mail aliases, instant messaging channels or social media sites. +What people say one-to-one is often much less sugar-coated than what they would say in public, and such communications therefore have no place there - they only serve to inflame an already bad situation. +If the person sending a flame-o-gram at least had the grace to send it privately, then have the grace to keep it private yourself. +If you feel you are being unfairly treated by another developer, and it is causing you anguish, bring the matter up with core rather than taking it public. Core will do its best to play peace makers and get things back to sanity. +In cases where the dispute involves a change to the codebase and the participants do not appear to be reaching an amicable agreement, core may appoint a mutually-agreeable third party to resolve the dispute. +All parties involved must then agree to be bound by the decision reached by this third party. . Respect all code freezes and read the `committers` and `developers` mailing list on a timely basis so you know when a code freeze is in effect. + -Committing unapproved changes during a code freeze is a really big mistake and committers are expected to keep up-to-date on what is going on before jumping in after a long absence and committing 10 megabytes worth of accumulated stuff. People who abuse this on a regular basis will have their commit privileges suspended until they get back from the FreeBSD Happy Reeducation Camp we run in Greenland. +Committing unapproved changes during a code freeze is a really big mistake and committers are expected to keep up-to-date on what is going on before jumping in after a long absence and committing 10 megabytes worth of accumulated stuff. +People who abuse this on a regular basis will have their commit privileges suspended until they get back from the FreeBSD Happy Reeducation Camp we run in Greenland. . When in doubt on any procedure, ask first! + -Many mistakes are made because someone is in a hurry and just assumes they know the right way of doing something. If you have not done it before, chances are good that you do not actually know the way we do things and really need to ask first or you are going to completely embarrass yourself in public. There is no shame in asking "how in the heck do I do this?" We already know you are an intelligent person; otherwise, you would not be a committer. +Many mistakes are made because someone is in a hurry and just assumes they know the right way of doing something. +If you have not done it before, chances are good that you do not actually know the way we do things and really need to ask first or you are going to completely embarrass yourself in public. +There is no shame in asking "how in the heck do I do this?" We already know you are an intelligent person; otherwise, you would not be a committer. . Test your changes before committing them. + -This may sound obvious, but if it really were so obvious then we probably would not see so many cases of people clearly not doing this. If your changes are to the kernel, make sure you can still compile both GENERIC and LINT. If your changes are anywhere else, make sure you can still make world. If your changes are to a branch, make sure your testing occurs with a machine which is running that code. If you have a change which also may break another architecture, be sure and test on all supported architectures. Please refer to the https://www.FreeBSD.org/internal/[FreeBSD Internal Page] for a list of available resources. As other architectures are added to the FreeBSD supported platforms list, the appropriate shared testing resources will be made available. +This may sound obvious, but if it really were so obvious then we probably would not see so many cases of people clearly not doing this. +If your changes are to the kernel, make sure you can still compile both GENERIC and LINT. +If your changes are anywhere else, make sure you can still make world. +If your changes are to a branch, make sure your testing occurs with a machine which is running that code. +If you have a change which also may break another architecture, be sure and test on all supported architectures. +Please refer to the https://www.FreeBSD.org/internal/[FreeBSD Internal Page] for a list of available resources. +As other architectures are added to the FreeBSD supported platforms list, the appropriate shared testing resources will be made available. . Do not commit to contributed software without _explicit_ approval from the respective maintainers. + Contributed software is anything under the [.filename]#src/contrib#, [.filename]#src/crypto#, or [.filename]#src/sys/contrib# trees. + -The trees mentioned above are for contributed software usually imported onto a vendor branch. Committing something there may cause unnecessary headaches when importing newer versions of the software. As a general consider sending patches upstream to the vendor. Patches may be committed to FreeBSD first with permission of the maintainer. +The trees mentioned above are for contributed software usually imported onto a vendor branch. +Committing something there may cause unnecessary headaches when importing newer versions of the software. +As a general consider sending patches upstream to the vendor. +Patches may be committed to FreeBSD first with permission of the maintainer. + -Reasons for modifying upstream software range from wanting strict control over a tightly coupled dependency to lack of portability in the canonical repository's distribution of their code. Regardless of the reason, effort to minimize the maintenance burden of fork is helpful to fellow maintainers. Avoid committing trivial or cosmetic changes to files since it makes every merge thereafter more difficult: such patches need to be manually re-verified every import. +Reasons for modifying upstream software range from wanting strict control over a tightly coupled dependency to lack of portability in the canonical repository's distribution of their code. +Regardless of the reason, effort to minimize the maintenance burden of fork is helpful to fellow maintainers. +Avoid committing trivial or cosmetic changes to files since it makes every merge thereafter more difficult: such patches need to be manually re-verified every import. + -If a particular piece of software lacks a maintainer, you are encouraged to take up ownership. If you are unsure of the current maintainership email {freebsd-arch} and ask. +If a particular piece of software lacks a maintainer, you are encouraged to take up ownership. +If you are unsure of the current maintainership email {freebsd-arch} and ask. === Policy on Multiple Architectures -FreeBSD has added several new architecture ports during recent release cycles and is truly no longer an i386(TM) centric operating system. In an effort to make it easier to keep FreeBSD portable across the platforms we support, core has developed this mandate: +FreeBSD has added several new architecture ports during recent release cycles and is truly no longer an i386(TM) centric operating system. +In an effort to make it easier to keep FreeBSD portable across the platforms we support, core has developed this mandate: [.blockquote] -Our 32-bit reference platform is i386, and our 64-bit reference platform is amd64. Major design work (including major API and ABI changes) must prove itself on at least one 32-bit and at least one 64-bit platform, preferably the primary reference platforms, before it may be committed to the source tree. +Our 32-bit reference platform is i386, and our 64-bit reference platform is amd64. +Major design work (including major API and ABI changes) must prove itself on at least one 32-bit and at least one 64-bit platform, preferably the primary reference platforms, before it may be committed to the source tree. The i386 and amd64 platforms were chosen due to being more readily available to developers and as representatives of more diverse processor and system designs - big versus little endian, register file versus register stack, different DMA and cache implementations, hardware page tables versus software TLB management etc. We will continue to re-evaluate this policy as cost and availability of the 64-bit platforms change. -Developers should also be aware of our Tier Policy for the long term support of hardware architectures. The rules here are intended to provide guidance during the development process, and are distinct from the requirements for features and architectures listed in that section. The Tier rules for feature support on architectures at release-time are more strict than the rules for changes during the development process. +Developers should also be aware of our Tier Policy for the long term support of hardware architectures. +The rules here are intended to provide guidance during the development process, and are distinct from the requirements for features and architectures listed in that section. +The Tier rules for feature support on architectures at release-time are more strict than the rules for changes during the development process. === Other Suggestions -When committing documentation changes, use a spell checker before committing. For all XML docs, verify that the formatting directives are correct by running `make lint` and package:textproc/igor[]. +When committing documentation changes, use a spell checker before committing. +For all XML docs, verify that the formatting directives are correct by running `make lint` and package:textproc/igor[]. For manual pages, run package:sysutils/manck[] and package:textproc/igor[] over the manual page to verify all of the cross references and file references are correct and that the man page has all of the appropriate `MLINKS` installed. -Do not mix style fixes with new functionality. A style fix is any change which does not modify the functionality of the code. Mixing the changes obfuscates the functionality change when asking for differences between revisions, which can hide any new bugs. Do not include whitespace changes with content changes in commits to [.filename]#doc/# . The extra clutter in the diffs makes the translators' job much more difficult. Instead, make any style or whitespace changes in separate commits that are clearly labeled as such in the commit message. +Do not mix style fixes with new functionality. +A style fix is any change which does not modify the functionality of the code. +Mixing the changes obfuscates the functionality change when asking for differences between revisions, which can hide any new bugs. +Do not include whitespace changes with content changes in commits to [.filename]#doc/#. +The extra clutter in the diffs makes the translators' job much more difficult. +Instead, make any style or whitespace changes in separate commits that are clearly labeled as such in the commit message. === Deprecating Features @@ -3686,25 +3912,39 @@ When it is necessary to remove functionality from software in the base system, f . Most FreeBSD business is done in public. + -FreeBSD is an _open_ project. Which means that not only can anyone use the source code, but that most of the development process is open to public scrutiny. +FreeBSD is an _open_ project. +Which means that not only can anyone use the source code, but that most of the development process is open to public scrutiny. . Certain sensitive matters must remain private or held under embargo. + -There unfortunately cannot be complete transparency. As a FreeBSD developer you will have a certain degree of privileged access to information. Consequently you are expected to respect certain requirements for confidentiality. Sometimes the need for confidentiality comes from external collaborators or has a specific time limit. Mostly though, it is a matter of not releasing private communications. +There unfortunately cannot be complete transparency. +As a FreeBSD developer you will have a certain degree of privileged access to information. +Consequently you are expected to respect certain requirements for confidentiality. +Sometimes the need for confidentiality comes from external collaborators or has a specific time limit. +Mostly though, it is a matter of not releasing private communications. . The Security Officer has sole control over the release of security advisories. + -Where there are security problems that affect many different operating systems, FreeBSD frequently depends on early access to be able to prepare advisories for coordinated release. Unless FreeBSD developers can be trusted to maintain security, such early access will not be made available. The Security Officer is responsible for controlling pre-release access to information about vulnerabilities, and for timing the release of all advisories. He may request help under condition of confidentiality from any developer with relevant knowledge to prepare security fixes. +Where there are security problems that affect many different operating systems, FreeBSD frequently depends on early access to be able to prepare advisories for coordinated release. +Unless FreeBSD developers can be trusted to maintain security, such early access will not be made available. +The Security Officer is responsible for controlling pre-release access to information about vulnerabilities, and for timing the release of all advisories. +He may request help under condition of confidentiality from any developer with relevant knowledge to prepare security fixes. . Communications with Core are kept confidential for as long as necessary. + -Communications to core will initially be treated as confidential. Eventually however, most of Core's business will be summarized into the monthly or quarterly core reports. Care will be taken to avoid publicising any sensitive details. Records of some particularly sensitive subjects may not be reported on at all and will be retained only in Core's private archives. +Communications to core will initially be treated as confidential. +Eventually however, most of Core's business will be summarized into the monthly or quarterly core reports. +Care will be taken to avoid publicising any sensitive details. +Records of some particularly sensitive subjects may not be reported on at all and will be retained only in Core's private archives. . Non-disclosure Agreements may be required for access to certain commercially sensitive data. + -Access to certain commercially sensitive data may only be available under a Non-Disclosure Agreement. The FreeBSD Foundation legal staff must be consulted before any binding agreements are entered into. +Access to certain commercially sensitive data may only be available under a Non-Disclosure Agreement. +The FreeBSD Foundation legal staff must be consulted before any binding agreements are entered into. . Private communications must not be made public without permission. + -Beyond the specific requirements above there is a general expectation not to publish private communications between developers without the consent of all parties involved. Ask permission before forwarding a message onto a public mailing list, or posting it to a forum or website that can be accessed by other than the original correspondents. +Beyond the specific requirements above there is a general expectation not to publish private communications between developers without the consent of all parties involved. +Ask permission before forwarding a message onto a public mailing list, or posting it to a forum or website that can be accessed by other than the original correspondents. . Communications on project-only or restricted access channels must be kept private. + -Similarly to personal communications, certain internal communications channels, including FreeBSD Committer only mailing lists and restricted access IRC channels are considered private communications. Permission is required to publish material from these sources. +Similarly to personal communications, certain internal communications channels, including FreeBSD Committer only mailing lists and restricted access IRC channels are considered private communications. +Permission is required to publish material from these sources. . Core may approve publication. + Where it is impractical to obtain permission due to the number of correspondents or where permission to publish is unreasonably withheld, Core may approve release of such private matters that merit more general publication. @@ -3712,27 +3952,47 @@ Where it is impractical to obtain permission due to the number of correspondents [[archs]] == Support for Multiple Architectures -FreeBSD is a highly portable operating system intended to function on many different types of hardware architectures. Maintaining clean separation of Machine Dependent (MD) and Machine Independent (MI) code, as well as minimizing MD code, is an important part of our strategy to remain agile with regards to current hardware trends. Each new hardware architecture supported by FreeBSD adds substantially to the cost of code maintenance, toolchain support, and release engineering. It also dramatically increases the cost of effective testing of kernel changes. As such, there is strong motivation to differentiate between classes of support for various architectures while remaining strong in a few key architectures that are seen as the FreeBSD "target audience". +FreeBSD is a highly portable operating system intended to function on many different types of hardware architectures. +Maintaining clean separation of Machine Dependent (MD) and Machine Independent (MI) code, as well as minimizing MD code, is an important part of our strategy to remain agile with regards to current hardware trends. +Each new hardware architecture supported by FreeBSD adds substantially to the cost of code maintenance, toolchain support, and release engineering. +It also dramatically increases the cost of effective testing of kernel changes. +As such, there is strong motivation to differentiate between classes of support for various architectures while remaining strong in a few key architectures that are seen as the FreeBSD "target audience". === Statement of General Intent -The FreeBSD Project targets "production quality commercial off-the-shelf (COTS) workstation, server, and high-end embedded systems". By retaining a focus on a narrow set of architectures of interest in these environments, the FreeBSD Project is able to maintain high levels of quality, stability, and performance, as well as minimize the load on various support teams on the project, such as the ports team, documentation team, security officer, and release engineering teams. Diversity in hardware support broadens the options for FreeBSD consumers by offering new features and usage opportunities, but these benefits must always be carefully considered in terms of the real-world maintenance cost associated with additional platform support. +The FreeBSD Project targets "production quality commercial off-the-shelf (COTS) workstation, server, and high-end embedded systems". +By retaining a focus on a narrow set of architectures of interest in these environments, the FreeBSD Project is able to maintain high levels of quality, stability, and performance, as well as minimize the load on various support teams on the project, such as the ports team, documentation team, security officer, and release engineering teams. +Diversity in hardware support broadens the options for FreeBSD consumers by offering new features and usage opportunities, but these benefits must always be carefully considered in terms of the real-world maintenance cost associated with additional platform support. -The FreeBSD Project differentiates platform targets into four tiers. Each tier includes a list of guarantees consumers may rely on as well as obligations by the Project and developers to fulfill those guarantees. These lists define the minimum guarantees for each tier. The Project and developers may provide additional levels of support beyond the minimum guarantees for a given tier, but such additional support is not guaranteed. Each platform target is assigned to a specific tier for each stable branch. As a result, a platform target might be assigned to different tiers on concurrent stable branches. +The FreeBSD Project differentiates platform targets into four tiers. +Each tier includes a list of guarantees consumers may rely on as well as obligations by the Project and developers to fulfill those guarantees. +These lists define the minimum guarantees for each tier. +The Project and developers may provide additional levels of support beyond the minimum guarantees for a given tier, but such additional support is not guaranteed. +Each platform target is assigned to a specific tier for each stable branch. +As a result, a platform target might be assigned to different tiers on concurrent stable branches. === Platform Targets -Support for a hardware platform consists of two components: kernel support and userland Application Binary Interfaces (ABIs). Kernel platform support includes things needed to run a FreeBSD kernel on a hardware platform such as machine-dependent virtual memory management and device drivers. A userland ABI specifies an interface for user processes to interact with a FreeBSD kernel and base system libraries. A userland ABI includes system call interfaces, the layout and semantics of public data structures, and the layout and semantics of arguments passed to subroutines. Some components of an ABI may be defined by specifications such as the layout of C++ exception objects or calling conventions for C functions. +Support for a hardware platform consists of two components: kernel support and userland Application Binary Interfaces (ABIs). +Kernel platform support includes things needed to run a FreeBSD kernel on a hardware platform such as machine-dependent virtual memory management and device drivers. +A userland ABI specifies an interface for user processes to interact with a FreeBSD kernel and base system libraries. +A userland ABI includes system call interfaces, the layout and semantics of public data structures, and the layout and semantics of arguments passed to subroutines. +Some components of an ABI may be defined by specifications such as the layout of C++ exception objects or calling conventions for C functions. A FreeBSD kernel also uses an ABI (sometimes referred to as the Kernel Binary Interface (KBI)) which includes the semantics and layouts of public data structures and the layout and semantics of arguments to public functions within the kernel itself. -A FreeBSD kernel may support multiple userland ABIs. For example, FreeBSD's amd64 kernel supports FreeBSD amd64 and i386 userland ABIs as well as Linux x86_64 and i386 userland ABIs. A FreeBSD kernel should support a "native" ABI as the default ABI. The native "ABI" generally shares certain properties with the kernel ABI such as the C calling convention, sizes of basic types, etc. +A FreeBSD kernel may support multiple userland ABIs. +For example, FreeBSD's amd64 kernel supports FreeBSD amd64 and i386 userland ABIs as well as Linux x86_64 and i386 userland ABIs. +A FreeBSD kernel should support a "native" ABI as the default ABI. +The native "ABI" generally shares certain properties with the kernel ABI such as the C calling convention, sizes of basic types, etc. Tiers are defined for both kernels and userland ABIs. In the common case, a platform's kernel and FreeBSD ABIs are assigned to the same tier. === Tier 1: Fully-Supported Architectures -Tier 1 platforms are the most mature FreeBSD platforms. They are supported by the security officer, release engineering, and port management teams. Tier 1 architectures are expected to be Production Quality with respect to all aspects of the FreeBSD operating system, including installation and development environments. +Tier 1 platforms are the most mature FreeBSD platforms. +They are supported by the security officer, release engineering, and port management teams. +Tier 1 architectures are expected to be Production Quality with respect to all aspects of the FreeBSD operating system, including installation and development environments. The FreeBSD Project provides the following guarantees to consumers of Tier 1 platforms: @@ -3766,9 +4026,12 @@ Collectively, developers are required to provide the following to maintain the T === Tier 2: Developmental and Niche Architectures -Tier 2 platforms are functional, but less mature FreeBSD platforms. They are not supported by the security officer, release engineering, and port management teams. +Tier 2 platforms are functional, but less mature FreeBSD platforms. +They are not supported by the security officer, release engineering, and port management teams. -Tier 2 platforms may be Tier 1 platform candidates that are still under active development. Architectures reaching end of life may also be moved from Tier 1 status to Tier 2 status as the availability of resources to continue to maintain the system in a Production Quality state diminishes. Well-supported niche architectures may also be Tier 2. +Tier 2 platforms may be Tier 1 platform candidates that are still under active development. +Architectures reaching end of life may also be moved from Tier 1 status to Tier 2 status as the availability of resources to continue to maintain the system in a Production Quality state diminishes. +Well-supported niche architectures may also be Tier 2. The FreeBSD Project provides the following guarantees to consumers of Tier 2 platforms: @@ -3791,21 +4054,27 @@ Collectively, developers are required to provide the following to maintain the T === Tier 3: Experimental Architectures -Tier 3 platforms have at least partial FreeBSD support. They are _not_ supported by the security officer, release engineering, and port management teams. +Tier 3 platforms have at least partial FreeBSD support. +They are _not_ supported by the security officer, release engineering, and port management teams. -Tier 3 platforms are architectures in the early stages of development, for non-mainstream hardware platforms, or which are considered legacy systems unlikely to see broad future use. Initial support for Tier 3 platforms may exist in a separate repository rather than the main source repository. +Tier 3 platforms are architectures in the early stages of development, for non-mainstream hardware platforms, or which are considered legacy systems unlikely to see broad future use. +Initial support for Tier 3 platforms may exist in a separate repository rather than the main source repository. -The FreeBSD Project provides no guarantees to consumers of Tier 3 platforms and is not committed to maintaining resources to support development. Tier 3 platforms may not always be buildable, nor are any kernel or userland ABIs considered stable. +The FreeBSD Project provides no guarantees to consumers of Tier 3 platforms and is not committed to maintaining resources to support development. +Tier 3 platforms may not always be buildable, nor are any kernel or userland ABIs considered stable. === Tier 4: Unsupported Architectures Tier 4 platforms are not supported in any form by the project. -All systems not otherwise classified are Tier 4 systems. When a platform transitions to Tier 4, all support for the platform is removed from the source and ports trees. Note that ports support should remain as long as the platform is supported in a branch supported by ports. +All systems not otherwise classified are Tier 4 systems. +When a platform transitions to Tier 4, all support for the platform is removed from the source and ports trees. +Note that ports support should remain as long as the platform is supported in a branch supported by ports. === Policy on Changing the Tier of an Architecture -Systems may only be moved from one tier to another by approval of the FreeBSD Core Team, which shall make that decision in collaboration with the Security Officer, Release Engineering, and ports management teams. For a platform to be promoted to a higher tier, any missing support guarantees must be satisfied before the promotion is completed. +Systems may only be moved from one tier to another by approval of the FreeBSD Core Team, which shall make that decision in collaboration with the Security Officer, Release Engineering, and ports management teams. +For a platform to be promoted to a higher tier, any missing support guarantees must be satisfied before the promotion is completed. [[ports]] == Ports Specific FAQ @@ -3818,12 +4087,17 @@ Systems may only be moved from one tier to another by approval of the FreeBSD Co First, please read the section about repository copies. -The easiest way to add a new port is the `addport` script located in the [.filename]#ports/Tools/scripts# directory. It adds a port from the directory specified, determining the category automatically from the port [.filename]#Makefile#. It also adds an entry to the port's category [.filename]#Makefile#. It was written by `{mharo}`, `{will}`, and `{garga}`. When sending questions about this script to the {freebsd-ports}, please also CC `{crees}`, the current maintainer. +The easiest way to add a new port is the `addport` script located in the [.filename]#ports/Tools/scripts# directory. +It adds a port from the directory specified, determining the category automatically from the port [.filename]#Makefile#. +It also adds an entry to the port's category [.filename]#Makefile#. +It was written by `{mharo}`, `{will}`, and `{garga}`. +When sending questions about this script to the {freebsd-ports}, please also CC `{crees}`, the current maintainer. [[ports-qa-add-new-extra]] ==== Any other things I need to know when I add a new port? -Check the port, preferably to make sure it compiles and packages correctly. This is the recommended sequence: +Check the port, preferably to make sure it compiles and packages correctly. +This is the recommended sequence: [source,shell] .... @@ -3838,11 +4112,13 @@ Check the port, preferably to make sure it compiles and packages correctly. This The link:{porters-handbook}[Porters Handbook] contains more detailed instructions. -Use man:portlint[1] to check the syntax of the port. You do not necessarily have to eliminate all warnings but make sure you have fixed the simple ones. +Use man:portlint[1] to check the syntax of the port. +You do not necessarily have to eliminate all warnings but make sure you have fixed the simple ones. If the port came from a submitter who has not contributed to the Project before, add that person's name to the link:{contributors}#contrib-additional[Additional Contributors] section of the FreeBSD Contributors List. -Close the PR if the port came in as a PR. To close a PR, change the state to `Issue Resolved` and the resolution as `Fixed`. +Close the PR if the port came in as a PR. +To close a PR, change the state to `Issue Resolved` and the resolution as `Fixed`. [[ports-qa-removing]] === Removing an Existing Port @@ -3872,7 +4148,9 @@ When using Git, consider using `git grep`, it is much faster than `grep -r`. * Remove the port from [.filename]#ports/LEGAL# if it is there. ==== -Alternatively, you can use the rmport script, from [.filename]#ports/Tools/scripts#. This script was written by {vd}. When sending questions about this script to the {freebsd-ports}, please also CC {crees}, the current maintainer. +Alternatively, you can use the rmport script, from [.filename]#ports/Tools/scripts#. +This script was written by {vd}. +When sending questions about this script to the {freebsd-ports}, please also CC {crees}, the current maintainer. [[ports-qa-re-adding]] === Re-adding a Deleted Port @@ -3884,7 +4162,9 @@ This is essentially the reverse of deleting a port. [IMPORTANT] ==== -Do not use `svn add` to add the port. Follow these steps. If they are unclear, or are not working, ask for help, do not just `svn add` the port. +Do not use `svn add` to add the port. +Follow these steps. +If they are unclear, or are not working, ask for help, do not just `svn add` the port. ==== [.procedure] @@ -3926,7 +4206,9 @@ The `addport` script mentioned in <> now detects when the port [[ports-qa-repocopy-when]] ==== When do we need a repository copy? -When you want to add a port that is related to any port that is already in the tree in a separate directory, you have to do a repository copy. Here related means it is a different version or a slightly modified version. Examples are [.filename]#print/ghostscript*# (different versions) and [.filename]#x11-wm/windowmaker*# (English-only and internationalized version). +When you want to add a port that is related to any port that is already in the tree in a separate directory, you have to do a repository copy. +Here related means it is a different version or a slightly modified version. +Examples are [.filename]#print/ghostscript*# (different versions) and [.filename]#x11-wm/windowmaker*# (English-only and internationalized version). Another example is when a port is moved from one subdirectory to another, or when the name of a directory must be changed because the authors renamed their software even though it is a descendant of a port already in a tree. @@ -3971,7 +4253,11 @@ With Subversion, a repo copy can be done by any committer: [[ports-qa-freeze-what]] ==== What is a “ports freeze”? -A “ports freeze” was a restricted state the ports tree was put in before a release. It was used to ensure a higher quality for the packages shipped with a release. It usually lasted a couple of weeks. During that time, build problems were fixed, and the release packages were built. This practice is no longer used, as the packages for the releases are built from the current stable, quarterly branch. +A “ports freeze” was a restricted state the ports tree was put in before a release. +It was used to ensure a higher quality for the packages shipped with a release. +It usually lasted a couple of weeks. +During that time, build problems were fixed, and the release packages were built. +This practice is no longer used, as the packages for the releases are built from the current stable, quarterly branch. For more information on how to merge commits to the quarterly branch, see <>. @@ -3988,15 +4274,16 @@ When doing the commit, add the branch name to the `MFH:` line, for example: MFH: 2014Q1 .... -It will automatically notify the {ports-secteam} and the {portmgr}. They will then decide if the commit can be merged and answer with the procedure. +It will automatically notify the {ports-secteam} and the {portmgr}. +They will then decide if the commit can be merged and answer with the procedure. If the commit has already been made, send an email to the {ports-secteam} and the {portmgr} with the revision number and a small description of why the commit needs to be merged. [TIP] ==== -Tip: +If the MFH is covered by a blanket approval, please explain why with a couple of words on the `MFH` line, so that the reviewing team can skip this commit and save time. -If the MFH is covered by a blanket approval, please explain why with a couple of words on the `MFH` line, so that the reviewing team can skip this commit and save time. For example: +For example: [.programlisting] .... @@ -4116,7 +4403,11 @@ Host *.freebsd.org [TIP] ==== -The script is also able to merge more than one revision at a time. If there have been other updates to the port since the branch was created that have not been merged because they were not security related. Add the different revisions in the order they were committed on the `mfh` line. The new commit log message will contain the combined log messages from all the original commits. These messages must be edited to show what is actually being done with the new commit. +The script is also able to merge more than one revision at a time. +If there have been other updates to the port since the branch was created that have not been merged because they were not security related. +Add the different revisions in the order they were committed on the `mfh` line. +The new commit log message will contain the combined log messages from all the original commits. +These messages must be edited to show what is actually being done with the new commit. [source,shell] .... @@ -4126,7 +4417,9 @@ The script is also able to merge more than one revision at a time. If there have [NOTE] ==== -The mfh script can also take an optional first argument, the branch where the merge is being done. Only the latest quarterly branch is supported, so specifying the branch is discouraged. To be safe, the script will give a warning if the quarterly branch is not the latest: +The mfh script can also take an optional first argument, the branch where the merge is being done. +Only the latest quarterly branch is supported, so specifying the branch is discouraged. +To be safe, the script will give a warning if the quarterly branch is not the latest: [source,shell] .... @@ -4141,7 +4434,9 @@ The mfh script can also take an optional first argument, the branch where the me [[ports-qa-new-category-how]] ==== What is the procedure for creating a new category? -Please see link:{porters-handbook}#proposing-categories[Proposing a New Category] in the Porter's Handbook. Once that procedure has been followed and the PR has been assigned to the {portmgr}, it is their decision whether or not to approve it. If they do, it is their responsibility to: +Please see link:{porters-handbook}#proposing-categories[Proposing a New Category] in the Porter's Handbook. +Once that procedure has been followed and the PR has been assigned to the {portmgr}, it is their decision whether or not to approve it. +If they do, it is their responsibility to: [.procedure] ==== @@ -4174,21 +4469,15 @@ To do this, use the [.filename]#chkorigin.sh# tool: `env PORTSDIR=/path/to/ports . Add appropriate entries to [.filename]#ports/MOVED#. . Update the documentation by modifying: ** the link:{porters-handbook}#PORTING-CATEGORIES[list of categories] in the Porter's Handbook -** [.filename]#doc/en_US.ISO8859-1/htdocs/ports#. Note that these are now displayed by sub-groups, as specified in [.filename]#doc/en_US.ISO8859-1/htdocs/ports/categories.descriptions#. -+ -(Note: these are in the docs, not the ports, repository). If you are not a docs committer, you will need to submit a PR for this. + . Only once all the above have been done, and no one is any longer reporting problems with the new ports, should the old ports be deleted from their previous locations in the repository. ==== -It is not necessary to manually update the link:https://www.FreeBSD.org/ports/[ports web pages] to reflect the new category. This is done automatically via the change to [.filename]#en_US.ISO8859-1/htdocs/ports/categories# and the automated rebuild of INDEX. - ==== What do I need to do to implement a new virtual category? This is much simpler than a physical category. Only a few modifications are needed: * the link:{porters-handbook}#PORTING-CATEGORIES[list of categories] in the Porter's Handbook -* [.filename]#en_US.ISO8859-1/htdocs/ports/categories# [[ports-qa-misc-questions]] === Miscellaneous Questions @@ -4204,13 +4493,15 @@ Blanket approval for most ports applies to these types of fixes: [IMPORTANT] ==== -Exceptions to this are anything maintained by the {portmgr}, or the {security-officer}. No unauthorized commits may ever be made to ports maintained by those groups. +Exceptions to this are anything maintained by the {portmgr}, or the {security-officer}. +No unauthorized commits may ever be made to ports maintained by those groups. ==== [[ports-qa-misc-correctly-building]] ==== How do I know if my port is building correctly or not? -The packages are built multiple times each week. If a port fails, the maintainer will receive an email from `pkg-fallout@FreeBSD.org`. +The packages are built multiple times each week. +If a port fails, the maintainer will receive an email from `pkg-fallout@FreeBSD.org`. Reports for all the package builds (official, experimental, and non-regression) are aggregated at link:pkg-status.FreeBSD.org[pkg-status.FreeBSD.org]. @@ -4222,17 +4513,20 @@ No. The file can either be generated by running `make index`, or a pre-generated [[ports-qa-misc-no-touch]] ==== Are there any other files I am not allowed to touch? -Any file directly under [.filename]#ports/#, or any file under a subdirectory that starts with an uppercase letter ([.filename]#Mk/#, [.filename]#Tools/#, etc.). In particular, the {portmgr} is very protective of [.filename]#ports/Mk/bsd.port*.mk# so do not commit changes to those files unless you want to face their wrath. +Any file directly under [.filename]#ports/#, or any file under a subdirectory that starts with an uppercase letter ([.filename]#Mk/#, [.filename]#Tools/#, etc.). +In particular, the {portmgr} is very protective of [.filename]#ports/Mk/bsd.port*.mk# so do not commit changes to those files unless you want to face their wrath. [[ports-qa-misc-updated-distfile]] ==== What is the proper procedure for updating the checksum for a port distfile when the file changes without a version change? -When the checksum for a distribution file is updated due to the author updating the file without changing the port revision, the commit message includes a summary of the relevant diffs between the original and new distfile to ensure that the distfile has not been corrupted or maliciously altered. If the current version of the port has been in the ports tree for a while, a copy of the old distfile will usually be available on the ftp servers; otherwise the author or maintainer should be contacted to find out why the distfile has changed. +When the checksum for a distribution file is updated due to the author updating the file without changing the port revision, the commit message includes a summary of the relevant diffs between the original and new distfile to ensure that the distfile has not been corrupted or maliciously altered. +If the current version of the port has been in the ports tree for a while, a copy of the old distfile will usually be available on the ftp servers; otherwise the author or maintainer should be contacted to find out why the distfile has changed. [[ports-exp-run]] ==== How can an experimental test build of the ports tree (exp-run) be requested? -An exp-run must be completed before patches with a significant ports impact are committed. The patch can be against the ports tree or the base system. +An exp-run must be completed before patches with a significant ports impact are committed. +The patch can be against the ports tree or the base system. Full package builds will be done with the patches provided by the submitter, and the submitter is required to fix detected problems _(fallout)_ before commit. @@ -4254,7 +4548,9 @@ Full package builds will be done with the patches provided by the submitter, and [[non-committers]] == Issues Specific to Developers Who Are Not Committers -A few people who have access to the FreeBSD machines do not have commit bits. Almost all of this document will apply to these developers as well (except things specific to commits and the mailing list memberships that go with them). In particular, we recommend that you read: +A few people who have access to the FreeBSD machines do not have commit bits. +Almost all of this document will apply to these developers as well (except things specific to commits and the mailing list memberships that go with them). +In particular, we recommend that you read: * <> * <> @@ -4270,20 +4566,25 @@ Get your mentor to add you to the "Additional Contributors" ([.filename]#doc/en_ [[google-analytics]] == Information About Google Analytics -As of December 12, 2012, Google Analytics was enabled on the FreeBSD Project website to collect anonymized usage statistics regarding usage of the site. The information collected is valuable to the FreeBSD Documentation Project, to identify various problems on the FreeBSD website. +As of December 12, 2012, Google Analytics was enabled on the FreeBSD Project website to collect anonymized usage statistics regarding usage of the site. +The information collected is valuable to the FreeBSD Documentation Project, to identify various problems on the FreeBSD website. [[google-analytics-policy]] === Google Analytics General Policy -The FreeBSD Project takes visitor privacy very seriously. As such, the FreeBSD Project website honors the "Do Not Track" header _before_ fetching the tracking code from Google. For more information, please see the https://www.FreeBSD.org/privacy/[FreeBSD Privacy Policy]. +The FreeBSD Project takes visitor privacy very seriously. +As such, the FreeBSD Project website honors the "Do Not Track" header _before_ fetching the tracking code from Google. +For more information, please see the https://www.FreeBSD.org/privacy/[FreeBSD Privacy Policy]. Google Analytics access is _not_ arbitrarily allowed - access must be requested, voted on by the `{doceng}`, and explicitly granted. -Requests for Google Analytics data must include a specific purpose. For example, a valid reason for requesting access would be "to see the most frequently used web browsers when viewing FreeBSD web pages to ensure page rendering speeds are acceptable." +Requests for Google Analytics data must include a specific purpose. +For example, a valid reason for requesting access would be "to see the most frequently used web browsers when viewing FreeBSD web pages to ensure page rendering speeds are acceptable." Conversely, "to see what web browsers are most frequently used" (without stating __why__) would be rejected. -All requests must include the timeframe for which the data would be required. For example, it must be explicitly stated if the requested data would be needed for a timeframe covering a span of 3 weeks, or if the request would be one-time only. +All requests must include the timeframe for which the data would be required. +For example, it must be explicitly stated if the requested data would be needed for a timeframe covering a span of 3 weeks, or if the request would be one-time only. Any request for Google Analytics data without a clear, reasonable reason beneficial to the FreeBSD Project will be rejected. @@ -4309,11 +4610,15 @@ Blanket approval for most ports applies to these types of fixes: === How do I add a new file to a branch? -To add a file onto a branch, simply checkout or update to the branch you want to add to and then add the file using the add operation as you normally would. This works fine for the `doc` and `ports` trees. The `src` tree uses SVN and requires more care because of the `mergeinfo` properties. See the <> for details on how to perform an MFC. +To add a file onto a branch, simply checkout or update to the branch you want to add to and then add the file using the add operation as you normally would. +This works fine for the `doc` and `ports` trees. +The `src` tree uses SVN and requires more care because of the `mergeinfo` properties. +See the <> for details on how to perform an MFC. === How do I access people.FreeBSD.org to put up personal or project information? -`people.FreeBSD.org` is the same as `freefall.FreeBSD.org`. Just create a [.filename]#public_html# directory. Anything you place in that directory will automatically be visible under https://people.FreeBSD.org/[https://people.FreeBSD.org/]. +`people.FreeBSD.org` is the same as `freefall.FreeBSD.org`. +Just create a [.filename]#public_html# directory. Anything you place in that directory will automatically be visible under https://people.FreeBSD.org/[https://people.FreeBSD.org/]. === Where are the mailing list archives stored? @@ -4329,7 +4634,8 @@ See the https://www.freebsd.org/internal/new-account/[New Account Creation Proce [[benefits-recognition]] === Recognition -Recognition as a competent software engineer is the longest lasting value. In addition, getting a chance to work with some of the best people that every engineer would dream of meeting is a great perk! +Recognition as a competent software engineer is the longest lasting value. +In addition, getting a chance to work with some of the best people that every engineer would dream of meeting is a great perk! [[benefits-freebsdmall]] === FreeBSD Mall @@ -4340,11 +4646,13 @@ FreeBSD committers can get a free 4-CD or DVD set at conferences from http://www === IRC In addition, developers may request a cloaked hostmask for their account on the Freenode IRC network in the form of `freebsd/developer/` or `freebsd/developer/`. -To request a cloak, send an email to `{irc-email}` with your requested hostmask and NickServ account name. See the https://wiki.freebsd.org/IRC/Cloaks[IRC Cloaks] wiki page for more details. +To request a cloak, send an email to `{irc-email}` with your requested hostmask and NickServ account name. +See the https://wiki.freebsd.org/IRC/Cloaks[IRC Cloaks] wiki page for more details. [[benefits-gandi]] === `Gandi.net` Gandi provides website hosting, cloud computing, domain registration, and X.509 certificate services. -Gandi offers an E-rate discount to all FreeBSD developers. Send mail to mailto:non-profit@gandi.net[non-profit@gandi.net] using your `@freebsd.org` mail address, and indicate your Gandi handle. +Gandi offers an E-rate discount to all FreeBSD developers. +Send mail to mailto:non-profit@gandi.net[non-profit@gandi.net] using your `@freebsd.org` mail address, and indicate your Gandi handle.