All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Jakub Narębski" <jnareb@gmail.com>
Cc: David Aguilar <davvid@gmail.com>,
	git@vger.kernel.org, Sergio Ferrero <sferrero@ensoftcorp.com>,
	Charles Bailey <charles@hashpling.org>
Subject: Re: [PATCH v2] mergetool: use more conservative temporary filenames
Date: Fri, 10 Oct 2014 14:16:43 -0700	[thread overview]
Message-ID: <xmqq38av62x0.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <5437C0CC.7030102@gmail.com> ("Jakub Narębski"'s message of "Fri, 10 Oct 2014 13:19:40 +0200")

Jakub Narębski <jnareb@gmail.com> writes:

> Why use expr and not POSIX shell parameter substitution?
>
> BASE=${MERGED%.*}
> ext=.${MERGED##*.}
>
> Or something like that...

Because they are insufficient.  See David's illustrations for how.

Parameter expansion (e.g. ${parameter%word}) is fine for the
simplest cases (e.g. you know there is .c suffix to the $string and
want to strip it out) but not sufficient for other cases (e.g. you
may not even know if there is any suffix).  You can deconstruct your
regexps manually and use conditional if/else/fi if you are unable to
use expr, but I do not see how it buys us anything.

  parent reply	other threads:[~2014-10-10 21:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-10  8:19 [PATCH v2] mergetool: use more conservative temporary filenames David Aguilar
2014-10-10 11:19 ` Jakub Narębski
2014-10-10 18:48   ` David Aguilar
2014-10-10 19:54     ` Johannes Sixt
2014-10-10 21:16   ` Junio C Hamano [this message]
2014-10-13 19:30 ` Junio C Hamano

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=xmqq38av62x0.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=charles@hashpling.org \
    --cc=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jnareb@gmail.com \
    --cc=sferrero@ensoftcorp.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.