Re: Upcoming memcached releases + rambling.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Feb 09, 2008 at 12:28:45AM -0800, dormando wrote:

> If I _think_ I understand these right, you can actually sometimes git
> diff with the second repo as an argument. That'll show the differences
> since the target repo/branch (git diff . /path/to/other/repo#branch),
> which will be incoming or outgoing.

No, that doesn't work. It will literally diff the two directories.

What you have probably seen is:

  git diff origin HEAD

which means "diff my current branch with the branch origin". Now
"origin" is typically the name of your upstream remote. However, we also
use the same name to store "tracking branches" that keep tabs on the
remote's state. So the branch "origin" stores the state of the remote's
current branch (as of the last time you did a "git fetch" of course).

But "git diff HEAD <someURL>" does not work. You would want "git fetch
<someURL> && git diff HEAD FETCH_HEAD".

> That'll show the raw changes... for showing the difference in changeset,
>   you can do a: git log --since HEAD origin
> ... if origin were the remote repo. If you don't have the latest
> changes, fetch more, rebase your repo on top of that, then git log
> --since will show you what you have to upload.

That --since is not necessary. You want "git log HEAD..origin" (where
"A..B" means "what's in B, but not in A"). "--since" is for
date-limiting, and the syntax is like "--since=2.weeks.ago".

> I think my knowledge on how to do this in git is a bit dated, so I'll go
> read (I started with git in 0.99 series, where it was missing most of
> these fancy "usability features", so sometimes I do things the hard way
> still).

Pre-1.5 and 1.5 have quite a few interface differences (and of course
there were many changes from 0.99 to 1.5 :) ).

> Otherwise you can use git fetch to "pull" the remote changes into a
> branch but not apply anywhere, then use git log with relative commit ids
> to show the changesets (with -p to show the full changes!)

Yes, although I would say that git fetch "fetches" changes, so as not to
confuse it with the "pull" command which does something different.

> Unless I'm getting my wires crossed and this is a patch management
> thinger, in that case it's 'git format-patch' and 'git am' (although
> there's an alternative to am).

Actually "am" is the new alternative to "applymbox" which is now
officially gone in 1.5.4.

-Peff
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux