gEDA-dev: Git: creating a patch
Cesar Strauss
cestrauss at gmail.com
Sun Oct 21 09:17:13 EDT 2007
Alan M. Feldstein wrote:
> geda-dev-request at moria.seul.org wrote:
>> Well, I would have guessed it would work because your local git
>> directory knows that the v0_8-branch is your corrent branch.
>>
> I'm not so sure that my local Git repository knows that v0_8-branch is
> my current branch. Let me explain how my Git repository came into being.
> I more or less sequentially followed A tutorial introduction to git
> <http://www.kernel.org/pub/software/scm/git/docs/tutorial.html>. I
> started with what I had in my CVS repository.
>
I think you followed the steps to create new project. However, what you
actually want is to contribute to an existing project. In this case, I
think it is better to clone the git repository first, then add your own
changes on top of that. Try this:
1) Clone the Icarus Verilog git repository
$ git clone git://icarus.com/~steve-icarus/verilog
Initialized empty Git repository in
/home/cstrauss/programas/eletronica/geda/verilog/.git/
remote: Generating pack...
remote: Done counting 23261 objects.
remote: Deltifying 23261 objects...
remote: 100% (23261/23261) done
Indexing 23261 objects...
remote: Total 23261 (delta 18313), reused 18183 (delta 14343)
100% (23261/23261) done
Resolving 18313 deltas...
100% (18313/18313) done
$ cd verilog
2) You are now in the development branch, but you want the stable
branch. Do not checkout the origin/v0_8-branch directly, it is reserved
for remote updates. Instead, create a local branch, based on the remote
stable branch:
$ git checkout --track -b v0_8-branch origin/v0_8-branch
Branch v0_8-branch set up to track remote branch
refs/remotes/origin/v0_8-branch.
Switched to a new branch "v0_8-branch"
3) Now, import you CVS repository. Use git diff to see what would be
committed. For instance:
$ git diff
diff --git a/mingw.txt b/mingw.txt
index bf205ac..b03caab 100644
--- a/mingw.txt
+++ b/mingw.txt
@@ -73,8 +73,8 @@ wrapped in a convenient installer. The msys package is
all the
basic tools (shells, file utils, etc) and the msysDTK is extra
developer tools other then the compiler.
-Download the msys-1.x.x.exe and msysdtc-1.x.x.exe binaries. These are
-self-installing packages. Install msys first, and then msysDTC. Most
+Download the msys-1.x.x.exe and msysDTK-1.x.x.exe binaries. These are
+self-installing packages. Install msys first, and then msysDTK. Most
likely, you want to install them in c:/msys. (The msysDTK is installed
in the same location, as it is an add-on.)
4) Add your changes to the index and commit:
$ git add .
$ git commit -m "Fix a small typo" -m "The MinGW build instructions had
a small typo. This patch fixes this."
Created commit cde4219: Fix a small typo
1 files changed, 2 insertions(+), 2 deletions(-)
5) To verify you are on the correct branch:
$ git status
# On branch v0_8-branch
nothing to commit (working directory clean)
6) Create the patch. As we branched from the origin/v0_8-branch, we can
use that in the "since" argument of git-format-patch:
$ git format-patch origin/v0_8-branch
0001-Fix-a-small-typo.patch
7) To stay up-to-date, you only have to type git pull, because we used
the --track argument.
$ git pull
Already up-to-date.
Hope this helps,
Cesar
More information about the geda-dev
mailing list