From: Benoit Sigoure Date: Fri, 09 Nov 2007 09:07:47 GMT Subject: Re: [BUG] git-rebase fails when a commit message contains a diff Message-ID: <87747E02-0C25-4330-84F4-1C56C0196BD5@lrde.epita.fr> In-Reply-To: <473420FE.7010807@viscovery.net> On Nov 9, 2007, at 9:57 AM, Johannes Sixt wrote: > Benoit Sigoure schrieb: >> Off topic question: why do you guys always do this instead of >> doing, say, this: >> INTERACTIVE=false >> case $1 in >> --interactive|-i) >> INTERACTIVE=: >> ... ;; >> esac >> if $INTERACTIVE; then >> git_editor "$TODO" || die ... >> fi > > Because in some shells 'false' is not a built-in. Can you name such a shell? (besides Solaris' brain-damaged, b0rken and foobared /bin/sh which will most likely not work with Git anyway) > But then this might do it without the extra process: > > INTERACTIVE="! :" # false `!' is not portable either. In particular, I highly doubt `!' will work on shells that don't have `false' as a builtin (Hello Mr Solaris). > > case $1 in > --interactive|-i) > INTERACTIVE=: > ... ;; > esac > if $INTERACTIVE; then > git_editor "$TODO" || die ... > fi Correct me if I'm wrong but I think that some shells don't have `test' as a builtin either. -- Benoit Sigoure aka Tsuna EPITA Research and Development Laboratory