Re: Cleaning up git user-interface warts
- From
Junio C Hamano <junkio@cox.net>
- Date
- Nov 17, 2006, 01:49 UTC
- Message-ID
- <7vejs2zvu1.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <20061116222008.GA7201@pasky.or.cz>
Petr Baudis <pasky@suse.cz> writes:
You already said this kind of details are subjective so I'd omit the usual "I would think" and answer them without worrying about a big style flamewar. People, please be civil ;-).
> What about [ instead of test?
[ ] is not more readable.
Show 6 quoted lines
> if foo; then > > instead of > > if foo > then
Having "then" on the beginning of line is much more readable.
Show 8 quoted lines
> Am I the only one who hates > > case "$log_given" in > tt*) > die "Only one of -c/-C/-F can be used." ;; > *tm*|*mt*) > die "Option -m cannot be combined with -c/-C/-F." ;; > esac
This is much more readable without "case". "abandon the old rule that told us to avoid if when case would do" applies. Although it is about multiple possibility switch (so a case can be made that "case" is appropriate here), we should reduce the use of "case" to cases like the outermost big "case" you find in git-merge-one-file-script.
> It would be really great if Git would have something alike the Cogito's > optparse infrastructure. I'm not sure if you can implement it in Bourne > sh with reasonable performance, though...
getopt(1) is fine, unless somebody screams that it is not available on his platform.