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

Environment variable in $PATH was not expanded #5293

Open
1 task done
invegat opened this issue Dec 2, 2024 · 1 comment
Open
1 task done

Environment variable in $PATH was not expanded #5293

invegat opened this issue Dec 2, 2024 · 1 comment
Labels

Comments

@invegat
Copy link

invegat commented Dec 2, 2024

  • 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?

64

$ git --version --build-options
git version 2.47.1.windows.1
cpu: x86_64
built from commit: 2cd22437f64229935dc564db969cbcbfed5e9045
sizeof-long: 4
sizeof-size_t: 8
shell-path: D:/git-sdk-64-build-installers/usr/bin/sh
feature: fsmonitor--daemon
libcurl: 8.11.0
OpenSSL: OpenSSL 3.2.3 3 Sep 2024
zlib: 1.3.1
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?

64 bin Windows 11

$ cmd.exe /c ver

Microsoft Windows [Version 10.0.26100.2454]
(c) Microsoft Corporation.

All right - What options did you set as part of the installation? Or did you choose the
defaults?

defaults

# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
> type "$env:USERPROFILE\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

** insert your machine's response here **
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

** insert your response here **

Details

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

Git Bash

opened Git Bash, my directories in the environment variable $NEWPATH were not expanded

  • What did you expect to occur after running these commands?

For the $NEWPATH environment variable to be expanded in the $PATH

  • What actually happened instead?

$NEWPATH was not expanded, so paths I need were no present

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

** insert URL here **

Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)

opened Git bash

What did you expect to happen? (Expected behavior)

for the environment variable $NEWPATH in $PATH to be expanded

What happened instead? (Actual behavior)

$NEWPATH was not expanded

What's different between what you expected and what actually happened?

I expected the critical $NEWPATH paths to be expanded in the $PATH, it wasn't

Anything else you want to add:

I am running Windows 11 Version 24H2

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.

[System Info]
git version:
git version 2.47.1.windows.1
cpu: x86_64
built from commit: 2cd2243
sizeof-long: 4
sizeof-size_t: 8
shell-path: D:/git-sdk-64-build-installers/usr/bin/sh
feature: fsmonitor--daemon
libcurl: 8.11.0
OpenSSL: OpenSSL 3.2.3 3 Sep 2024
zlib: 1.3.1
uname: Windows 10.0 26100
compiler info: gnuc: 14.2
libc info: no libc information available
$SHELL (typically, interactive shell): C:\Program Files\Git\usr\bin\bash.exe

not run from a git repository - no hooks to show

@dscho
Copy link
Member

dscho commented Dec 2, 2024

Did you mean to imply that your $PATH looks somewhat like this? ...:$NEWPATH:...? If so, that's totally expected, PATH's value is supposed to be used as-is, without interpolating anything.

If you want to add a component to PATH that depends on another environment variable, you will have to do that in your ~/.bash_profile.

@dscho dscho added the question label Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants