RE: Instant diff

"Arthur Barrett" <[email protected]> Mon, 6 Jun 2011 19:20:00 +1100
Newsgroups gmane.comp.version-control.cvs.gui.devel
Message-ID <[email protected]>
Hi Guy,


> 
> I've taken a couple screenshots of a popular Git GUI called SmartGit, 
> and uploaded to my PhotoBucket site: 
> http://s247.photobucket.com/albums/gg134/guy-rouillier/Computer/.
> 

OK - that helps.  I've not personally seen a CVS gui that does that.
I'm also not personally sure I'd find it useful, so therefore even if
I'd seen it - it wouldn't have been memorable.


> Right, but to be able to instantly display all diffs, I'd need a 
> complete copy of the remote CVS repository locally.  That is 
> not part of the CVS API.  

Please be carefuly with statements like 'not part of the CVS API'.
There is actually something called CVSAPI, and it's got nothing to do
with the protocol.  March Hare extended the CVS protocol to include
being able to sync the repository about 3 or 4 years ago.


OK - now for the hard-to-explain bit...


> Both.  You'd need underlying support to make this possible.  The GUI 
> part is easy, once you have the repo copied locally to instantly 
> generate the diffs.
> 
.
.
.
> 
> That would be a start, but it would only allow me to see a 
> diff between 
> my current changes and the original content of the same file version. 
> I'd like to be able to instantly click through the entire history of 
> changes.
> 
.
.
.
> 
> I'm sure diff is quick.  Having to download file versions 
> from a central 
> server is slow.
> 


Please forget about having a local copy of anything.  I do not believe
you need a local copy of anything to do what you are asking.  Download
of individual files should be quick.  Download of a diff should be even
quicker.

Let me try and explain with a simile.

From your screenshots (which were very useful thanks) it's not clear
where the file CheckoutResult.java is stored.  Is it stored on c: or
mayble on h: (a network drive).

I would expect this to work regardless of if this is a 'local' c: drive
or a network drive, eg: 'h:'.  Some organisations have really really
poor infrastructure (or more often lazy network admins) and these
networkd drives are terrible - most companies they are quick and
effective.

So there is not much difference between 'getting' the file from the
network drive or getting it from the CVS server.  It's still coming
across the network, it's still being 'served'.  If anything the CVS
server should be faster because it's a protocol designed for
low-bandwidth networks...

One gripe I've had for a while with both WinCVS and TortoiseCVS is how
they implement 'diff'.  I understand the pragmatism involved, but it's
simply not very elegant.  They both 'get' the whole file for the
revisions to compare, wheras it'd be just as effective to get the diff
and apply it as a patch to the current file, therefore 'generating' the
'target' of the diff.  For a reasonable sized java or c++ file, say 100K
it'd reduce network I/O from 50K to maybe 1K (assuming compression).

So - if you can ignore the whole 'git can do this because the history is
local' thing, and just concentrate on it as a GUI problem, then you just
need to write a GUI.  Now if SmartGit was open source (like CVSNT was
and still is) then this would be a very easy proposition.

Here are a few technical notes:

1) 'Log' in git and cvs are more-or-less identical AFAICT, but 'log' in
CVS has always been unstructured.  We've been (very slowly) trying to
create 'parsable' versions of 'unstructured' output for a while, and
'log' is a fine candidate.  It'd make the job of the GUI to do something
like what you describe a lot easier if the 'log' output was XML.  This
is actually really easy to do in the code, so a customer with 10 or 20
licenses could easily talk us into doing this.

2) Provided your server and the network are OK, the biggest 'cost' (in
time/cpu/bandwidth) for the 'instant diff' on windows or mac is going to
be process creation time.  To 'start' a CVSNT.EXE, it loads all its
DLL's, connects up to the server, authenticates and get the results will
probably take a minimum of 1 second, often a minimum of 3 seconds when
you have anti-virus installed.  Most of that time is windows and
anti-virus rubbish - it'd be identical if the repository was 'local' (at
least with CVSNT 2.8/Suite 2009 because of how the high-performance
server pre-starts server processes).  So If I was designing a GUI for
this purpsoe, I'd actually embed a mini-client that authenticates once,
and performs 'quick' protocol commands in a loop to get each diff. We're
already working on one of these for the iPad and the Nook.
Unfortunately the FSF have decided that GPL apps are not allowed on the
iPad through the iTunes App Store, so this is a closed-source solution.
But it's ideal for this.  We may eventually port the code to the CVSAPI
(which is LGPL and therefore possibly OK on the App Store) which would
make it easy to call from any GUI.

3) GUI's are a pain.  Well not really, but in any group of 100 pepple
there is a high liklihood that what they find 'ideal' in a GUI cannot be
handled by a single tool.  Therefore in CVS Suite 2009 we ship 4 GUI's:
CVS Suite Studio, TortoiseCVS and WinCVS and SCCI Integration.  And
we're already thinking about two more - an Office ribbon and something
more satisfactory for tech-writers.  The GUI you are describing doesn't
really fit any (WinCVS would be the closest) - it needs docakble windows
and a 'sandbox' selection - it's a lot like Eclipse another IDE...
Because SmartGit is not open source, whoever implements something like
this needs to check out the patent portfolio and be very sure they are
implementing an established idea, not 'mimic' this other app.

I think altogether your idea is an interesting one.  I personally
wouldn't list it as time saving or productivity enhancing so it's not
going to be on the top of my todo list for a while, it will eventually
get there...

If you still think this is somehow dependant on a 'local' repostiory,
well, CVS Suite 2009 already has that option too.  But really I don't
see it.

> To be honest, the group at work looked at Git because some were 
> uncomfortable with MarchHare taking the open source CVSNT private.  A 
> valid concern is that MarchHare could make enhancements to CVSNT that 
> result in a completely proprietary version control system, which of 
> course is contrary to the spirit of open source.  

Honestly - absolutely no word of that makes any sense to me at all.

CVSNT was always private - a guy wrote it in his room in his house...
But it's also always been public (published open source).  It still is
just as public and just as private as it ever was and will always be,
nothing that March Hare Software or anyone else can do will change that.
The only thing that's changed is that we no longer provide any anything
for zero-dollars.  According to the Free Software Foundation, price has
nothing to do with free software.

Whilst some of our staff had worked full time for years with no pay and
were struggling to pay their rent, some 'zero-dollar' users boasted to
us on the mailing list about how they'd just purchased 10 or 20 licenses
for SmartCVS and not CVS Suite.  Of course all our team read those
boasts and those comments had a dramatic effect on the mood.  If people
are happy to pay for a commercial non-open-source GUI, they should be
happier pay for the open-source server that allows the GUI to work.  Or
as the Free Software Foundation puts it: Free Software is MORE VALUABLE
than non-free software.  

I personally do not consider a bug report a 'contribution' - regardless
of if someone pays for software or get it for 'zero-dollars' they'll
still submit a bug report.  Whilst we appreciate your bug reports, we've
always gotten more bug reports from people who paid for CVS Suite than
those who got CVSNT for zero-dollars.  

Regards,


Arthur Barrett


------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/cvsgui-dev/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/cvsgui-dev/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/