Re: Yet another Git tutorial

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: John Wiegley <johnw@...>
Cc: <git@...>
Date: Monday, April 28, 2008 - 6:27 pm

On Mon, Apr 28, 2008 at 02:39:46AM -0400, John Wiegley wrote:

In addition to what was mentioned before me:

On page 6, instead of `git show --pretty=format:%T HEAD | head -1`, it
is better to use `git log -1 --pretty=format:'%T' HEAD`. In general,
`git show <commit-object>` is `git log -1 -p <commit-object>`, and
you do not need diff here.

On page 7:

It is probably nit-picking, but blobs never live in trees. They may
only be referenced by trees, while they always reside in 'objects'.
At this point, the blob is already placed into 'objects', but it is
not referenced by any tree, but only by index. So if you decide not
to commit this file then this blob will become dangling.

On page 10:

Though typically there is only one commit object in Git repository
without a parent, it could be more than one.


If there is no files in the current commit then the commit object
will reference to an empty tree, i.e. without any blob in it.


On page 12:

Actually, inclusive name2 but excluding name1. IMHO, it is better to
describe it as:
`name1..name2` is a short-hand for `^name1 name2`, which is equivalent
to `name2 --not name1`, i.e. all commits in name1 excluding those that
are part of name2.


Not true. It shows all commits on both "foo" and "bar" that's happened
since their common ancestors. In other words, `name1...name2` is
equivalent to `name1 name2 --not $(git-merge-base --all name1 name2)`.
The '--all' flag means to consider their all ancestors, not just first
one.


BTW, maybe it would be useful to mention `git log -S<string>` somewhere
as a better alternative to `git blame`, because people with CVS/SVN
background tend to abuse `git blame` while `git log -S` is usually more
convenient and more efficient.


Dmitry
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Yet another Git tutorial, John Wiegley, (Mon Apr 28, 2:39 am)
Re: Yet another Git tutorial, Matt Graham, (Mon Apr 28, 9:25 pm)
Re: Yet another Git tutorial, John Wiegley, (Tue Apr 29, 9:40 pm)
Re: Yet another Git tutorial, Robert Haines, (Wed Apr 30, 7:17 pm)
Re: Yet another Git tutorial, Junio C Hamano, (Mon Apr 28, 8:17 pm)
Re: Yet another Git tutorial, Dmitry Potapov, (Mon Apr 28, 6:27 pm)
Re: Yet another Git tutorial, Junio C Hamano, (Mon Apr 28, 7:34 pm)
Re: Yet another Git tutorial, Bob Hiestand, (Mon Apr 28, 3:45 pm)
Re: Yet another Git tutorial, Brian Gernhardt, (Mon Apr 28, 12:30 pm)
Re: Yet another Git tutorial, Paolo Bonzini, (Mon Apr 28, 12:40 pm)
Re: Yet another Git tutorial, Brian Gernhardt, (Mon Apr 28, 12:42 pm)
Re: Yet another Git tutorial, Jeff King, (Mon Apr 28, 5:36 am)
Re: Yet another Git tutorial, Johan Herland, (Mon Apr 28, 5:27 am)
Re: Yet another Git tutorial, John Wiegley, (Mon Apr 28, 4:11 pm)