Don't use absolute paths (Cygwin workaround)#22
Conversation
They break when Cygwin is mixing both unix and dos path formats. This creates directories named like dos drives, like C:, and removing them in Cygwin results in "rm -rf C:/" which is not nice. Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
|
I'm afraid this change would break things. For example, I don't see why |
|
Well, . is a valid path name. IMO, all scripts which take path names as input should use the same paths without mangling or cleaning them up. Just use them as they come. That way failure modes are easy to understand for the user who supplied the path name. In my case CMake generates makefiles in Windows which contain cygwin&Windows compatible path names. These paths are then fed to tools like gitstats. I've had fix a number of python scripts to get rid of abspath, but yes, cygwin&python case is a bit special compared to standard unix behaviour. |
|
If I remember right, those abspath calls are there for a reason. Another thing is, gitstats uses What kind of pathnames does cmake generate? Is Cygwin the only option for running gitstats on Windows (I think someone used msysgit in the past, I personally don't have a Windows box so I have no clue)? |
|
IMO there's no way to infer a project name correctly from a git tree unless .git/description has been set, and even that might not be a single word name. I would never convert user supplied paths to absolute ones. I'd just use the provided path name and fail on errors. CMake is generating paths like c:/temp when using the "Unix Makefiles" generator on Windows. All GNU make versions on Windows, cygwin and native Windows tools that I've used work with these path names which are already absolute. I posted a question also to cygwin list: |
|
As you posted on the mailing list, python behavior seems odd on Cygwin, more so in comparison to perl. I think it would be better that the actual problem is fixed (unexpected behavior of I'll leave this issue open for now, in case anyone else runs into the problem. |
They break when Cygwin is mixing both unix and dos path formats.
This creates directories named like dos drives, like C:, and
removing them in Cygwin results in "rm -rf C:/" which is not nice.
Signed-off-by: Mikko Rapeli mikko.rapeli@iki.fi