[git-users] Re: Output from push

2010-11-23 Thread Konstantin Khomoutov
On Nov 23, 10:33 pm, Roddie Grant  wrote:
> Could someone kindly explain the following or point me to an explanation. It
> is typical of the output from a push. I committed and pushed one file, so
> why 9 objects counted, and 5 compressed and delta 3?
>
> Counting objects: 9, done.
> Compressing objects: 100% (5/5), done.
> Writing objects: 100% (5/5), 638 bytes, done.
> Total 5 (delta 3), reused 0 (delta 0)
> To ssh://path/to/repo
>    c1c4655..02cbed4  general -> dev/general
>
> When I went to remote repo and merged, it confirmed:
> 1 files changed, 19 insertions(+), 8 deletions(-)

I never bothered to learn what these numbers precisely mean (because
this is utterly low-level info), but the general idea is that the
"object" has a broad sense, and it includes anything which Git stores
in its database (and which SHA-1 hash it knows).

Thus, even if you do one commit changing one file, the database will
store at least three new objects:
1) The commit object, recording your commit message, other commit
metadata and pointing to the parent commit object(s), and the tree
object this commit refers to.
2) The file blob representing the contents of the changed file.
3) The tree object mentioned at step (1); it represents the state of
the tree associated with a commit by referencing participating files
and directories using their SHA-1 hashes. The new tree object for our
imaginary commit is required because the new contents of the changed
file hashes to a different SHA-1 hash.

Pushing a branch to a remote repository pushes the commit object
located at the tip of that branch, and pushing it recursively pushes
all the objects referenced by that commit object and which the remote
side does not yet have.

To make things simpler to grok, you can think of all those three types
of objects as being plain text files.
Playing with `git ls-tree` and `git cat-file` can give a very clear
idea about how objects reference one another.

-- 
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] Output from push

2010-11-23 Thread Roddie Grant
Could someone kindly explain the following or point me to an explanation. It
is typical of the output from a push. I committed and pushed one file, so
why 9 objects counted, and 5 compressed and delta 3?

Counting objects: 9, done.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 638 bytes, done.
Total 5 (delta 3), reused 0 (delta 0)
To ssh://path/to/repo
   c1c4655..02cbed4  general -> dev/general

When I went to remote repo and merged, it confirmed:
1 files changed, 19 insertions(+), 8 deletions(-)

Thanks

Roddie Grant


-- 
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.