git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Strange behavior (possible bug) using bash command subsitution with "git branch"
@ 2009-11-08 22:11 Kate Ebneter
  2009-11-08 22:46 ` Sverre Rabbelier
  2009-11-08 22:49 ` Björn Steinbrink
  0 siblings, 2 replies; 6+ messages in thread
From: Kate Ebneter @ 2009-11-08 22:11 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-11-08 23:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).