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

mingw: allow for longer paths in parse_interpreter() #3165

Conversation

dscho
Copy link
Member

@dscho dscho commented Apr 2, 2021

As reported in newren/git-filter-repo#225, it looks like 99 bytes is not really sufficient to represent e.g. the full path to Python when installed via Windows Store (and this path is used in the hasb bang line when installing scripts via pip).

Let's increase it to what is probably the maximum sensible path size: 248 (the same as for CreateDirectory()).

As reported in newren/git-filter-repo#225, it
looks like 99 bytes is not really sufficient to represent e.g. the full
path to Python when installed via Windows Store (and this path is used
in the hasb bang line when installing scripts via `pip`).

Let's increase it to what is probably the maximum sensible path size:
248 (the same as for `CreateDirectory()`).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Copy link

@derrickstolee derrickstolee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arbitrary limits are dangerous, but it seems you have a similar limit elsewhere.

Copy link

@newren newren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet, thanks for digging in to this!

@dscho dscho merged commit b2eee59 into git-for-windows:main Apr 3, 2021
@dscho dscho added this to the Next release milestone Apr 3, 2021
git-for-windows-ci pushed a commit that referenced this pull request Apr 3, 2021
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Apr 3, 2021
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Apr 3, 2021
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
@ViliusS
Copy link

ViliusS commented Apr 3, 2021

Good fix! Since Git for Windows has long path support why not increase this to MAX_PATH or even MAX_LONG_PATH?

EDIT: at least make it in-line with code below

char path[MAX_PATH];

@dscho dscho deleted the increase-allowed-length-of-interpreter-path branch April 3, 2021 18:57
@dscho
Copy link
Member Author

dscho commented Apr 3, 2021

Good fix! Since Git for Windows has long path support why not increase this to MAX_PATH or even MAX_LONG_PATH?

EDIT: at least make it in-line with code below

char path[MAX_PATH];

Sure, go ahead!

git-for-windows-ci pushed a commit that referenced this pull request Apr 4, 2021
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Apr 4, 2021
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Apr 4, 2021
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Apr 4, 2021
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Apr 4, 2021
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Apr 4, 2021
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Apr 6, 2021
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Apr 6, 2021
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Apr 6, 2021
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Apr 6, 2021
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Apr 6, 2021
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Apr 7, 2021
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Apr 7, 2021
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
dscho added a commit that referenced this pull request Apr 7, 2021
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Apr 7, 2021
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Apr 8, 2021
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
dscho added a commit that referenced this pull request Apr 8, 2021
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Jun 12, 2024
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Jun 12, 2024
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Jun 12, 2024
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Jun 13, 2024
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Jun 13, 2024
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Jun 13, 2024
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Jun 14, 2024
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Jun 14, 2024
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Jun 14, 2024
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Jun 14, 2024
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Jun 14, 2024
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Jun 17, 2024
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Jun 17, 2024
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Jun 17, 2024
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Jun 18, 2024
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Jun 18, 2024
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Jun 20, 2024
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Jun 20, 2024
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Jun 20, 2024
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Jun 20, 2024
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Jun 21, 2024
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Jun 21, 2024
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Jun 21, 2024
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Jun 21, 2024
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Jun 22, 2024
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Jun 22, 2024
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Jun 23, 2024
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Jun 25, 2024
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Jun 25, 2024
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
git-for-windows-ci pushed a commit that referenced this pull request Jun 25, 2024
…reter-path

mingw: allow for longer paths in `parse_interpreter()`
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

Successfully merging this pull request may close these issues.

None yet

4 participants