Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 task done
ColMelvin opened this issue Mar 31, 2018 · 4 comments
Closed
1 task done

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

ColMelvin opened this issue Mar 31, 2018 · 4 comments

Comments

@ColMelvin
Copy link

  • 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

ColMelvin added a commit to ColMelvin/git that referenced this issue Jul 5, 2018
Replace the legacy TIEHANDLE used to fake out a pipe and replace it with
real pipes.  As modern Perl seems to handle these simple pipes well, the
need for a special-case object has evaporated.

As a consequence of this change, input pipes are now supported.

Closes: git-for-windows#1603
Signed-off-by: Chris Lindee <[email protected]>
ColMelvin added a commit to ColMelvin/git that referenced this issue Oct 15, 2018
Replace the legacy TIEHANDLE used to fake out a pipe and replace it with
real pipes.  As modern Perl seems to handle these simple pipes well, the
need for a special-case object has evaporated.

As a consequence of this change, input pipes are now supported.

Closes: git-for-windows#1603
Signed-off-by: Chris Lindee <[email protected]>
@dscho
Copy link
Member

dscho commented Oct 13, 2019

I guess this problem is no longer important?

@ColMelvin
Copy link
Author

The bug causes an issue on one of my projects in a very limited setting and I fixed it in pull request #1604 .

I'm not sure the deficiency itself is of "great significance or value" (though, I would argue, making a record of it is important). However, with a cheap fix in hand, the cost/benefit ratio seems favorable.

@dscho
Copy link
Member

dscho commented Oct 14, 2019

Sorry that I missed the update to #1604. Please do feel free to ping me when you think I have lost track. Thank you in advance!

@ColMelvin
Copy link
Author

I honestly forgot myself. Thank you for bringing this back to my attention

@dscho dscho closed this as completed Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants