Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master tome rdp by Eric Sandall (746ed947f8852589e43d274602e6716640dcabca)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Eric Sandall <scm AT mail.sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master tome rdp by Eric Sandall (746ed947f8852589e43d274602e6716640dcabca)
  • Date: Thu, 29 Mar 2007 02:12:58 -0500

GIT changes to master tome rdp by Eric Sandall <sandalle AT sourcemage.org>:

GrimoireGuruHandbook.tex | 292
++++++++++++++++++++++++++++++++++++-----------
1 files changed, 224 insertions(+), 68 deletions(-)

New commits:
commit 746ed947f8852589e43d274602e6716640dcabca
Author: Eric Sandall <sandalle AT sourcemage.org>
Commit: Eric Sandall <sandalle AT sourcemage.org>

GrimoireGuruHandbook.tex: Finished the majority of use cases for git

commit a15410f2c4752a9cf5f3f432994e7cd93c093872
Author: Eric Sandall <sandalle AT sourcemage.org>
Commit: Eric Sandall <sandalle AT sourcemage.org>

GrimoireGuruHandbook.tex: Updated instructions for git 1.5

diff --git a/GrimoireGuruHandbook.tex b/GrimoireGuruHandbook.tex
index d51b8bd..c06c910 100644
--- a/GrimoireGuruHandbook.tex
+++ b/GrimoireGuruHandbook.tex
@@ -113,35 +113,62 @@ $ git pull
Note that all but the `git clone` command need to be run from this
directory. If you receive a message saying "fatal: Not a git repository:
'.git'", then you did not follow my instruction above.
-\section{Selecting your working branch}
-The main grimoire that you have checked out has many branches. You may view
-the available branches by running:
+\section{Viewing local branches}
+Local branches are branches made by you, with only one, ``master'', being
+created for you. To view your local branches, run:
\begin{verbatim}
$ git branch
+* master
\end{verbatim}
-And you will see output similar to this:
+The "*" before "master" means that this is the currently checked out
+(working) branch. You may modify local branches as much as you want and you
+will not affect anyone else until you push your changes back to the server
+(see below).

+\section{Viewing remote branches}
+The main grimoire that you have checked out has many branches. You may view
+the available remote branches by running:
+\begin{verbatim}
+$ git branch -r
+ origin/HEAD
+ origin/devel
+ origin/devel-iceweasel
+ origin/devel-shadow
+ origin/master
+ origin/stable-0.3
+ origin/stable-0.4
+ origin/stable-0.6
+ origin/stable-0.7
+ origin/stable-0.8
+ origin/stable-rc-0.4
+ origin/stable-rc-0.5
+ origin/stable-rc-0.6
+ origin/stable-rc-0.7
+ origin/stable-rc-0.8
+\end{verbatim}
+All of the branches listed with origin/ are 'remote' branches, ones that are
+available for everyone to use.
+
+\section{Selecting your working branch}
+To checkout another branch (say origin/devel) to work on, you would run:
\begin{verbatim}
-devel
-* master
-origin
-stable-0.3
-stable-0.4
-stable-rc-0.4
-stable-rc-0.5
-stable-rc-0.6
+$ git checkout -b devel origin/devel
+Switched to a new branch "devel
\end{verbatim}
-
-The "*" before "master" means that this is the currently checked out branch.
-To checkout another branch (say devel), you would run:
+Now check what local branches you have
\begin{verbatim}
-$ git checkout devel
+$ git branch
+* devel
+ master
\end{verbatim}
-Unless you know what you are doing, only work in the master (a.k.a. test)
+You are now working on a local branch of origin/devel called ``devel''.
+
+Unless you know what you are doing, only work in the ``master'' (a.k.a. test)
branch.

You will *never* touch the 'origin' branch, as this is used by git
internally to check your changes against.
+
\section{Making changes}
Before making any changes, it is a good idea to make sure your clone is
up-to-date (though this is not required, it does make submitting easier).
@@ -199,7 +226,7 @@ directory.
If you wish to specify your message log on the command line, rather than in
your favorite editor, you may do so with the -m flag:
\begin{verbatim}
-$ git commit -m "Updated git to 1.4.3.5"
+$ git commit -m "git: Updated to 1.4.3.5"
\end{verbatim}

If ever you make changes you wish to undo, before running `git commit`, you
@@ -218,7 +245,8 @@ repository, run:
$ git push <destination> <source>
\end{verbatim}

-Since we are working in master, we would run:
+Since we are working in master and want to push to the upstream server, we
+would run:
\begin{verbatim}
$ git push origin master
\end{verbatim}
@@ -240,39 +268,158 @@ which begins the new changes, and a \beg
.merge_file_otherstuff\end{verbatim}, which
ends the new changes. Once you resolve the conflict by editing the file
and remove what should not be there, you will run \textdollar git
update-index
-<file>
+<files>
and then commit your changes.
\section{Creating your own local branch}
-\section{Creating your own remote branch}
+If you are planning on doing an update which might take a while (e.g.
+openoffice) you will want to work in your own branch, so you only have to
+resolve conflicts once when you merge back to the master branch.
+\begin{enumerate}
+ \item First, make sure we're up-to-date, no point in missing any
+commits ;)
+\begin{verbatim}
+ $ git checkout master
+ $ git pull
+\end{verbatim}
+ \item Now we'll create our own local branch and check it out in one
+command
+\begin{verbatim}
+ $ git checkout -b devel-openoffice
+ Switched to a new branch "devel-openoffice
+\end{verbatim}
+We may now proceed the long process of getting openoffice to compile. Commit
+as often as you want to this branch, it won't hurt anyone. When you want to
+work on the rest of the grimoire again, make sure everything is commited and
+then checkout ``master'' (or whichever branch you want to work on) and
proceed
+as normal, devel-openoffice will always be waiting for you. :)
+
+\end{enumerate}
+
\section{Checking out other branches}
-\section{Integrating between branches}
-\section{Updated a stable-rc or stable grimoire}
+Checking out another branch will allow you to work on it. Let's say we have
+the following remote branches:
+\begin{verbatim}
+ $ git branch -r
+ origin/HEAD
+ origin/devel
+ origin/devel-iceweasel
+ origin/devel-java
+ origin/devel-oo
+ origin/devel-shadow
+ origin/master
+ origin/origin
+\end{verbatim}
+Now, we'd like to try out some of the shadow work that's going on, so let's
+check it out.
+\begin{verbatim}
+ $ git checkout -b shadow origin/devel-shadow
+ Switched to a new branch "shadow"
+ $ git branch
+ master
+* shadow
+\end{verbatim}
+We now have our own local ``shadow'' branch to play with, which is linked to
+the upstream origin/devel-shadow.

-These grimoires are special, in that you never modify them directly
-(similar to how you treat the origin branch). To update one of these (say
-stable-rc-0.6), you will use the following steps:
-\begin{enumerate}
-\item Switch to the stable-rc-0.6 branch.
+\section{Deleting a local branch}
+Sometimes a branch is a lost cause, or already merged and no longer needed.
+You will need to not have the soon to be deleted branch checked out
+(``master'' is always a good branch to hang out in) and then you may delete
it:
\begin{verbatim}
-$ git checkout stable-rc-0.6
+ $ git checkout master
+ $ git branch -d devel-openoffice
\end{verbatim}
-\item Create a branch of the current stable-rc-0.6 called my-stable-rc-0.6
and
-switch to it.
+This will only delete the branch if it has been fully merged. If this is a
+lost cause branch, feel free to be more forceful:
\begin{verbatim}
-$ git checkout -b my-stable-rc-0.6
+ $ git branch -D devel-openoffice
\end{verbatim}
-\item Merge (cherry-pick) the commit id you want into the current branch
+This will remove ``devel-openoffice'' no matter its status.
+
+\section{Renaming a local branch}
+If you no longer like the name you've given to a remote branch, fear not!
+Renaming is as simple as ``branch -m <old branch> <new branch>'':
\begin{verbatim}
-$ git cherry-pick 093af91834hf8a8df90238928f920023
+ $ git branch -m devel-openoffice openoffice
\end{verbatim}
-\item Synchronize stable-rc-0.6 with upstream
+
+\section{Creating your own remote branch}
+We have our devel-openoffice branch on our machine, but others are wanting to
+help with it, so we'll push it to the upstream grimoire.git on
sourcemage.org.
+
+\begin{enumerate}
+ \item Check out the branch we wish to push
+ \begin{verbatim}
+ $ git checkout devel-openoffice
+ \end{verbatim}
+ \item Now we push our currently checked out branch onto the remote
+ \begin{verbatim}
+ $ git push origin devel-openoffice
+updating 'refs/heads/devel-openoffice'
+ from 0000000000000000000000000000000000000000
+ to fa9869a20bbfb479fafd63ef41e890919df3b6d9
+Generating pack...
+Done counting 0 objects.
+Writing 0 objects.
+Unpacking 0 objects
+
+refs/heads/foo: 0000000000000000000000000000000000000000 ->
+fa9869a20bbfb479fafd63ef41e890919df3b6d9
+Total 0 (delta 0), reused 0 (delta 0)
+ \end{verbatim}
+ \item We'll need to go back to master for some updates
+ \begin{verbatim}
+ $ git checkout master
+ $ git pull
+* refs/remotes/origin/devel-openoffice: storing branch 'devel-openoffice' of
+/home/sandalle/tmp/grimoire/
+ commit: fa9869a
+Already up-to-date.
+ \end{verbatim}
+devel-openoffice should now be a remote branch
+ \item Check that devel-openoffice is remote
+ \begin{verbatim}
+$ git branch -r
+ origin/HEAD
+ origin/devel-openoffice
+ origin/master
+ \end{verbatim}
+ \item Remove your local devel-openoffice (since it is not linked with
+the remote, it will be difficult to keep them in sync)
+ \begin{verbatim}
+ $ git branch -D devel-openoffice
+ \end{verbatim}
+ \item Check out the remote devel-openoffice to your local branch
+ \begin{verbatim}
+ $ git checkout -b devel-openoffice origin/devel-openoffice
+ \end{verbatim}
+\end{enumerate}
+You are now set to collaborate on the devel-openoffice branch with other
+developers. :)
+
+\section{Integrating between branches}
+Let's say we want to merge some fixes from our test (``master'') grimoire
into
+stable-rc and stable. To update one of these (say stable-rc-0.8), you will
use
+the following steps:
+\begin{enumerate}
+\item Checkout the the origin/stable-rc-0.8 branch and call it stable-rc-0.6
+locally.
\begin{verbatim}
-$ git pull origin stable-rc-0.6
+$ git checkout -b stable-rc-0.8 origin/stable-rc-0.8
\end{verbatim}
-\item Push your changes from my-stable-rc-0.6 into stable-rc-0.6 and then up
to
-the server (origin).
+\item Merge (cherry-pick) the commit id you want (in this example,
+fa9869a20bbfb479fafd63ef41e890919df3b6d9) into the current branch
\begin{verbatim}
-$ git push origin my-stable-rc-0.6:stable-rc-0.6.
+$ git cherry-pick fa9869a20bbfb479fafd63ef41e890919df3b6d9
+\end{verbatim}
+\item Synchronize the local stable-rc-0.8 with upstream origin/stable-rc-0.8
+\begin{verbatim}
+$ git pull origin origin/stable-rc-0.8
+\end{verbatim}
+\item Push your changes from stable-rc-0.8 into origin/stable-rc-0.8 and then
+up to the server (origin).
+\begin{verbatim}
+$ git push origin stable-rc-0.8:origin/stable-rc-0.8
\end{verbatim}
\end{enumerate}

@@ -280,39 +427,49 @@ $ git push origin my-stable-rc-0.6:stabl
The need for this most commonly occurs when a new stable branch is released,
but may be used for any other remote branches you wish to retrieve.

-Let's say that stable-0.6 was just released, and your current local branches
+Let's say that stable-0.8 was just released, and your current local branches
look like this:
\begin{verbatim}
-$ git branch
-devel
-* master
-origin
-stable-0.3
-stable-0.4
-stable-rc-0.4
-stable-rc-0.5
-stable-rc-0.6
+$ git branch -r
+ origin/HEAD
+ origin/devel
+ origin/devel-iceweasel
+ origin/devel-shadow
+ origin/master
+ origin/stable-0.3
+ origin/stable-0.4
+ origin/stable-0.6
+ origin/stable-rc-0.4
+ origin/stable-rc-0.5
+ origin/stable-rc-0.6
+ origin/stable-rc-0.7
\end{verbatim}

-To grab the new stable-0.6 and stable-rc-0.7 (the next stable release
-candidate)
-you would do the following:
+New remote branches will automatically be added on your next pull, so just
run
+(preferably with the local master checked out):
\begin{verbatim}
-$ git fetch ssh://scm.sourcemage.org/smgl/grimoire.git stable-0.6:stable-0.6
+$ git pull
\end{verbatim}
-
-This tells git to fetch the remote branch named stable-0.6 (before the ":")
and
-call it stable-0.6 (after the ":") into the current git repository.
-
-If you want this branch to be updated on a pull, you will also need to add
-the branch information to .git/remotes/origin:
-\begin{verbatim}
-Pull: refs/heads/stable-0.6:refs/heads/stable-0.6
-Pull: refs/heads/stable-rc-0.7:refs/heads/stable-rc-0.7
+And then you should now have the new remote branches:
+\begin{verbatim}
+$ git branch -r
+ origin/HEAD
+ origin/devel
+ origin/devel-iceweasel
+ origin/devel-shadow
+ origin/master
+ origin/stable-0.3
+ origin/stable-0.4
+ origin/stable-0.6
+ origin/stable-0.7
+ origin/stable-0.8
+ origin/stable-rc-0.4
+ origin/stable-rc-0.5
+ origin/stable-rc-0.6
+ origin/stable-rc-0.7
+ origin/stable-rc-0.8
\end{verbatim}

-These two lines will add pull information for stable-0.6 and stable-rc-0.7.
-
\chapter{Writing a spell}
\section{PREPARE}
Even before DETAILS, this file is sourced and cane be used to setup variables
@@ -366,8 +523,7 @@ SOURCE_URL[0]=${PREPARE_SOURCE_URL[0]:-h
\end{verbatim}

Note: The \$\{VAR``:-string\} syntax means if \$VAR is not empty, then use
-\$VAR,
-if it is empty, then use the string.
+\$VAR, if it is empty, then use the string.

Note: We keep all of the checks out of DETAILS and use PREPARE for the
ugliness.
@@ -446,7 +602,7 @@ Example:
SOURCE_DIRECTORY=$BUILD_DIRECTORY/$SPELL-$VERSION
\end{verbatim}

-\subsection{SOURCE_URL}
+\subsection{SOURCE\_URL}
SOURCE\_URL[*]
An array where you specify as many targets of where to download the
source from. Must specify the full path (including filename) of the
@@ -504,7 +660,7 @@ SOURCE_HASH=sha512:<hash>:UPSTREAM_HASH
(actual hash ommited due to insane length)
\end{verbatim}

-\subsection{SOURCE_GPG}
+\subsection{SOURCE\_GPG}
SOURCE\_GPG/SOURCEn\_GPG
A signature used to verify the source file. Consists of
<key file>:<signature file>:<verification level>. The key file has to



  • [SM-Commit] GIT changes to master tome rdp by Eric Sandall (746ed947f8852589e43d274602e6716640dcabca), Eric Sandall, 03/29/2007

Archive powered by MHonArc 2.6.24.

Top of Page