[GRASS5] d.legend updates

Glynn Clements glynn.clements at virgin.net
Mon Dec 2 23:58:15 EST 2002

H. Bowman wrote:

> > > the new d.legend now in CVS
> > Did you intentionally remove the -o and maxfontsize= options, or did
> > you base your updated version on old code (i.e. the 5.0.0 release
> > version instead of the CVS head)?
> I based my version on what was in the Grass 5.0.0 release.. and so I
> guess I ended up doing a bit more work than was necessary. I'll have a
> look through the CVS system to see what I missed.

OK; looking at the "cvs log" output, it appears that Markus needs some
re-education in the ways of version control ;)

Specifically: *don't* just dump a complete file on top of an existing
file then commit it. Instead, request a diff[1]; if the diff doesn't
apply cleanly, that indicates that you have a conflict.

This is analogous to the way in which CVS itself behaves; when you
commit a file, it creates a diff against the last version which you
retrieved, then tries to apply it against the latest version. If
someone else has changed the same code, it tells you, instead of
blindly discarding the other changes.

[1] Either unified ("diff -u") or context ("diff -c") format. "Plain"
diffs (the default format) are risky, because they will apply without
warning to code which has been substantially changed; they are also
harder to read than unified or context diffs.

> The -o flag is provided by -n, and the maxfontsize= functionality is
> somewhat unneeded now that font size will auto-adjust if it is too
> large for the window. Otherwise font size is controlled by the size of
> the legend boxes, which are in turn controlled by the number of
> categories to display or from user defined mouse/at= sizing.

Neither -o nor maxfontsize= feature in any "released" version, so we
don't really have to worry about backward compatibility.

Discarding code because it isn't relevant is fine; doing so by
accident isn't[2].

[2] Well, not unless we specifically tell would-be developers that we
reserve the right to discard their code for absolutely no reason, but
that doesn't make particularly good PR ;)

> As far as putting it into 5.0.1 goes, more testing would certainly be
> nice before letting it out, as all I know is that it "works for me" ..
> Also, as far as I am concerned it is still in flux- I am still working
> on it, adding a little more functionality and flexibility ... I make
> no claims to being an expert, so there may very well be things I've
> unwittingly overlooked or done wrong as well.

The preceding sentences disfavour inclusion into 5.0.1.

> I can spin out a small diff from the 5.0.0 version which fixes a
> couple of important bugs without introducing any of the new features
> if you prefer. (mouse placement x&y swapped & boxes drawn off center)

If there are definite bugs with simple fixes, they should be
considered separately from non-trivial improvements.

Glynn Clements <glynn.clements at virgin.net>

More information about the grass-dev mailing list