From: "George Spelvin" <linux@horizon.com>
To: git@vger.kernel.org, memcached@lists.danga.com
Subject: Re: Upcoming memcached releases + rambling.
Date: Sun, 10 Feb 2008 04:47:53 -0500 [thread overview]
Message-ID: <20080210094753.23234.qmail@science.horizon.com> (raw)
A few notes about git that may be causing confusion:
1) "git pull" does more than you think, and is for developers only.
To just follow some other work, use only "git fetch".
"git pull" does a fetch, and then merges the fetched branch into your
current HEAD. If your current HEAD is a copy of the remote branch,
this will be harmless, but if it's not, it will produce code changes.
"git fetch" will fetch the remote branch, and then do a "fast-forward"
update of the corresponding local tracking branch. If the local
tracking branch is not an ancestor of the fetched branch, it will
abort with an error.
So, in summary, don't use "pull" unless you want to do a merge.
It will suppress the merge in the obvious trivial cases (no changes
on one side or the other), but will happily combine things.
(The reason that "pull" is such a prominent command is that it's what
Linus does all day: merges other people's development into his tree.)
2) "git log old..new" is a special case of a very general mechanism
for specifying a set of commits to examine. See the man page for
"git-rev-parse" for the full complete rules. You specify a set of
commits to include, and a set to exclude.
The syntax is "include1 include2 ^exclude1 ^exclude2 include3...".
A commit is included in the final set if it is an ancestor of one of
the explicitly listed "include" commits, *and* it is *not* an ancestor
of any of the listed "exclude" commits.
old..new is a convenient equivalent for "^old new": everything in new's
history that is not included in old's history. Thus, "old1..new1
old2..new2" is exactly synonymous with "old1..new2 old2..new1".
They both mean that new1, new2, and all their ancestors are included,
except that old1, old2, and all their ancestors are excluded.
There is one magic bit of syntax, the symmetric difference operator
"rev1...rev2" (note three dots). That means all ancestors of rev1,
and all ancestors of rev2, but excluding all common ancestors of both.
It's also equivalent to an include-exclude list, but the computation
of the exclude set is a bit more complicated. (It's usually just
one common ancestor, but there can be multiples in nasty criss-cross
merge cases.)
3) "git diff old..new" uses the same syntax for a different purpose.
diff only works with two commits, so that's simply an alias for
"git diff old new". (Whether this is a useful conveience or is too
misleading for the beginner has been the subject of heated discussion
on the git mailing list.)
next reply other threads:[~2008-02-10 9:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-10 9:47 George Spelvin [this message]
2008-02-11 12:50 ` Upcoming memcached releases + rambling Jakub Narebski
[not found] <47AAC7DA.2010604@rydia.net>
[not found] ` <4422C0B2-6874-41EA-B4A0-4F3414F385FC@spy.net>
[not found] ` <47AB3DBD.60004@rydia.net>
[not found] ` <3897B3FD-4DCB-4150-8A07-7F8868A70A93@spy.net>
[not found] ` <47AD2D1F.7030807@rydia.net>
[not found] ` <5222C3B4-5E2C-45D2-8DF3-A85D69DDA2CF@spy.net>
2008-02-10 11:05 ` Jeff King
2008-02-10 15:14 ` Jakub Narebski
2008-02-10 15:39 ` Jakub Narebski
[not found] ` <47AD643D.3040800@rydia.net>
2008-02-10 11:15 ` Jeff King
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=20080210094753.23234.qmail@science.horizon.com \
--to=linux@horizon.com \
--cc=git@vger.kernel.org \
--cc=memcached@lists.danga.com \
/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).