Skip to content

Perl: Git.pm cannot have two pipes open simultaneously #1603

@ColMelvin

Description

@ColMelvin
  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
    Git for Windows v2.10.2 32-bit
C:\>git --version --build-options
git version 2.10.2.windows.1
sizeof-long: 4
machine: x86
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
    Windows 8.1 64-bit
C:\>cmd /c ver

Microsoft Windows [Version 6.3.9600]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
    IIRC, mostly the defaults, but I selected to add git.exe (but not the commands themselves) to the PATH.
C:\>type "C:\Program Files (x86)\Git\etc\install-options.txt"
Path Option: Cmd
SSH Option: OpenSSH
CRLF Option: CRLFAlways
Bash Terminal Option: ConHost
Performance Tweaks FSCache: Enabled
Enable Symlinks: Disabled
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

None I can think of

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

CMD

C:\example>perl -MGit -e "$fh = Git::command_output_pipe(qw(config -l)); print scalar <$fh>; Git::command(qw(--help)); print <$fh>;"
  • What did you expect to occur after running these commands?

To see a full list of config settings (system & global).

  • What actually happened instead?
core.symlinks=false
Can't use an undefined value as an ARRAY reference at C:/Perl64/site/lib/Git.pm line 1797.

It seems the *Git::ACPIPE glob gets re-used. So, when command closes the tied object, the data ARRAY reference is deleted. Then, the filehandle returned by command_output_pipe is read, but the data ARRAY reference cannot be accessed, so an error occurs.

Thus, it is impossible to run 2 git commands at the same time on Windows.

  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

N/A

  • Workaround

Run in git-bash

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions