All of lore.kernel.org
 help / color / mirror / Atom feed
* What did I just fetch?
@ 2007-01-31 12:55 Bill Lear
  2007-01-31 13:15 ` Jakub Narebski
  2007-01-31 13:30 ` Santi Béjar
  0 siblings, 2 replies; 5+ messages in thread
From: Bill Lear @ 2007-01-31 12:55 UTC (permalink / raw)
  To: git

When updating in cvs, I get a list of files changed by the update.

How can I do this in git when fetching into a bare repo?

% GIT_DIR=. git fetch git://source/project
remote: Generating pack...
remote: Done counting 18 objects.
remote: Result has 10 objects.
remote: Deltifying 10 objects.
remote:  100% (10/10) done
Unpacking 10 objects
remote: Total 10, written 10 (delta 6), reused 7 (delta 3)
 100% (10/10) done

So, I'd like to see the files, perhaps the differences, etc.


Bill

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: What did I just fetch?
  2007-01-31 12:55 What did I just fetch? Bill Lear
@ 2007-01-31 13:15 ` Jakub Narebski
  2007-02-01 13:57   ` Bill Lear
  2007-01-31 13:30 ` Santi Béjar
  1 sibling, 1 reply; 5+ messages in thread
From: Jakub Narebski @ 2007-01-31 13:15 UTC (permalink / raw)
  To: git

Bill Lear wrote:

> When updating in cvs, I get a list of files changed by the update.
> 
> How can I do this in git when fetching into a bare repo?
> 
> % GIT_DIR=. git fetch git://source/project
> remote: Generating pack...
> remote: Done counting 18 objects.
> remote: Result has 10 objects.
> remote: Deltifying 10 objects.
> remote:  100% (10/10) done
> Unpacking 10 objects
> remote: Total 10, written 10 (delta 6), reused 7 (delta 3)
>  100% (10/10) done
You should have also something like below:
* refs/remotes/origin/master: fast forward to branch 'master' of git://source/project
  old..new: 1732a1f..73a2acc

> So, I'd like to see the files, perhaps the differences, etc.

 $ git diff --summary 1732a1f..73a2acc
 $ git diff --summary ORIG_HEAD..HEAD

Or, if you want to see the log instead:

 $ git log 1732a1f..73a2acc
 $ git log origin/master

By the way, you get summary automatically when doing pull, on merge
(but not on fast-forward, I think).
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: What did I just fetch?
  2007-01-31 12:55 What did I just fetch? Bill Lear
  2007-01-31 13:15 ` Jakub Narebski
@ 2007-01-31 13:30 ` Santi Béjar
  1 sibling, 0 replies; 5+ messages in thread
From: Santi Béjar @ 2007-01-31 13:30 UTC (permalink / raw)
  To: Bill Lear; +Cc: git

On 1/31/07, Bill Lear <rael@zopyra.com> wrote:
> When updating in cvs, I get a list of files changed by the update.
>
> How can I do this in git when fetching into a bare repo?
>
> % GIT_DIR=. git fetch git://source/project
> remote: Generating pack...
> remote: Done counting 18 objects.
> remote: Result has 10 objects.
> remote: Deltifying 10 objects.
> remote:  100% (10/10) done
> Unpacking 10 objects
> remote: Total 10, written 10 (delta 6), reused 7 (delta 3)
>  100% (10/10) done

You are just fetching the objects, but you are not storing the tip of
the branch (in this case HEAD) anywhere.

Use the verbose flag (-v) to get the commit hash

$ git fetch -v ${remote}
....
* fetched ${remote}
  commit: ${hash}

Santi

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: What did I just fetch?
  2007-01-31 13:15 ` Jakub Narebski
@ 2007-02-01 13:57   ` Bill Lear
  2007-02-05 12:21     ` Jakub Narebski
  0 siblings, 1 reply; 5+ messages in thread
From: Bill Lear @ 2007-02-01 13:57 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: git

On Wednesday, January 31, 2007 at 14:15:49 (+0100) Jakub Narebski writes:
>Bill Lear wrote:
>
>> When updating in cvs, I get a list of files changed by the update.
>> 
>> How can I do this in git when fetching into a bare repo?
>> 
>> % GIT_DIR=. git fetch git://source/project
>> remote: Generating pack...
>> remote: Done counting 18 objects.
>> remote: Result has 10 objects.
>> remote: Deltifying 10 objects.
>> remote:  100% (10/10) done
>> Unpacking 10 objects
>> remote: Total 10, written 10 (delta 6), reused 7 (delta 3)
>>  100% (10/10) done
>You should have also something like below:
>* refs/remotes/origin/master: fast forward to branch 'master' of git://source/project
>  old..new: 1732a1f..73a2acc
>
>> So, I'd like to see the files, perhaps the differences, etc.
>
> $ git diff --summary 1732a1f..73a2acc
> $ git diff --summary ORIG_HEAD..HEAD

BTW, this is with git 1.4.4.1...

I don't see the refs/remotes/origin/master line you refer to:

%  git --bare fetch git://source/project
remote: Generating pack...
remote: Done counting 18 objects.
remote: Result has 10 objects.
remote: Deltifying 10 objects.
remote:  100% (10/10) done
Unpacking 10 objects
remote: Total 10, written 10 (delta 6), reused 7 (delta 3)

And no refs/remotes file:

% ls refs
heads  tags

I can get a commit id by using -v:

% git --bare fetch -v git://source/project
remote: Generating pack...
remote: Done counting 18 objects.
remote: Result has 10 objects.
remote: Deltifying 10 objects.
remote:  100% (10/10) done
Unpacking 10 objects
remote: Total 10, written 10 (delta 6), reused 7 (delta 3)

* fetched git://source/project
  commit: 89f0bd4

And, why do repeated fetches seem to fetch something instead of
saying "I've got nothing to do, you stupid git!"?

Well, I'd just like to see what is in this commit, I guess, then.

So, I try git cat-file, and notice what looks like an error in
the usage message:

% git --bare cat-file 89f0bd4
usage: git-cat-file [-t|-s|-e|-p|<type>] <sha1>

It seems to indicate the switches and the type are optional (square
brackets), but it's not doing anything, so it must want one of the
switches.

% git --bare cat-file commit 89f0bd4
tree d9421c9d3079dc48a3b3c5938a6a29e1404bd322
parent 0624063622c793d5812bdf84c909eaf17abf4f2d
parent 069596712287564e2e6d45207cb5f5b4069ed7ac
author John Smith <jsmith@myco.com> 1170168752 -0600
committer John Smith <jsmith@myco.com> 1170168752 -0600

Merge branch 'master' of ssh+git://source/repos/git/project

So, then I find git show:

% git --bare show --pretty=fuller 89f0bd4
[98 blank lines suppressed!!]
commit 89f0bd43b21431c70fe22e099b8c0fc11b190b0e
Merge: 0624063... 0695967...
Author:     John Smith <jsmith@myco.com>
AuthorDate: Tue Jan 30 08:52:32 2007 -0600
Commit:     John Smith <jsmith@myco.com>
CommitDate: Tue Jan 30 08:52:32 2007 -0600

    Merge branch 'master' of ssh+git://source/repos/git/project

So, still no "content" here.  Should I be expecting some?

And, what does "Merge: 0624063... 0695967..." mean?


Bill

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: What did I just fetch?
  2007-02-01 13:57   ` Bill Lear
@ 2007-02-05 12:21     ` Jakub Narebski
  0 siblings, 0 replies; 5+ messages in thread
From: Jakub Narebski @ 2007-02-05 12:21 UTC (permalink / raw)
  To: Bill Lear; +Cc: git

On 01.02.2007, Bill Lear wrote:
> On Wednesday, January 31, 2007 at 14:15:49 (+0100) Jakub Narebski writes:
>>Bill Lear wrote:
>>
>>> When updating in cvs, I get a list of files changed by the update.
>>> 
>>> How can I do this in git when fetching into a bare repo?
>>> 
>>> % GIT_DIR=. git fetch git://source/project
>>> remote: Generating pack...
>>> remote: Done counting 18 objects.
>>> remote: Result has 10 objects.
>>> remote: Deltifying 10 objects.
>>> remote:  100% (10/10) done
>>> Unpacking 10 objects
>>> remote: Total 10, written 10 (delta 6), reused 7 (delta 3)
>>>  100% (10/10) done
>> You should have also something like below:
>> * refs/remotes/origin/master: fast forward to branch 'master' of git://source/project
>>   old..new: 1732a1f..73a2acc
>>
>>> So, I'd like to see the files, perhaps the differences, etc.
>>
>> $ git diff --summary 1732a1f..73a2acc
>> $ git diff --summary ORIG_HEAD..HEAD
> 
> BTW, this is with git 1.4.4.1...
> 
> I don't see the refs/remotes/origin/master line you refer to:

git 1.4.4.1 if I remember correctly didn't use "separate remotes"
configuration by default. Besides, your repo might have been cloned
without separate remotes, and if it is bare repo it probably have
been (and should been) cloned 1:1.

So instead of refs/remotes/origin/master you should see refs/heads/origin
if you are in "live" repo, and refs/heads/master if you are in bare repo.

> %  git --bare fetch git://source/project
> remote: Generating pack...
> remote: Done counting 18 objects.
> remote: Result has 10 objects.
> remote: Deltifying 10 objects.
> remote:  100% (10/10) done
> Unpacking 10 objects
> remote: Total 10, written 10 (delta 6), reused 7 (delta 3)

But the problem here (namely no refs update info) is that you use URL
but provide no refspecs. Git downloads something, but doesn't update
refs because you didn't requested that. This case is usually used _only_
to *pull* (not only fetch) some spurious repo without need for tracking
branch.

If you want to download changes since clone (or last fetch), you should
use "git --bare fetch origin" (or even "git --bare fetch"). Note: with
git 1.4.4.1 this would not pick up _new_ refs.

> And no refs/remotes file:
> 
> % ls refs
> heads  tags

I forgot that bare repos got cloned 1:1, and not using separate remotes
layout. Besides git 1.4.4.1 didn't use separate remotes layout by default,
if I remember correctly.

> I can get a commit id by using -v:
> 
> % git --bare fetch -v git://source/project
> remote: Generating pack...
> remote: Done counting 18 objects.
> remote: Result has 10 objects.
> remote: Deltifying 10 objects.
> remote:  100% (10/10) done
> Unpacking 10 objects
> remote: Total 10, written 10 (delta 6), reused 7 (delta 3)
> 
> * fetched git://source/project
>   commit: 89f0bd4

Hmmm... I wonder what you have fetched. Probably remote HEAD.

> And, why do repeated fetches seem to fetch something instead of
> saying "I've got nothing to do, you stupid git!"?

Because even that you download objects, you don't store _references_
to those objects (no refs gets updated because of no refspecs in git-fetch
invocation), besides FETCH_HEAD. And FETCH_HEAD is used by git-pull
only; it looks like it is not considered in checking what you have when
negotiation on fetch.

> Well, I'd just like to see what is in this commit, I guess, then.
> 
> So, I try git cat-file, and notice what looks like an error in
> the usage message:

You should use git-show instead. In 1.5.0-rc3 it can be used
for pretty much anythong git-cat-file was used/

> % git --bare cat-file 89f0bd4
> usage: git-cat-file [-t|-s|-e|-p|<type>] <sha1>
> 
> It seems to indicate the switches and the type are optional (square
> brackets), but it's not doing anything, so it must want one of the
> switches.

Fact. I'm not sure how this usage string should be written...

> % git --bare cat-file commit 89f0bd4
> tree d9421c9d3079dc48a3b3c5938a6a29e1404bd322
> parent 0624063622c793d5812bdf84c909eaf17abf4f2d
> parent 069596712287564e2e6d45207cb5f5b4069ed7ac
> author John Smith <jsmith@myco.com> 1170168752 -0600
> committer John Smith <jsmith@myco.com> 1170168752 -0600
> 
> Merge branch 'master' of ssh+git://source/repos/git/project
> 
> So, then I find git show:
> 
> % git --bare show --pretty=fuller 89f0bd4
> [98 blank lines suppressed!!]
> commit 89f0bd43b21431c70fe22e099b8c0fc11b190b0e
> Merge: 0624063... 0695967...
> Author:     John Smith <jsmith@myco.com>
> AuthorDate: Tue Jan 30 08:52:32 2007 -0600
> Commit:     John Smith <jsmith@myco.com>
> CommitDate: Tue Jan 30 08:52:32 2007 -0600
> 
>     Merge branch 'master' of ssh+git://source/repos/git/project
> 
> So, still no "content" here.  Should I be expecting some?
> 
> And, what does "Merge: 0624063... 0695967..." mean?

It means that it is a merge commit. And merge commits (unless you enable
merge.summary) by default consist only of "Merge branch '<name>' of <repo>"
nessage. Merge commit diff is not shown by default: you have to use --cc
for that (as ordinary diff doesn't work with more than one parent).

-- 
Jakub Narebski
ShadeHawk on #git
Poland

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-02-05 12:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-31 12:55 What did I just fetch? Bill Lear
2007-01-31 13:15 ` Jakub Narebski
2007-02-01 13:57   ` Bill Lear
2007-02-05 12:21     ` Jakub Narebski
2007-01-31 13:30 ` Santi Béjar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.