It occurred to me that a good exercise for reacquainting myself with the
Fossil source tree (it's been awhile since DRH's presentation on same)
would be to add a [fossil all close] command. Plus I actually could use
such a thing right about now since I'm reorganizing repositories and
checkouts, and that requires a lot of closing.
[fossil all close] is there in my checkout, and it works, but I'm not
satisfied until it's polished, and that means error messages being useful.
For example, saying "current directory is not within an open checkout"
is most unhelpful when there's no indication which directory mistakenly
found its way into [fossil all ls -c].
My design approach was simply to add "close --chdir" with useCheckouts
and quiet to all_cmd, but this leads to confusing errors whenever
anything is shy of perfect.
I suppose I could ditch quiet, but I thought I might try improving
close_cmd to say which checkout it's talking about. However, I did not
want to break compatibility by changing the format of warning and error
messages for modes of operation currently in use.
So I figured I'd make it explicitly name the checkout whenever --chdir
is in use. (Also silently ignore the "not an open checkout" error.)
Just call find_option("chdir"), right? Wrong. main() already snarfed
it up, and find_option() has the lovely side effect of calling
remove_from_argv() upon match.
Could add global variables, or could add a --header option or --verbose
or whatever, but none of these approaches appeal to me since they are
simply workarounds for a design limitation elsewhere.
The goal isn't to bang something out quickly, it's to explore the code,
so please bear with me as I obsess over normally unimportant details.
Not sure if I'm actually asking anything. I'm just putting out some
thoughts and impressions. Perhaps someone will have a suggestion. Or I
could indeed turn off quiet mode and leave close_cmd() alone.
--
Andy Goth | <andrew.m.goth/at/gmail/dot/com>
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users