[git-users] Re: diff-ing branches

2010-10-12 Thread Konstantin Khomoutov
On Oct 12, 11:01 pm, David Doria  wrote:

> Good idea. I tried to do that, but the diff command fails:
>
> [dor...@doriadjec VTK-PCA]$ git remote add kitware git://vtk.org/VTK.git
> [dor...@doriadjec VTK-PCA]$ git fetch kitware master
> remote: Counting objects: 6937, done.
> ...
>  * branch            master     -> FETCH_HEAD
> [dor...@doriadjec VTK-PCA]$ git log --oneline VTK-PCA ^remotes/kitware/master
> fatal: bad revision '^remotes/kitware/master'
>
> I also tried without the ^ (I didn't know if it was a typo)
>
> [dor...@doriadjec VTK-PCA]$ git log --oneline VTK-PCA remotes/kitware/master
> fatal: ambiguous argument 'remotes/kitware/master': unknown revision or path 
> not
> Use '--' to separate paths from revisions
>
> [dor...@doriadjec VTK-PCA]$ git branch
> * VTK-PCA
>   VTK-daviddoria

Well, git fetch with explicitly specified refspecs does not auto-
create any branches and instead writes references to what it fetched
into .git/FETCH_FEAD, so to get a real branch created you have to
actually name it, like this:
$ git fetch -n kitware master:kwmaster
will create a local branch "kwmaster" which would contain the same
object as "master" in the "kitware" repository ("-n" tells git-fetch
not to fetch tags reachable via that branch's history).

Sorry for confusion.

The "^" prefix used with revisions fed to git-log is used for
exclusion, that is,
$ git log a ^b
means "show commits reachable from a but exclude those reachable from
b". See the section about ranges in git-rev-parse manual page.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



Re: [git-users] Re: diff-ing branches

2010-10-12 Thread David Doria
Good idea. I tried to do that, but the diff command fails:

[dor...@doriadjec VTK-PCA]$ git remote add kitware git://vtk.org/VTK.git
[dor...@doriadjec VTK-PCA]$ git fetch kitware master
remote: Counting objects: 6937, done.
...
 * branchmaster -> FETCH_HEAD
[dor...@doriadjec VTK-PCA]$ git log --oneline VTK-PCA ^remotes/kitware/master
fatal: bad revision '^remotes/kitware/master'

I also tried without the ^ (I didn't know if it was a typo)

[dor...@doriadjec VTK-PCA]$ git log --oneline VTK-PCA remotes/kitware/master
fatal: ambiguous argument 'remotes/kitware/master': unknown revision or path not
Use '--' to separate paths from revisions

[dor...@doriadjec VTK-PCA]$ git branch
* VTK-PCA
  VTK-daviddoria

(you can see my current branch is called VTK-PCA)

Thanks for the help so far,

David



On Tue, Oct 12, 2010 at 1:45 PM, Konstantin Khomoutov
 wrote:
> On Oct 12, 9:17 pm, David Doria  wrote:
>
>> Here is my setup:
>>
>> MasterRepo: branch 'master' - this is the "live" copy
>>
>> SecondRepo: branch 'mybranch' - cloned from MasterRepo's master branch
>> a long time ago. Changes have been made.
>>
>> What I want to do is see which files are different in SecondRepo's
>> mybranch versus MasterRepo's master branch. Can I do this? All of the
>> commands I have found are for diffing two branches in the same
>> repository.
> So just bring the MasterRepo's "master" branch to the SecondRepo and
> do any comparisons you need. Then delete that branch.
>
> For instance:
> $ git remote add roots ssh://URL/of/MasterRepo
> $ git fetch roots master
> $ git log --oneline master ^remotes/roots/master
> ...
> $ git remote rm roots
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Git for human beings" group.
> To post to this group, send email to git-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> git-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/git-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: diff-ing branches

2010-10-12 Thread Konstantin Khomoutov
On Oct 12, 9:17 pm, David Doria  wrote:

> Here is my setup:
>
> MasterRepo: branch 'master' - this is the "live" copy
>
> SecondRepo: branch 'mybranch' - cloned from MasterRepo's master branch
> a long time ago. Changes have been made.
>
> What I want to do is see which files are different in SecondRepo's
> mybranch versus MasterRepo's master branch. Can I do this? All of the
> commands I have found are for diffing two branches in the same
> repository.
So just bring the MasterRepo's "master" branch to the SecondRepo and
do any comparisons you need. Then delete that branch.

For instance:
$ git remote add roots ssh://URL/of/MasterRepo
$ git fetch roots master
$ git log --oneline master ^remotes/roots/master
...
$ git remote rm roots

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.