All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kate Ebneter <kate@ning.com>
To: <git@vger.kernel.org>
Subject: Strange behavior (possible bug) using bash command subsitution with "git branch"
Date: Sun, 08 Nov 2009 14:11:56 -0800	[thread overview]
Message-ID: <C71C822C.22429%kate@ning.com> (raw)

Hi, folks,

I ran into a weird situation while working on a script, which is best
described with a little snippet from my gitosis-admin repository:

    $ git branch
    * master
    $ branch=$(git branch)
    $ echo $branch
    gitosis.conf keydir master


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.

I can reproduce this on CentOS, Ubuntu, Solaris, and Mac OS X using git
1.6.2.3, 1.6.3.2, 1.6.3.3, 1.6.4.2, and 1.6.5.2.

(In the end, I figured out a better way to write my script anyway, but this
is just too weird not to ask about.)

Thanks,
Kate Ebneter
Somewhat befuddled build engineer

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

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-08 22:11 Kate Ebneter [this message]
2009-11-08 22:46 ` Strange behavior (possible bug) using bash command subsitution with "git branch" Sverre Rabbelier
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=C71C822C.22429%kate@ning.com \
    --to=kate@ning.com \
    --cc=git@vger.kernel.org \
    /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.