Well, the actual question is: In svn I can do a remote diff (diff between two remote revisions) without having to do a checkout, is this possible for git ?
Re: Git vs svn. Is ... possible ?
Hi Rafał,
* Rafa? Mu?y?o [28 III 2008 14:24]:
> Well, the actual question is: > In svn I can do a remote diff (diff between two remote revisions) without > having to do a checkout, is this possible for git ?
The question makes no sense to me. Git by design is a distributed SCM tool, so there is no such thing like "remote revisions". You can have tracking branches (clones) of some remote repositories, but all the commits on such branches are also stored locally. So you have full access to them, even without a permanent connection to such remote repositories.
And answering to the second part of your question: Yes, you can do "git diff" operation between any of the commits in the repository you are working with. No need to checkout before. You can perform "git diff" even on a bare repository without the working three.
Please refer to "man git-diff" for more info.
BR, /Adam
PS. The encoding you used for your message is not playing well with the Polish accented characters in your name ;)
-- .:. Adam Piatyszek (ediap) .:.....................................:. .:. ediap@users.sourceforge.net .:................................:.
Re: Git vs svn. Is ... possible ?
On Fri, Mar 28, 2008 at 02:36:25PM +0100, Adam Piatyszek wrote:
Show 7 quoted lines
> > The question makes no sense to me. Git by design is a distributed SCM tool, > so there is no such thing like "remote revisions". You can have tracking > branches (clones) of some remote repositories, but all the commits on such > branches are also stored locally. So you have full access to them, even > without a permanent connection to such remote repositories. >
It would certainly be possible to *implement* such a thing, but first question would be, "why would you want to". One of the things that makes git so nice is that repositories don't take that much space, and if you have a local repository (or no network access at all) it's much faster to consult the local repository at all.
In fact, with svn, I normally consider it a bug that you *have* to consult the remote repository to do a diff between two arbitrary revisions.
- Ted
Re: Git vs svn. Is ... possible ?
On Friday, March 28, 2008 at 14:24:38 (+0100) =?utf-8?B?UmFmYcWCIE11xbx5xYJv?= writes:
>Well, the actual question is: >In svn I can do a remote diff (diff between two remote revisions) without >having to do a checkout, is this possible for git ?
I'm not sure what you mean by "two remote revisions". Do you mean you are on machine X, and you want to diff content on machine Y and machine Z? If so, you could probably do that in git fairly easily with some script magic that would fetch the remote branches into local tracking branches, and then diff them. This would not literally require you to perform a "checkout", but you would need a git repo (actually a script could take care of creating a temporary repo, fetch into it, do the diff and then remove the temporary repo when done).
If you are talking about having an existing repo on machine X and diffing content that is on machine Y, you can do a fetch followed by a diff, so in that case you can do it literally "without having to do a checkout". Example: if you are working on master and want to see what is different between what you have and what is in a remote repo you are tracking, you can do "git fetch" then "git diff origin/master".
Bill
Re: Git vs svn. Is ... possible ?
On 2008-03-28, Rafa? Mu?y?o <galtgendo@o2.pl> wrote:
> Well, the actual question is: > In svn I can do a remote diff (diff between two remote revisions) without > having to do a checkout, is this possible for git ?
You can craft URLs to gitweb in specific ways to do this. For instance:
http://git.complete.org/branches/redmine-integration/?a=commitdiff_plain;h=fb-bug-738-projects-block;hp=upstream
Shows the diff from branch upstream to branch fb-bug-738-projects-block. You can replace the branch names with the full 40-character SHA1 ids as well.
Leave off the "_plain" and you get diff highlighting.
The header at the top of this thing is going to be a bit misleading, but the content is what you want.
-- John