git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sverre Rabbelier <srabbelier@gmail.com>
To: Kate Ebneter <kate@ning.com>
Cc: git@vger.kernel.org
Subject: Re: Strange behavior (possible bug) using bash command subsitution  with "git branch"
Date: Sun, 8 Nov 2009 23:46:33 +0100	[thread overview]
Message-ID: <fabb9a1e0911081446o7793eef1kcbad964c9a73edda@mail.gmail.com> (raw)
In-Reply-To: <C71C822C.22429%kate@ning.com>

Heya

On Sun, Nov 8, 2009 at 23:11, Kate Ebneter <kate@ning.com> wrote:
> That is, if you run 'git branch' inside $() or ``, it lists the directories,
> too. I can't imagine that this is intended behavior, but perhaps I'm wrong.

Try enclosing it in quotes ;).

That is, compare:
$ echo "`git branch`"
with
$ echo `git branch`

The kicker is that there's a * in the output of git branch, which your
shell helpfully substitutes with the contents of your current
directory :).

-- 
Cheers,

Sverre Rabbelier

  reply	other threads:[~2009-11-08 22:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-08 22:11 Strange behavior (possible bug) using bash command subsitution with "git branch" Kate Ebneter
2009-11-08 22:46 ` Sverre Rabbelier [this message]
2009-11-08 22:50   ` Kate Ebneter
2009-11-08 22:49 ` Björn Steinbrink
2009-11-08 23:03   ` Jeff King
2009-11-08 23:10     ` Kate Ebneter

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=fabb9a1e0911081446o7793eef1kcbad964c9a73edda@mail.gmail.com \
    --to=srabbelier@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=kate@ning.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 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).