deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rafab...@apache.org
Subject svn commit: r1648575 [3/3] - /deltaspike/site/trunk/content/staging/
Date Tue, 30 Dec 2014 18:52:18 GMT
Added: deltaspike/site/trunk/content/staging/suggested-git-workflows.html
URL: http://svn.apache.org/viewvc/deltaspike/site/trunk/content/staging/suggested-git-workflows.html?rev=1648575&view=auto
==============================================================================
--- deltaspike/site/trunk/content/staging/suggested-git-workflows.html (added)
+++ deltaspike/site/trunk/content/staging/suggested-git-workflows.html Tue Dec 30 18:52:17
2014
@@ -0,0 +1,462 @@
+<!DOCTYPE html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+<meta name="description" content="deltaspike-generate-pages">
+<meta name="author" content="chm">
+<!-- No caching headers -->
+<meta http-equiv="cache-control" content="no-cache" />
+<meta http-equiv="pragma" content="no-cache" />
+<meta http-equiv="expires" content="-1" />
+
+<title>Suggested GIT workflows</title>
+
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license
agreements.  See the NOTICE file distributed with this work for additional information regarding
copyright ownership.  The ASF licenses this file to you under the Apache License, Version
2.0 (the &quot;License&quot;); you may not use this file except in compliance with
the License.  You may obtain a copy of the License at . http://www.apache.org/licenses/LICENSE-2.0
. Unless required by applicable law or agreed to in writing, software distributed under the
License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS
OF ANY KIND, either express or implied.  See the License for the specific language governing
permissions and limitations under the License. -->
+
+<!-- Styles -->
+
+<link href="https://deltaspike.apache.org/resources/css/bootstrap.css" rel="stylesheet">
+<link href="https://deltaspike.apache.org/resources/css/bootstrap-responsive.css" rel="stylesheet">
+<link href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.1.0/css/font-awesome.min.css"
rel="stylesheet" >
+
+<style type="text/css">
+/* Stylesheet for CodeRay to match GitHub theme | MIT License | http://foundation.zurb.com
*/
+/*pre.CodeRay {background-color:#f7f7f8;}*/
+.CodeRay .line-numbers{border-right:1px solid #d8d8d8;padding:0 0.5em 0 .25em}
+.CodeRay span.line-numbers{display:inline-block;margin-right:.5em;color:rgba(0,0,0,.3)}
+.CodeRay .line-numbers strong{font-weight: normal}
+table.CodeRay{border-collapse:separate;border-spacing:0;margin-bottom:0;border:0;background:none}
+table.CodeRay td{vertical-align: top}
+table.CodeRay td.line-numbers{text-align:right}
+table.CodeRay td.line-numbers>pre{padding:0;color:rgba(0,0,0,.3)}
+table.CodeRay td.code{padding:0 0 0 .5em}
+table.CodeRay td.code>pre{padding:0}
+.CodeRay .debug{color:#fff !important;background:#000080 !important}
+.CodeRay .annotation{color:#007}
+.CodeRay .attribute-name{color:#000080}
+.CodeRay .attribute-value{color:#700}
+.CodeRay .binary{color:#509}
+.CodeRay .comment{color:#998;font-style:italic}
+.CodeRay .char{color:#04d}
+.CodeRay .char .content{color:#04d}
+.CodeRay .char .delimiter{color:#039}
+.CodeRay .class{color:#458;font-weight:bold}
+.CodeRay .complex{color:#a08}
+.CodeRay .constant,.CodeRay .predefined-constant{color:#008080}
+.CodeRay .color{color:#099}
+.CodeRay .class-variable{color:#369}
+.CodeRay .decorator{color:#b0b}
+.CodeRay .definition{color:#099}
+.CodeRay .delimiter{color:#000}
+.CodeRay .doc{color:#970}
+.CodeRay .doctype{color:#34b}
+.CodeRay .doc-string{color:#d42}
+.CodeRay .escape{color:#666}
+.CodeRay .entity{color:#800}
+.CodeRay .error{color:#808}
+.CodeRay .exception{color:inherit}
+.CodeRay .filename{color:#099}
+.CodeRay .function{color:#900;font-weight:bold}
+.CodeRay .global-variable{color:#008080}
+.CodeRay .hex{color:#058}
+.CodeRay .integer,.CodeRay .float{color:#099}
+.CodeRay .include{color:#555}
+.CodeRay .inline{color:#00}
+.CodeRay .inline .inline{background:#ccc}
+.CodeRay .inline .inline .inline{background:#bbb}
+.CodeRay .inline .inline-delimiter{color:#d14}
+.CodeRay .inline-delimiter{color:#d14}
+.CodeRay .important{color:#555;font-weight:bold}
+.CodeRay .interpreted{color:#b2b}
+.CodeRay .instance-variable{color:#008080}
+.CodeRay .label{color:#970}
+.CodeRay .local-variable{color:#963}
+.CodeRay .octal{color:#40e}
+.CodeRay .predefined{color:#369}
+.CodeRay .preprocessor{color:#579}
+.CodeRay .pseudo-class{color:#555}
+.CodeRay .directive{font-weight:bold}
+.CodeRay .type{font-weight:bold}
+.CodeRay .predefined-type{color:inherit}
+.CodeRay .reserved,.CodeRay .keyword {color:#000;font-weight:bold}
+.CodeRay .key{color:#808}
+.CodeRay .key .delimiter{color:#606}
+.CodeRay .key .char{color:#80f}
+.CodeRay .value{color:#088}
+.CodeRay .regexp .delimiter{color:#808}
+.CodeRay .regexp .content{color:#808}
+.CodeRay .regexp .modifier{color:#808}
+.CodeRay .regexp .char{color:#d14}
+.CodeRay .regexp .function{color:#404;font-weight:bold}
+.CodeRay .string{color:#d20}
+.CodeRay .string .string .string{background:#ffd0d0}
+.CodeRay .string .content{color:#d14}
+.CodeRay .string .char{color:#d14}
+.CodeRay .string .delimiter{color:#d14}
+.CodeRay .shell{color:#d14}
+.CodeRay .shell .delimiter{color:#d14}
+.CodeRay .symbol{color:#990073}
+.CodeRay .symbol .content{color:#a60}
+.CodeRay .symbol .delimiter{color:#630}
+.CodeRay .tag{color:#008080}
+.CodeRay .tag-special{color:#d70}
+.CodeRay .variable{color:#036}
+.CodeRay .insert{background:#afa}
+.CodeRay .delete{background:#faa}
+.CodeRay .change{color:#aaf;background:#007}
+.CodeRay .head{color:#f8f;background:#505}
+.CodeRay .insert .insert{color:#080}
+.CodeRay .delete .delete{color:#800}
+.CodeRay .change .change{color:#66f}
+.CodeRay .head .head{color:#f4f}
+
+body {
+	padding-top: 60px;
+	padding-bottom: 40px;
+}
+</style>
+<script type="text/javascript">
+
+	  var _gaq = _gaq || [];
+	  _gaq.push(['_setAccount', 'UA-36103647-1']);
+	  _gaq.push(['_trackPageview']);
+	
+	  (function() {
+		var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+		ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+		var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+	  })();
+	
+	</script>
+</head>
+
+<body>
+
+	<div class="navbar navbar-fixed-top">
+		<div class="navbar-inner">
+			<div class="container">
+				<a class="btn btn-navbar" data-toggle="collapse"
+					data-target=".nav-collapse"> <span class="icon-bar"></span> <span
+					class="icon-bar"></span> <span class="icon-bar"></span>
+				</a> <a class="brand logocolor"
+					href="./index.html">Apache DeltaSpike</a>
+				<div class="nav-collapse">
+					<ul class="nav">
+						<li class="active"><a
+							href="./index.html">Home</a></li>
+						<li><a href="./documentation">Documentation</a></li>
+						<li><a href="./javadoc.html">Javadoc</a></li>
+						<li><a href="./documentation/source.html">Source</a></li>
+						<li><a href="./download.html">Download</a></li>
+						<li><a href="./community.html">Community</a></li>
+						<!-- <li><a href="./support.html">Support</a></li>  -->
+						<li><a href="./news.html">News</a></li>
+						<li><a href="./migration-guide.html">Migration</a></li>
+					</ul>
+				</div>
+				<!--/.nav-collapse -->
+				<form id="search-form" action="http://www.google.com/search"
+					method="get" class="navbar-search pull-right">
+					<input value="deltaspike.apache.org" name="sitesearch"
+						type="hidden"> <input class="search-query" name="q"
+						id="query" type="text">
+				</form>
+			</div>
+		</div>
+	</div>
+
+	<div class="container">
+		<div class="row">
+			<div class="span12">
+				<div class="page-title">
+			    <h1>Suggested GIT workflows</h1>
+                </div>
+
+				<div id="toc" class="toc">
+       	 		<ul class="sectlevel1">
+<li><a href="#_avoid_git_pull">Avoid git-pull!</a></li>
+<li><a href="#_git_pull_rebase">git pull --rebase</a>
+<ul class="sectlevel2">
+<li><a href="#_working_in_an_own_branch">Working in an own branch</a></li>
+</ul>
+</li>
+<li><a href="#_contribution_workflow">Contribution workflow</a>
+<ul class="sectlevel2">
+<li><a href="#_creating_patches">Creating patches</a></li>
+</ul>
+</li>
+<li><a href="#_discussion_workflow_optional">Discussion workflow (optional)</a></li>
+</ul>
+       	 		<hr>	
+       	 		
+				<div class="sect1">
+<h2 id="_avoid_git_pull">Avoid git-pull!</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>git-pull should never get invoked if you have dirty files lying around
+or if your branch is ahead of master. This will always lead to some
+dirty artifacts in the commit history:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre>Merge branch 'master' of http://git-wip-us.apache.org/deltaspike into master</pre>
+</div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_git_pull_rebase">git pull --rebase</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>An easy version for getting rid of the auto-merges is using</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay highlight"><code data-lang="bash">$ git pull --rebase</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>Please note that this sometimes trashes your working tree if there are
+unmergeable files around. Cleaning this up with a forced manual rebase
+is not something we would recommend for a git beginner.</p>
+</div>
+<div class="sect2">
+<h3 id="_working_in_an_own_branch">Working in an own branch</h3>
+<div class="paragraph">
+<p>This is actually the suggested way to prevent auto-merges.</p>
+</div>
+<div class="paragraph">
+<p>Create an own branch where you do your feature work. Either do all your
+work in one branch or create one branch per feature you are working on.</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay highlight"><code data-lang="bash">$ git branch mybranch</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>After you finished your feature, <code>git-add</code> and <code>git-commit</code>
your work.
+Check with <code>git-status</code> that you don&#8217;t have any dirty files
and
+uncommitted changes around. You can use <code>git-stash</code> to 'backup'
+unfinished work.</p>
+</div>
+<div class="paragraph">
+<p>Then switch back to the master branch and pull changes done by other
+committers in the meantime.</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre>$ git checkout master
+$ git pull --rebase</pre>
+</div>
+</div>
+<div class="paragraph">
+<p>You should now get all the changes done by other committers and the will
+get applied to your local master branch. Now go back to your private
+branch and rebase your locally performed work to the HEAD of master.</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre>$ git checkout mybranch
+$ git rebase master</pre>
+</div>
+</div>
+<div class="paragraph">
+<p>If you got conflicts, you will get lines with "&gt;&gt;&gt;&gt;"
added to those
+files. Resolve those conflicts manually, add them and finish the rebase.</p>
+</div>
+<div class="paragraph">
+<p>Check with <code>git-status</code> and <code>gitk</code>
if the merge went well and the
+history now contains your changes. If all is well, go back to the master
+branch and merge your changes in.</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre>$ git pull --rebase     // (just for safety, you should see no changes)
+$ git checkout master
+$ git merge mybranch</pre>
+</div>
+</div>
+<div class="paragraph">
+<p>Finally you can push your changes to the ASF git repo</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre>$ git push</pre>
+</div>
+</div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_contribution_workflow">Contribution workflow</h2>
+<div class="sectionbody">
+<div class="sect2">
+<h3 id="_creating_patches">Creating patches</h3>
+<div class="paragraph">
+<p>You should use the following workflow, if you plan to contribute patches or new
features to DeltaSpike.</p>
+</div>
+<div class="paragraph">
+<p>First update you local copy of the repository:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre>$ git checkout master
+$ git pull --rebase</pre>
+</div>
+</div>
+<div class="paragraph">
+<p>Then create a new local branch for your work. It&#8217;s good practice to name
it after the corresponding JIRA issue.</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre>$ git checkout -b DELTASPIKE-XXX</pre>
+</div>
+</div>
+<div class="paragraph">
+<p>Now you can start to work on your patch. When you are finished, commit
+your changes. But don&#8217;t forget to <strong>add the name of the JIRA issue
to
+the commit message</strong>.</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre>$ git add -am "DELTASPIKE-XXX: Fixed some issue"</pre>
+</div>
+</div>
+<div class="paragraph">
+<p>For small patches we recommend to do a single commit containing your
+changes. For larger contributions you should try to group your work into
+separate sub-tasks that you can commit one by one.</p>
+</div>
+<div class="paragraph">
+<p>Before you create your patch you should make sure that your local
+repository is up to date with the master repository. This is very
+important especially if you work on your branch for a long time. Use the
+following commands to pull the latest changes from the upstream
+repository and rebase your branch against the current master.</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay highlight"><code data-lang="bash">$ git checkout master
+$ git pull --rebase
+$ git checkout DELTASPIKE-XXX
+$ git rebase master</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>Now you are ready to create your patch:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay highlight"><code data-lang="bash">$ git checkout DELTASPIKE-XXX
+$ git format-patch --stdout master &gt; ../DELTASPIKE-XXX.patch</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>Please attach the resulting patch file to the correspoding JIRA issue.</p>
+</div>
+<div class="paragraph">
+<p>===Applying patches</p>
+</div>
+<div class="paragraph">
+<p>If you are a committer and want to apply a patch you should do so in a
+separate branch.</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre>$ git checkout -b DELTASPIKE-XXX</pre>
+</div>
+</div>
+<div class="paragraph">
+<p>Then apply the patch using <code>git-am</code> and rebase it against
the master
+branch.</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre>$ git am &lt; ../DELTASPIKE-XXX.patch
+$ git rebase master</pre>
+</div>
+</div>
+<div class="paragraph">
+<p>After reviewing the changes and testing the code, the changes are ready
+to be merged into the master branch:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre>$ git checkout master
+$ git merge DELTASPIKE-XXX
+$ git branch -d DELTASPIKE-XXX</pre>
+</div>
+</div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_discussion_workflow_optional">Discussion workflow (optional)</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>All discussions which lead to a decision take place on the mailing list.
+Sometimes it&#8217;s required to show-case an idea esp. if the solution is
+more than few lines. As shown above it makes sense to use local branches
+for developing new parts. Git allows to push such local branches to a
+public repository. So it&#8217;s easier to share it with the community for
+discussing it. The following listings show an example in combination
+with GitHub - for sure it works with any hosting platform like
+BitBucket, Google-Code,&#8230;&#8203; The only important part here is that such
+branches <em>NEVER</em> get pushed to the main Apache repository to keep the
+commit history as clean as possible.</p>
+</div>
+<div class="paragraph">
+<p><strong>Initial setup</strong></p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay highlight"><code data-lang="bash">$ git clone https://git-wip-us.apache.org/repos/asf/deltaspike.git
./
+$ git remote add discuss https://[username]@github.com/[username]/[repo-name].git
+$ git push -u discuss master</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p><strong>Branches for discussions</strong></p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay highlight"><code data-lang="bash">$ git checkout -b DELTASPIKE-XXX
+//1-n commits
+$ git push discuss DELTASPIKE-XXX
+//share the link to the branch for the discussions</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p><em>If the community agrees on the suggested change, the implementation
+will be applied to the origin master. A committer has to follow the
+steps described above for the basic workflow to keep the commit history
+simple, clean and straight. A contributor has to follow the steps
+described above for creating a patch.</em></p>
+</div>
+<div class="paragraph">
+<p><strong>Delete the branch again</strong></p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre>$ git push discuss :DELTASPIKE-XXX
+$ git branch -d DELTASPIKE-XXX</pre>
+</div>
+</div>
+</div>
+</div>
+			</div>
+
+			<hr>
+
+			<footer>
+				<p>Copyright © 2011-2014 The Apache Software Foundation, Licensed under the
Apache License, Version 2.0.</p>
+				<p>Apache and the Apache feather logo are trademarks of The Apache Software Foundation.</p>
+			</footer>
+
+		</div>
+		<!-- /.container -->
+
+</body>
+</html>
\ No newline at end of file



Mime
View raw message