[Tfug] Version Control
Bexley Hall
bexley401 at yahoo.com
Wed Mar 27 23:26:12 MST 2013
Hi Yan,
On 3/27/2013 8:10 PM, Yan wrote:
> So, a quick intrusion into this flame(ish)war:
>
> 1. There was a question raised about git on large repositories. The linux
> kernel has something like 15 million lines of code. It's in git. There are
I think that's a SLOC figure. E.g., this is 9 SLOC:
/* comment */
if (foo)
{
bar();
}
else
{
baz();
}
Estimates regarding the actual *complexity* of the Linux kernel
(remember, you're *just* talking about the kernel!) are in the
~5M range.
> available git repositories for Chromium and Mozilla (although, IIRC, the
> actual development work is done in SVN and Mercurial, respectively).
> However, people *do* complain that git doesn't do well with "very large"
> repositories. Not sure how large, but pretty freaking large.
>
> 2. A single, general diff for any type of file is a somewhat of a crazy
> pipedream. However, git tries:
>
> # git difftool -y -x /path/to/a/differ somefile
>
> For example:
>
> # git init
> Initialized empty Git repository in /home/yans/t/.git/
> # echo one> a
> # git add a
> # git commit -m "first version" a
> [master (root-commit) b37b0fb] first version
> 1 file changed, 1 insertion(+)
> create mode 100644 a
> # echo two> a
>
> # git difftool -y -x /usr/bin/diff a
> 1c1
> < one
> ---
>> two
>
> # git difftool -y -x /usr/bin/wc a
> 1 1 4 /tmp/JjEC1R_a
> 1 1 4 a
> 2 2 8 total
>
> # git difftool -y -x /bin/echo a
> /tmp/n7tVrk_a a
>
> This doesn't make any assumptions about the content of the file, of course.
> So if you had a video file in git and a video diffing utility installed in
> /usr/bin/magic_video_diff, you would do:
The problem is: ------------^^^^^^^^^^^^
Why should *you* have to remember that "foo" is a shell script and
not an executable? Or, a video file? Or...
The machine should handle those bookkeeping issues for you!
(this was the nature of the changes I made to my version of CVS)
> # git difftool -y -x /usr/bin/magic_video_diff myvideo.ogv
>
> You can further specify the specific revisions to diff and so forth, but
> you can read the manpage for that :-). I think that's probably almost as
> close as you can get with a VCS.
My contention is that the VCS should handle all that *for* you!
I should be able to tag each filename with a type (or, direct the
system to treat all .X files as <typeX>). Then, it should consult
a database that maps each type to a particular pair of "diff-er"s.
And, invoke that diff-er when it encounters a file of that type!
Note that this would allow me to compare "foo.sh" to "foo.c" if
both were registered as the same type (i.e., the file suffic is
meaningless).
Similarly, I should be able to compare a UTF16 file to an ASCII
file (if the diff-er understood both formats). Or, a TIFF to a BMP,
etc.
[The "other" diff-er in each pair is used to provide a non-interactive
output -- something that is known to be routable to a log file. I
should be able to interact with the VCS and "see" the differences
in a form that is appropriate to the objects that it detects as
"differing"; or, just capture the differences in a summary report.]
More information about the tfug
mailing list