Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 917b12189aa1c35ab526605d1d1ac12b > files > 271

geda-docs-1.4.3-1mdv2010.0.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
 lang="en" dir="ltr">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>geda:scm</title>
<meta name="generator" content="DokuWiki Release rc2007-05-24" />
<meta name="robots" content="index,follow" />
<meta name="date" content="2007-12-01T01:20:56-0500" />
<meta name="keywords" content="geda,scm" />
<link rel="search" type="application/opensearchdescription+xml" href="http://geda.seul.org/wiki/lib/exe/opensearch.php" title="geda Wiki" />
<link rel="start" href="http://geda.seul.org/wiki/" />
<link rel="contents" href="http://geda.seul.org/wiki/geda:scm?do=index" title="Index" />
<link rel="alternate" type="application/rss+xml" title="Recent Changes" href="http://geda.seul.org/wiki/feed.php" />
<link rel="alternate" type="application/rss+xml" title="Current Namespace" href="http://geda.seul.org/wiki/feed.php?mode=list&ns=geda" />
<link rel="alternate" type="text/html" title="Plain HTML" href="http://geda.seul.org/wiki/_export/xhtml/geda:scm" />
<link rel="alternate" type="text/plain" title="Wiki Markup" href="http://geda.seul.org/wiki/_export/raw/geda:scm" />
<link rel="stylesheet" media="all" type="text/css" href="lib/exe/css" />
<link rel="stylesheet" media="screen" type="text/css" href="lib/exe/001css" />
<link rel="stylesheet" media="print" type="text/css" href="lib/exe/002css" />
</head>
<body>
<div class="dokuwiki export">
<div class="toc">
<div class="tocheader toctoggle" id="toc__header">Table of Contents</div>
<div id="toc__inside">

<ul class="toc">
<li class="level1"><div class="li"><span class="li"><a href="#geda_gaf_s_source_control_management" class="toc">gEDA/gaf&#039;s Source Control Management</a></span></div>
<ul class="toc">
<li class="level2"><div class="li"><span class="li"><a href="#installing_git_related_tools" class="toc">Installing git &amp; related tools</a></span></div>
<ul class="toc">
<li class="level3"><div class="li"><span class="li"><a href="#debian-based" class="toc">Debian-based</a></span></div></li>
<li class="level3"><div class="li"><span class="li"><a href="#fedora_linux" class="toc">Fedora Linux</a></span></div></li>
</ul>
</li>
<li class="level2"><div class="li"><span class="li"><a href="#learning_to_use_git" class="toc">Learning to use git</a></span></div></li>
<li class="level2"><div class="li"><span class="li"><a href="#accessing_the_repository" class="toc">Accessing the repository</a></span></div></li>
<li class="level2"><div class="li"><span class="li"><a href="#making_and_committing_changes" class="toc">Making and committing changes</a></span></div>
<ul class="toc">
<li class="level3"><div class="li"><span class="li"><a href="#setting_up_user_information" class="toc">Setting up user information</a></span></div></li>
<li class="level3"><div class="li"><span class="li"><a href="#committing_patches_from_other_contributors" class="toc">Committing patches from other contributors</a></span></div></li>
<li class="level3"><div class="li"><span class="li"><a href="#writing_good_commit_messages" class="toc">Writing good commit messages</a></span></div></li>
<li class="level3"><div class="li"><span class="li"><a href="#push_is_destructive" class="toc">Push is Destructive</a></span></div></li>
</ul>
</li>
<li class="level2"><div class="li"><span class="li"><a href="#how_do_i" class="toc">How Do I ... ?</a></span></div>
<ul class="toc">
<li class="level3"><div class="li"><span class="li"><a href="#get_a_copy_of_geda_gaf_git_repository" class="toc">... get a copy of gEDA/gaf git repository?</a></span></div></li>
<li class="level3"><div class="li"><span class="li"><a href="#keep_my_local_copy_current" class="toc">... keep my local copy current?</a></span></div></li>
<li class="level3"><div class="li"><span class="li"><a href="#commit_my_changes_to_the_local_git_repository" class="toc">... commit my changes to the local git repository?</a></span></div></li>
<li class="level3"><div class="li"><span class="li"><a href="#undo_any_uncommitted_local_changes" class="toc">... undo any uncommitted local changes?</a></span></div></li>
<li class="level3"><div class="li"><span class="li"><a href="#fix_change_my_last_commit" class="toc">... fix/change my last commit?</a></span></div></li>
<li class="level3"><div class="li"><span class="li"><a href="#recover_from_a_really_messed_up_local_repository" class="toc">... recover from a really messed up local repository?</a></span></div></li></ul>
</li></ul>
</li></ul>
</div>
</div>



<h1><a name="geda_gaf_s_source_control_management" id="geda_gaf_s_source_control_management">gEDA/gaf&#039;s Source Control Management</a></h1>
<div class="level1">

<p>
 gEDA uses <strong>git</strong> for source code management.  git is a distributed version control system, where every user has his or her own full copy of the revision history. 
</p>
<ul>
<li class="level1"><div class="li"> <a href="http://git.or.cz/" class="urlextern" title="http://git.or.cz/"  rel="nofollow">Official git website</a></div>
</li>
<li class="level1"><div class="li"> <a href="http://www.kernel.org/pub/software/scm/git/docs/" class="urlextern" title="http://www.kernel.org/pub/software/scm/git/docs/"  rel="nofollow">git documentation online</a></div>
</li>
<li class="level1"><div class="li"> <a href="http://en.wikipedia.org/wiki/Git_(software)" class="urlextern" title="http://en.wikipedia.org/wiki/Git_(software)"  rel="nofollow">git Wikipedia page</a></div>
</li>
</ul>

<p>
 The web interface to the gEDA git repository is at <a href="http://git.gpleda.org/" class="urlextern" title="http://git.gpleda.org/"  rel="nofollow">http://git.gpleda.org/</a>.
</p>

</div>
<!-- SECTION "gEDA/gaf's Source Control Management" [1-494] -->
<h2><a name="installing_git_related_tools" id="installing_git_related_tools">Installing git &amp; related tools</a></h2>
<div class="level2">

<p>
 The core git tools are of course required for using the repository, and the documentation is always useful.  However, other tools are often helpful for working with git: 
</p>
<ul>
<li class="level1"><div class="li"> <a href="http://www.kernel.org/pub/software/scm/git/docs/gitk.html" class="urlextern" title="http://www.kernel.org/pub/software/scm/git/docs/gitk.html"  rel="nofollow">gitk</a>, a visual history repository browser</div>
</li>
<li class="level1"><div class="li"> <a href="http://www.procode.org/stgit/" class="urlextern" title="http://www.procode.org/stgit/"  rel="nofollow">Stacked Git</a>, for working with patchsets</div>
</li>
</ul>

<p>
 Make sure that you install at least version 1.5.x of git if you are planning on pushing changes to the central git repository.  
</p>

</div>
<!-- SECTION "Installing git & related tools" [495-1027] -->
<h3><a name="debian-based" id="debian-based">Debian-based</a></h3>
<div class="level3">
<pre class="code">apt-get install git-core git-doc gitk stgit</pre>

<p>
 you may also want: 
</p>
<pre class="code">apt-get install git-email git-completion</pre>

<p>
 Note, as of 2007/06/25, Debian stable (etch) and Debian testing (lenny) have git version 1.4.x.  Debian unstable (sid) has 1.5.2.2.
</p>

</div>
<!-- SECTION "Debian-based" [1028-1295] -->
<h3><a name="fedora_linux" id="fedora_linux">Fedora Linux</a></h3>
<div class="level3">
<pre class="code">yum install git stgit </pre>

</div>
<!-- SECTION "Fedora Linux" [1296-1346] -->
<h2><a name="learning_to_use_git" id="learning_to_use_git">Learning to use git</a></h2>
<div class="level2">

<p>
 The toplevel documentation for git can be found at:
</p>

<p>
<a href="http://www.kernel.org/pub/software/scm/git/docs/" class="urlextern" title="http://www.kernel.org/pub/software/scm/git/docs/"  rel="nofollow">Official git docs</a>
</p>

<p>
The user’s manual for git can be found at:
</p>

<p>
<a href="http://www.kernel.org/pub/software/scm/git/docs/user-manual.html" class="urlextern" title="http://www.kernel.org/pub/software/scm/git/docs/user-manual.html"  rel="nofollow">git user manual</a>
</p>

<p>
A current tutorial can be found at:
</p>

<p>
<a href="http://www.kernel.org/pub/software/scm/git/docs/core-tutorial.html" class="urlextern" title="http://www.kernel.org/pub/software/scm/git/docs/core-tutorial.html"  rel="nofollow">git core tutorial</a>
</p>

<p>
Other nice tutorials/webpages: 
</p>

<p>
<a href="http://wiki.sourcemage.org/Git_Guide" class="urlextern" title="http://wiki.sourcemage.org/Git_Guide"  rel="nofollow">Git Guide</a><br/>
 <a href="http://git.or.cz/course/index.html" class="urlextern" title="http://git.or.cz/course/index.html"  rel="nofollow">git Crash Courses</a><br/>
 <a href="http://www.kernel.org/pub/software/scm/git/docs/tutorial.html" class="urlextern" title="http://www.kernel.org/pub/software/scm/git/docs/tutorial.html"  rel="nofollow">Git for Everyone</a><br/>

</p>

<p>
Keep in mind that some of these tutorials are a little dated and may not cover current git syntax.
</p>

</div>
<!-- SECTION "Learning to use git" [1347-2097] -->
<h2><a name="accessing_the_repository" id="accessing_the_repository">Accessing the repository</a></h2>
<div class="level2">

<p>
 To clone the gaf.git repository using anonymous git access: 
</p>
<pre class="code">git clone git://git.gpleda.org/gaf.git</pre>

<p>
 If you are behind a firewall, you can also use the http access method (if you built git with curl and libcurl support) using: 
</p>
<pre class="code">git clone http://git.gpleda.org/git/gaf.git</pre>

<p>
 For developer git access, you should contact Ales Hvezda to get an <acronym title="Secure Shell">SSH</acronym> public key installed and an account; having done so, the git <acronym title="Uniform Resource Locator">URL</acronym> to push to is: 
</p>
<pre class="code">git clone ssh://&lt;username&gt;@git.gpleda.org/home/git/gaf.git</pre>

<p>
 If you have ssh access you will also need to edit your ~/.ssh/config file (create it if it doesn’t exist) and put the following text into it: 
</p>
<pre class="code">Host git.gpleda.org
Port 5022</pre>

<p>
 Finally, it is possible to access the repository using <acronym title="Concurrent Versions System">CVS</acronym>, as there is a git-cvsserver running.  This is read-only access. 
</p>
<pre class="code"> export CVSROOT=:pserver:anonymous@git.gpleda.org/home/git/gaf.git
 cvs co master    </pre>

<p>
 You can only checkout exported heads (for example: master).
</p>

</div>
<!-- SECTION "Accessing the repository" [2098-3082] -->
<h2><a name="making_and_committing_changes" id="making_and_committing_changes">Making and committing changes</a></h2>
<div class="level2">

</div>
<!-- SECTION "Making and committing changes" [3083-3127] -->
<h3><a name="setting_up_user_information" id="setting_up_user_information">Setting up user information</a></h3>
<div class="level3">

<p>
 You should make sure that your username &amp; e-mail address are set in your git configuration file. 
</p>
<pre class="code">$ git config --global user.name &quot;Your Name Comes Here&quot;
$ git config --global user.email you@yourdomain.example.com</pre>

</div>
<!-- SECTION "Setting up user information" [3128-3385] -->
<h3><a name="committing_patches_from_other_contributors" id="committing_patches_from_other_contributors">Committing patches from other contributors</a></h3>
<div class="level3">

<p>
 If you apply a patch from someone else (e.g. from a SourceForge patch record) there are a few things to consider. Git stores two different names and e-mail addresses for a given commit: the “author” of the patch, and the “committer” of the patch, so these details must be set correctly when making the commit.
</p>

<p>
First of all, check a few things:
</p>
<ul>
<li class="level1"><div class="li"> You have the latest version of the patch.</div>
</li>
<li class="level1"><div class="li"> The author of the patch is happy for it to be committed (and wasn’t still working on it)</div>
</li>
<li class="level1"><div class="li"> That the you’re happy with the patch, and taking responsibility for committing those changes.</div>
</li>
</ul>

<p>
 For simplicity, start from an unmodified up-to date tree (git status shows no changes).
</p>

<p>
Apply the patch as usual (as an example): 
</p>
<pre class="code">$ patch -p1 &lt; example_changes.patch</pre>

<p>
 You can also use the git apply command: 
</p>
<pre class="code">$ git apply example_changes.patch</pre>

<p>
 If the patch needs any minor editing before it is committed (eg. white-space changes), please inform the author this was done. They may have other work based on their patch and will want to know if there were changes to the applied version.
</p>

<p>
Note: <em>This is easy to miss accidentally if your editor introduces tabs. Please avoid letting it do so!</em>
</p>

<p>
For every file changed, added or removed, you need to inform git before it will commit the changes. To see the modified files, run: 
</p>
<pre class="code">$ git status</pre>

<p>
 For speed, the command: 
</p>
<pre class="code">$ git add -u</pre>

<p>
 will update all files which git tracks, including any files which were deleted.
</p>

<p>
For adding any new files the patch introduced, use the command 
</p>
<pre class="code">$ git add new_file.c</pre>

<p>
 Note: git add also takes wild-cards.
</p>

<p>
Commit the patch, making sure that the Author’s name and e-mail address are specified: 
</p>
<pre class="code">$ git commit --author &quot;Author&#039;s Name Comes Here &lt;author@example.com&gt;&quot;</pre>

<p>
 As an alternative, you can set the GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL environment variables before issuing the normal commit command
</p>

</div>
<!-- SECTION "Committing patches from other contributors" [3386-5315] -->
<h3><a name="writing_good_commit_messages" id="writing_good_commit_messages">Writing good commit messages</a></h3>
<div class="level3">

<p>
 The commit message format is as follows: a *strictly* one-line summary of the patch, followed by a blank line, followed by a long description.  If you can fit the whole description of the patch on one line, that’s fine; don’t bother with the long description.
</p>

<p>
The one-line summary is used for generating e-mail subject lines, and for the gitk &amp; gitweb log displays.  Having a good one-line summary is really useful, because it means those tools can be used to quickly find a commit of interest.
</p>

<p>
<strong>Do not</strong> put a list of files changed into commit messages.  This information can be trivially obtained using the git tools.
</p>

<p>
Example:
</p>
<pre class="code">
Added new GedaList class derived from GObject

This abstracts a GList with API for write access. Its main use is in list
change notification, as it emits a &quot;changed&quot; g_signal when modified.
Read only access to the underlying GList is provided by an accessor,
currenly implemented as a macro.
</pre>

</div>
<!-- SECTION "Writing good commit messages" [5316-6297] -->
<h3><a name="push_is_destructive" id="push_is_destructive">Push is Destructive</a></h3>
<div class="level3">

<p>
 <strong>Warning: pushing changes to the remote repository is destructive</strong>
</p>

<p>
Unlike <acronym title="Concurrent Versions System">CVS</acronym>, it is not the committing of changes which changes the master repository, but pushing changes using git-push.  You should always double- (or triple-) check that the commits you are about to push are actually meant for the main repository.
</p>

</div>
<!-- SECTION "Push is Destructive" [6298-6651] -->
<h2><a name="how_do_i" id="how_do_i">How Do I ... ?</a></h2>
<div class="level2">

<p>
 For a more information please checkout the <a href="http://wiki.sourcemage.org/Git_Guide" class="urlextern" title="http://wiki.sourcemage.org/Git_Guide"  rel="nofollow">Git Guide</a>.
</p>

</div>
<!-- SECTION "How Do I ... ?" [6652-6775] -->
<h3><a name="get_a_copy_of_geda_gaf_git_repository" id="get_a_copy_of_geda_gaf_git_repository">... get a copy of gEDA/gaf git repository?</a></h3>
<div class="level3">

<p>
 For anonymous read-only access: 
</p>
<pre class="code">$ git clone git://git.gpleda.org/gaf</pre>

<p>
 For developers with read/write access: 
</p>
<pre class="code">$ git clone git://git.gpleda.org/home/git/gaf.git</pre>

</div>
<!-- SECTION "... get a copy of gEDA/gaf git repository?" [6776-6995] -->
<h3><a name="keep_my_local_copy_current" id="keep_my_local_copy_current">... keep my local copy current?</a></h3>
<div class="level3">

<p>
 For those who are are not merging changes back into the central git repository you can run: 
</p>
<pre class="code">$ git pull</pre>

<p>
 However, for those of you who are going to be pushing your changes back into the central git repository, using git pull will clutter up the history with merge messages (“Merge branch ‘master’”).  To avoid this you should run: 
</p>
<pre class="code">$ git fetch
$ git rebase origin</pre>

</div>
<!-- SECTION "... keep my local copy current?" [6996-7410] -->
<h3><a name="commit_my_changes_to_the_local_git_repository" id="commit_my_changes_to_the_local_git_repository">... commit my changes to the local git repository?</a></h3>
<div class="level3">
<pre class="code">$ git commit -a </pre>

<p>
 This command will find all changed files that git knows about (added with git-add) and prompt you for a commit message.  Be sure to follow the above commit message convention if you plan on pushing your changes to the central repository.
</p>

<p>
If you want to commit files in the current directory or want to explicitly commit only certain files, do not specify the -a flag and/or specify the individual filenames on the command line like: 
</p>
<pre class="code">$ git commit filename1 filename2</pre>

</div>
<!-- SECTION "... commit my changes to the local git repository?" [7411-7964] -->
<h3><a name="undo_any_uncommitted_local_changes" id="undo_any_uncommitted_local_changes">... undo any uncommitted local changes?</a></h3>
<div class="level3">
<pre class="code">$ git checkout -f </pre>

<p>
 Note this will discard any changes to any files that are being tracked by git.
</p>

</div>
<!-- SECTION "... undo any uncommitted local changes?" [7965-8118] -->
<h3><a name="fix_change_my_last_commit" id="fix_change_my_last_commit">... fix/change my last commit?</a></h3>
<div class="level3">
<pre class="code">$ Edit whatever files
$ git commit --amend filename1..filenameN </pre>

<p>
 This will pickup any changes you made and recommit them again with the previous commit message.
</p>

</div>
<!-- SECTION "... fix/change my last commit?" [8119-8329] -->
<h3><a name="recover_from_a_really_messed_up_local_repository" id="recover_from_a_really_messed_up_local_repository">... recover from a really messed up local repository?</a></h3>
<div class="level3">

<p>
 First off, do not push any repository that you think is somehow messed up.  Ask one of the experienced git people first.  
</p>

<p>
Second, the command that will really save your bacon is git-reflog.  Using it works something like this: 
</p>
<pre class="code"> $ git reflog
 086908e... HEAD@{0}: cherry-pick: Last minute updates to the READMEs for all pro
 2a79a23... HEAD@{1}: checkout: moving to master
 2a79a23... HEAD@{2}: checkout: moving to master
 ...
 $ git reset --hard HEAD@{1}</pre>

<p>
 The last command (git reset &ndash;hard &hellip;) will rollback all your changes to the “checkout: moving to master”.  Remember: don’t panic! Most things are fixable when using git.
</p>

</div>
<!-- SECTION "... recover from a really messed up local repository?" [8330-] --></div>
</body>
</html>