Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Revert #86 and #111 #114

Merged
merged 3 commits into from
Feb 17, 2014
Merged

Revert #86 and #111 #114

merged 3 commits into from
Feb 17, 2014

Conversation

dscho
Copy link
Member

@dscho dscho commented Jan 9, 2014

This maintainer merged the pull request in a bit of a rash rush. This pull request is meant to allow us to restart the process of fixing the problem #86 tried to fix: overly long submodule paths.

dscho and others added 3 commits January 8, 2014 20:24
This reverts commit b08b38a, reversing
changes made to bac2422.
This reverts commit bac2422, reversing
changes made to ac03519.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho
Copy link
Member Author

dscho commented Jan 9, 2014

@vangdfang if you don't mind, I'd like to start again, from this pull request. @kblees could you have a look, in particular at the test case so that we all agree what this pull request is supposed to fix eventually?

@buildhive
Copy link

MSysGit - the development behind Git for Windows » git #162 SUCCESS
This pull request looks good
(what's this?)

@@ -0,0 +1,101 @@
#!/bin/sh
#
# Copyright (c) 2013 Doug Kelly

Choose a reason for hiding this comment

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

I'm an idiot. The year is 2014 now.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hehe... You probably wrote it in 2013.

Choose a reason for hiding this comment

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

Actually, no, I just came up with the testcase yesterday. :( I just haven't admitted to myself it's the new year yet.

@vangdfang
Copy link

I'd prefer not going this route, but understand if you're trying to get a new 1.8.5 release out the door. I've been tossing other ideas around in my head all night, but I simply can't come up with anything much better, so the solution would still remain the same.

@dscho
Copy link
Member Author

dscho commented Jan 9, 2014

@vangdfang the idea of a restart would be to be able to address the fundamental issues with #86 rather than patching up after it... (keeping in mind that we actually want to come up with a clean topic branch in https://github.com/msysgit/git that we can contribute upstream).

done
# Pick a substring maximum of 90 characters
# This should be good, since we'll add on a lot for temp directories
export longpath=${longpath:0:90}

Choose a reason for hiding this comment

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

Also just noticed in CodingGuidelines this substring syntax is not preferred.

Copy link
Member Author

Choose a reason for hiding this comment

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

Easily fixed by export longpath="$(echo "$longpath" | cut -c 1-90)". The problem is that only bash understands this syntax.

In related news, I think that the whole block might gain readability by replacing with

string45=0123456789abcdefghijklmnoprstuvwxyz0123456789
longpath=$longpath$longpath

Copy link
Member Author

Choose a reason for hiding this comment

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

Also: why 90? That is too arbitrary a number without any further explanation.

Choose a reason for hiding this comment

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

I'm a fan of the second you proposed. The number 90 came out because you have to stay under 260 with total path length, and after c:\msysgit\git\t\trash directory.t7410-submodule-long-path\ -- you've already got a lot of length used. 90 (just from testing) happened to be a pretty good number to compensate for this. I suppose this test could be marked for msysgit only (and then the length of pwd -W could be subtracted to find available length), but there's also some value on other platforms to the test (just maybe not as much in its current form).

I'm seeing more layers to this problem as I look beyond the mingw porting layer, since large portions of Git use PATH_MAX as the size of a stack variable to store paths (and sometimes, there's additional space reserved for other characters -- in path.c, there's even an extra 100 character padding reserved with submodules, which could easily explain why this so quickly hits the path limit -- you get bad_path arbitrarily early). Other places use strbufs to hold the path, and just assign PATH_MAX for a default size. Ultimately, I think the "correct" fix is to use strbuf more liberally, as this could increase the path length limit arbitrarily, even on other platforms (such as GNU/Hurd, which doesn't have a maximum path length) -- basically, http://insanecoding.blogspot.com/2007/11/pathmax-simply-isnt.html seems to be rather relevant in this scenario. Also, I think this may be more palatable to the upstream maintainers, since it's not just a one-off Windows fix, but an enhancement for all platforms. I know you and the other commenters are also actively involved in upstream development, so certainly, your opinions on this matter are welcome. But, in terms of working towards the ultimate goal of how to achieve long file support in Windows, this seems like the best step forward.

@dscho dscho mentioned this pull request Feb 7, 2014
@kblees kblees mentioned this pull request Feb 8, 2014
@dscho dscho merged commit 178ef20 into master Feb 17, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants