From: Junio C Hamano <gitster@pobox.com>
To: "SZEDER Gábor" <szeder@ira.uka.de>
Cc: "Shawn O. Pearce" <spearce@spearce.org>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>,
Eric Raible <raible@gmail.com>,
Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] bash: offer only paths after '--'
Date: Tue, 08 Jul 2008 17:06:43 -0700 [thread overview]
Message-ID: <7vprpnq5t8.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <20080708235153.GD8224@neumann> (SZEDER Gábor's message of "Wed, 9 Jul 2008 01:51:53 +0200")
SZEDER Gábor <szeder@ira.uka.de> writes:
> On Tue, Jul 08, 2008 at 11:18:37PM +0000, Shawn O. Pearce wrote:
>> Junio C Hamano <gitster@pobox.com> wrote:
>> > SZEDER Gábor <szeder@ira.uka.de> writes:
>> > > + c=$((++c))
>> >
>> > This assignment is somewhat curious, although it should work as expected
>> > either way ;-)
> ...
> Maybe an old C++ "heritage"? In C++ it matters for class types (e.g.
> iterators), because the postfix operator might be slower than the
> prefix.
Heh, I was not talking about prefix vs postfix but about the assignment
into the variable that is incremented as a side effect of evaluating the
left hand side. If you know the variable is incremented already there is
no point in assigning the resulting value to it ;-)
c=$(( $c + 1 ))
would have avoided such an uneasy feeling, and would have been more
portable. Even though $((x)) and $(($x)) are supposed to evaluate the
same, some shells do not like dollar-less variable names in arithmetic
expansion, and prefix/postfix increment/decrement are not required to be
supported by POSIX.
But this script being bash completion, we can use as much bashism as we
want here; perhaps I would have written:
: $((c++))
prev parent reply other threads:[~2008-07-09 0:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-07 20:41 [PATCH] completion: add branch options --contains --merged --no-merged Eric Raible
2008-07-08 4:49 ` Shawn O. Pearce
2008-07-08 5:30 ` Junio C Hamano
2008-07-08 11:36 ` Johannes Schindelin
2008-07-08 16:56 ` [PATCH] bash: offer only paths after '--' SZEDER Gábor
2008-07-08 17:46 ` Eric Raible
2008-07-08 20:21 ` Junio C Hamano
2008-07-08 23:18 ` Shawn O. Pearce
2008-07-08 23:23 ` Junio C Hamano
2008-07-08 23:51 ` SZEDER Gábor
2008-07-08 23:55 ` Shawn O. Pearce
2008-07-09 0:06 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vprpnq5t8.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=raible@gmail.com \
--cc=spearce@spearce.org \
--cc=szeder@ira.uka.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).