diff options
Diffstat (limited to 'Documentation/howto')
-rw-r--r-- | Documentation/howto/make-dist.txt | 5 | ||||
-rw-r--r-- | Documentation/howto/rebase-and-edit.txt | 3 | ||||
-rw-r--r-- | Documentation/howto/rebase-from-internal-branch.txt | 5 | ||||
-rw-r--r-- | Documentation/howto/rebuild-from-update-hook.txt | 83 | ||||
-rw-r--r-- | Documentation/howto/using-topic-branches.txt | 70 |
5 files changed, 143 insertions, 23 deletions
diff --git a/Documentation/howto/make-dist.txt b/Documentation/howto/make-dist.txt index ae90941..132d5ec 100644 --- a/Documentation/howto/make-dist.txt +++ b/Documentation/howto/make-dist.txt @@ -3,6 +3,11 @@ From: Linus Torvalds <torvalds@osdl.org> To: Dave Jones <davej@redhat.com> cc: git@vger.kernel.org Subject: Re: Fwd: Re: git checkout -f branch doesn't remove extra files +Abstract: In this article, Linus talks about building a tarball, + incremental patch, and ChangeLog, given a base release and two + rc releases, following the convention of giving the patch from + the base release and the latest rc, with ChangeLog between the + last rc and the latest rc. On Sat, 13 Aug 2005, Dave Jones wrote: > diff --git a/Documentation/howto/rebase-and-edit.txt b/Documentation/howto/rebase-and-edit.txt index 8299ca5..6cc1c79 100644 --- a/Documentation/howto/rebase-and-edit.txt +++ b/Documentation/howto/rebase-and-edit.txt @@ -3,6 +3,9 @@ From: Linus Torvalds <torvalds@osdl.org> To: Steve French <smfrench@austin.rr.com> cc: git@vger.kernel.org Subject: Re: sending changesets from the middle of a git tree +Abstract: In this article, Linus demonstrates how a broken commit + in a sequence of commits can be removed by rewinding the head and + reapplying selected changes. On Sat, 13 Aug 2005, Linus Torvalds wrote: diff --git a/Documentation/howto/rebase-from-internal-branch.txt b/Documentation/howto/rebase-from-internal-branch.txt index 8109b7f..f627e42 100644 --- a/Documentation/howto/rebase-from-internal-branch.txt +++ b/Documentation/howto/rebase-from-internal-branch.txt @@ -3,6 +3,11 @@ To: git@vger.kernel.org Cc: Petr Baudis <pasky@suse.cz>, Linus Torvalds <torvalds@osdl.org> Subject: Re: sending changesets from the middle of a git tree Date: Sun, 14 Aug 2005 18:37:39 -0700 +Abstract: In this article, JC talks about how he rebases the + public "pu" branch using the core GIT tools when he updates + the "master" branch, and how "rebase" works. Also discussed + is how this applies to individual developers who sends patches + upstream. Petr Baudis <pasky@suse.cz> writes: diff --git a/Documentation/howto/rebuild-from-update-hook.txt b/Documentation/howto/rebuild-from-update-hook.txt new file mode 100644 index 0000000..ebd025d --- /dev/null +++ b/Documentation/howto/rebuild-from-update-hook.txt @@ -0,0 +1,83 @@ +Subject: [HOWTO] Using post-update hook +Message-ID: <7vy86o6usx.fsf@assigned-by-dhcp.cox.net> +From: Junio C Hamano <junkio@cox.net> +Date: Fri, 26 Aug 2005 18:19:10 -0700 +Abstract: In this how-to article, JC talks about how he + uses the post-update hook to automate git documentation page + shown at http://www.kernel.org/pub/software/scm/git/docs/. + +The pages under http://www.kernel.org/pub/software/scm/git/docs/ +are built from Documentation/ directory of the git.git project +and needed to be kept up-to-date. The www.kernel.org/ servers +are mirrored and I was told that the origin of the mirror is on +the machine master.kernel.org, on which I was given an account +when I took over git maintainership from Linus. + +The directories relevant to this how-to are these two: + + /pub/scm/git/git.git/ The public git repository. + /pub/software/scm/git/docs/ The HTML documentation page. + +So I made a repository to generate the documentation under my +home directory over there. + + $ cd + $ mkdir doc-git && cd doc-git + $ git clone /pub/scm/git/git.git/ docgen + +What needs to happen is to update the $HOME/doc-git/docgen/ +working tree, build HTML docs there and install the result in +/pub/software/scm/git/docs/ directory. So I wrote a little +script: + + $ cat >dododoc.sh <<\EOF + #!/bin/sh + cd $HOME/doc-git/docgen || exit + + unset GIT_DIR + + git pull /pub/scm/git/git.git/ master && + cd Documentation && + make install-webdoc + EOF + +Initially I used to run this by hand whenever I push into the +public git repository. Then I did a cron job that ran twice a +day. The current round uses the post-update hook mechanism, +like this: + + $ cat >/pub/scm/git/git.git/hooks/post-update <<\EOF + #!/bin/sh + # + # An example hook script to prepare a packed repository for use over + # dumb transports. + # + # To enable this hook, make this file executable by "chmod +x post-update". + + case " $* " in + *' refs/heads/master '*) + echo $HOME/doc-git/dododoc.sh | at now + ;; + esac + exec git-update-server-info + EOF + $ chmod +x /pub/scm/git/git.git/hooks/post-update + +There are three things worth mentioning: + + - The update-hook is run after the repository accepts a "git + push", under my user privilege. It is given the full names + of refs that have been updated as arguments. My post-update + runs the dododoc.sh script only when the master head is + updated. + + - When update-hook is run, GIT_DIR is set to '.' by the calling + receive-pack. This is inherited by the dododoc.sh run via + the "at" command, and needs to be unset; otherwise, "git + pull" it does into $HOME/doc-git/docgen/ repository would not + work correctly. + + - This is still crude and does not protect against simultaneous + make invocations stomping on each other. I would need to add + some locking mechanism for this. + diff --git a/Documentation/howto/using-topic-branches.txt b/Documentation/howto/using-topic-branches.txt index 52fa4c0..b3b4d2c 100644 --- a/Documentation/howto/using-topic-branches.txt +++ b/Documentation/howto/using-topic-branches.txt @@ -1,16 +1,16 @@ Date: Mon, 15 Aug 2005 12:17:41 -0700 From: tony.luck@intel.com Subject: Some tutorial text (was git/cogito workshop/bof at linuxconf au?) +Abstract: In this article, Tony Luck discusses how he uses GIT + as a Linux subsystem maintainer. Here's something that I've been putting together on how I'm using GIT as a Linux subsystem maintainer. -I suspect that I'm a bit slap-happy with the "git checkout" commands in -the examples below, and perhaps missing some of the _true-git_ ways of -doing things. - -Tony +Last updated w.r.t. GIT 0.99.5 + Linux subsystem maintenance using GIT ------------------------------------- @@ -48,24 +48,38 @@ Change directory into the cloned tree you just created $ cd work -Make a GIT branch named "linus", and rename the "origin" branch as linus too: +Set up a remotes file so that you can fetch the latest from Linus' master +branch into a local branch named "linus": + + $ cat > .git/remotes/linus + URL: rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git + Pull: master:linus + ^D - $ git checkout -b linus - $ mv .git/branches/origin .git/branches/linus +and create the linus branch: + + $ git branch linus The "linus" branch will be used to track the upstream kernel. To update it, you simply run: - $ git checkout linus && git pull linus + $ git fetch linus + +you can do this frequently (and it should be safe to do so with pending +work in your tree, but perhaps not if you are in mid-merge). -you can do this frequently (as long as you don't have any uncommited work -in your tree). +If you need to keep track of other public trees, you can add remote branches +for them too: -If you need to keep track of other public trees, you can add branches for -them too: + $ git branch another + $ cat > .git/remotes/another + URL: ... insert URL here ... + Pull: name-of-branch-in-this-remote-tree:another + ^D - $ git checkout -b another linus - $ echo URL-for-another-public-tree > .git/branches/another +and run: + + $ git fetch another Now create the branches in which you are going to work, these start out at the current tip of the linus branch. @@ -78,15 +92,25 @@ These can be easily kept up to date by merging from the "linus" branch: $ git checkout test && git resolve test linus "Auto-update from upstream" $ git checkout release && git resolve release linus "Auto-update from upstream" -Set up so that you can push upstream to your public tree: +Set up so that you can push upstream to your public tree (you need to +log-in to the remote system and create an empty tree there before the +first push). - $ echo master.kernel.org:/ftp/pub/scm/linux/kernel/git/aegl/linux-2.6.git > .git/branches/origin + $ cat > .git/remotes/mytree + URL: master.kernel.org:/pub/scm/linux/kernel/git/aegl/linux-2.6.git + Push: release + Push: test + ^D -and then push each of the test and release branches using: +and the push both the test and release trees using: - $ git push origin test -and - $ git push origin release + $ git push mytree + +or push just one of the test and release branches using: + + $ git push mytree test +or + $ git push mytree release Now to apply some patches from the community. Think of a short snappy name for a branch to hold this patch (or related group of @@ -169,9 +193,9 @@ test|release) git checkout $1 && git resolve $1 linus "Auto-update from upstream" ;; linus) - before=$(cat .git/HEAD) - git checkout linus && git pull linus - after=$(cat .git/HEAD) + before=$(cat .git/refs/heads/linus) + git fetch linus + after=$(cat .git/refs/heads/linus) if [ $before != $after ] then git-whatchanged $after ^$before | git-shortlog |