From: Miklos Vajna <vmiklos@frugalware.org>
To: David Howells <dhowells@redhat.com>
Cc: torvalds@osdl.org, git@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Simplified GIT usage guide
Date: Fri, 12 Dec 2008 19:53:47 +0100 [thread overview]
Message-ID: <20081212185347.GK5691@genesis.frugalware.org> (raw)
In-Reply-To: <20081212182827.28408.40963.stgit@warthog.procyon.org.uk>
[-- Attachment #1: Type: text/plain, Size: 3038 bytes --]
On Fri, Dec 12, 2008 at 06:28:27PM +0000, David Howells <dhowells@redhat.com> wrote:
> + (1) File objects.
> +
> + A file object contains the contents of a source file and the attributes of
> + that file (such as file mode).
This is incorrect, a 'blob' contains only the contents of the blob, the
file mode is stored in the 'tree' object.
> + (2) Directory objects.
> +
> + A directory object contains the attributes of that directory plus a list
> + of file and directory objects that are members of this directory. The
> + list includes the names of the entries within that directory and the
> + object ID of each object.
> +
> + (3) Commit objects.
> +
> + A commit object contains the attribute of that commit (the author and the
> + date for instance), a textual description of the change imposed by that
> + commit as provided by the committer, a list of object IDs for the commits
> + on which this commit is based, and the object ID of the root directory
> + object representing the result of this commit.
> +
> + Note that a commit does not literally describe the changes that have been
> + made in the way that, say, a diff file does; it merely carries the current
> + state of the sources after that change, and points to the commits that
> + describe the state of the sources before that change. GIT's tools then
> + infer the changes when asked.
> +
> + A commit object will typically refer to one base commit when someone has
> + merely committed some changes on top of the current state, and two base
> + commits when a couple of trees have been merged.
Is there any reason you hide the tag object?
> +where %HOUR is the hour you want it to go off every day. For my local mirror
> +of Linus's upstream kernel, I use:
> +
> + #!/bin/sh
> + cd /warthog/git/linux-2.6 || exit $?
> + exec git pull >/tmp/git-pull.log
> +
> +and:
> +
> + 0 6 * * * /home/dhowells/bin/do-git-pull.sh
> +
> +which will do the update every day at 6am.
Using git clone --mirror would be much efficient, I think.
> +The "-l" tells git clone that the source (mirror) repository is on the local
> +machine, that it shouldn't go over the internet for it, and that it should
> +hardlink GIT objects from the source repository rather than copying them where
> +possible.
Here and later below, IIRC -l is the default for local clones.
> + cd /my/git/trees
> + git clone -n --bare %UPSTREAM_REPO %MY_DIR
--bare implies -n.
> +If you haven't yet committed your changes, you'll have to siphon them off into
> +a file:
> +
> + git diff >a.diff
> +
> +and deapply them:
> +
> + patch -p1 -R <a.diff
> +
> +You can then update your tree from the upstream tree with no fear of a conflict
> +(assuming you don't also have changes that you have committed). Once you've
> +updated your tree, you can reapply your changes:
> +
> + patch -p1 <a.diff
Why not using git stash and git stash pop?
Or at least git apply and git checkout - leaving out patch(1) from the
game.
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
next prev parent reply other threads:[~2008-12-12 18:55 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-12 18:28 [PATCH] Simplified GIT usage guide David Howells
2008-12-12 18:53 ` Miklos Vajna [this message]
2008-12-12 18:57 ` Johannes Schindelin
2008-12-19 0:02 ` Paul E. McKenney
2008-12-19 0:28 ` Junio C Hamano
2008-12-19 1:27 ` Paul E. McKenney
2008-12-24 4:35 ` Valdis.Kletnieks
2008-12-19 2:38 ` Johannes Schindelin
2008-12-19 5:25 ` Paul E. McKenney
2008-12-12 19:02 ` David Howells
2008-12-12 19:09 ` Miklos Vajna
2008-12-13 1:12 ` David Howells
2008-12-13 3:34 ` Miklos Vajna
2008-12-12 19:12 ` David Howells
2008-12-12 19:24 ` Sverre Rabbelier
2008-12-12 19:40 ` Aidan Van Dyk
2008-12-13 23:05 ` Nick Andrew
2008-12-14 1:45 ` Ping Yin
2008-12-12 19:39 ` Jakub Narebski
2008-12-12 19:47 ` J. Bruce Fields
2008-12-13 1:03 ` J. Bruce Fields
2008-12-13 1:14 ` David Howells
2008-12-12 20:00 ` Jeff Garzik
2008-12-12 21:34 ` Chris Friesen
2008-12-13 5:59 ` Junio C Hamano
2008-12-13 23:12 ` Nick Andrew
2008-12-12 20:07 ` Nicolas Pitre
2008-12-13 0:30 ` David Howells
2008-12-13 1:04 ` David Howells
2008-12-13 1:16 ` Sverre Rabbelier
2008-12-19 6:33 ` Willy Tarreau
2008-12-13 1:22 ` Nicolas Pitre
2008-12-13 3:35 ` Junio C Hamano
2008-12-14 10:33 ` Matthieu Moy
2008-12-14 17:33 ` Marcin Slusarz
2008-12-19 0:47 ` C. Scott Ananian
2008-12-19 9:26 ` Michael J Gruber
2008-12-19 17:08 ` C. Scott Ananian
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081212185347.GK5691@genesis.frugalware.org \
--to=vmiklos@frugalware.org \
--cc=dhowells@redhat.com \
--cc=git@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).