[KPhotoAlbum] Preparing for new release

Tuomas Suutari tuomas.suutari at gmail.com
Fri Feb 10 23:18:25 GMT 2012


Howdy,

posting this Git related info to list too, since there could be
someone else too, who's thinking about the differences between Git and
SVN.

On 10 February 2012 22:29, Martin Jost <lists at majo.name> wrote:
> One question on this:
>> Just "git log" and see the topmost "commit xxxxxx" line. The xxxxxx
>> here (actually 40 hexadecimal characters) is the id of the commit
>> you're at. Commit ids (aka SHA-1 of commit) are the "version numbers"
>> of git.
>
> Ok, this also means the version numbers imply no ordering (in time of
> checkin or some such).

Yes, you're right. This is probably the most common thing that SVN
users ask when they start using Git.

> Is there something like that or do I have to look
> at the date-info then ?

Short answer: You won't need the ordering by date.

Longer answer:

You can look at the log output and see which commit comes first. Or
even better, use gitk, which shows the commit graph graphically, or
something like "git log --graph --oneline".

It should be noted that the date order is not that important. More
important is the topological order, i.e. which comes first in the
commit history. And if two commits are not from the same line of
history (i.e. in different branches), then their (topological) order
is not well defined, which practically means both of them could have
changes that are not included in the other. This is like in SVN if you
have two branches a and b (both originating from trunk), then a at 100
could be older than b at 50, so the revision number doesn't tell
everything in the SVN world either.

Another strange detail about Git: There are actually two different
dates about each commit, the author's date and the commit date. It's
possible that a commit X is committed before commit Y even if Y is
authored before X. This is not even so unusual when applying patches
sent by email, since they are usually waiting in the committers inbox
for a while before they get committed (and not necessarily committed
in the order they arrive). AND it's even possible to fake the commit
date. :) So don't use the dates, but the topological order instead, to
determine if some commit has the changes of another commit.

-- 
Tuomas



More information about the Kphotoalbum mailing list