Rich Freeman on 25 Oct 2012 13:42:49 -0700 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: [PLUG] git-fu |
On Thu, Oct 25, 2012 at 3:50 PM, Frank Szczerba <frank@szczerba.net> wrote: > On Oct 25, 2012, at 3:18 PM, Rich Freeman <r-plug@thefreemanclan.net> wrote: > >> git has a real beauty to it, though some things are surprisingly hard >> to do compared to rcs/cvs. With cvs it is very cheap to compare two >> versions of a file, since it just stores the diffs per file. With git >> the only way to tell what the differences are between two commits is >> to walk the entire tree doing comparisons (though this is greatly >> aided by the fact that everything is hashed already). > > I'm not sure what you mean here. Are you talking about the work git has to do behind the scenes? From a user perspective it's simple: > > $ git diff refA..refB path1 path2 path3.... > > This is very fast, even on a large repo like the kernel sources. I was talking about behind the scenes - that git diff has to open dozens of files doing line-by-line comparisons across them to identify the affected blobs, and then do a full compare on the blobs themselves. rcs would just look at one file to do the same. Of course, it is a bit of apples-and-oranges since cvs/rcs has no concept of a commit in the first place, in the sense of a group of files changed atomically. The git tool does a really good job of hiding the complexity and is very fast. In practice diffing two git trees is very quick since they are, after all, trees. Rich ___________________________________________________________________________ Philadelphia Linux Users Group -- http://www.phillylinux.org Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce General Discussion -- http://lists.phillylinux.org/mailman/listinfo/plug