Strange behavior (possible bug) using bash command subsitution with "git branch"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]