{"thread":{"id":"53605","subject":"Questions about Git-Gui Makefile and GNU File Name and Text Functions","startedAt":"2020-06-03T07:56:32Z","lastAt":"2020-06-03T15:20:15Z","messageCount":2,"participants":["Edua Vioz","Paul Smith"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"399069","messageId":"CAGiZ90kHSZEjw2ApU4kyGqCCH0KJS2Fe1mbvkJy4W2YKXs_-=w@mail.gmail.com","threadId":"53605","inReplyTo":null,"subject":"Questions about Git-Gui Makefile and GNU File Name and Text Functions","fromName":"Edua Vioz","fromEmail":"eltipejoloco@gmail.com","sentAt":"2020-06-03T07:56:14Z","receivedAt":"2020-06-03T07:56:32Z","isPatch":false,"sender":{"key":"eltipejoloco@gmail.com","avatar":null},"body":"Hey all,\n\nSorry to bother you for something that might turn out to be trivial,\nbut I'm curious as to something I experienced when building git-gui\nwith its current master branch's Makefile via Git Bash on Windows.\n\nEssentially, the DEST value appeared to have suddenly changed\nmid-installation: It omitted the word \"Program\" from \"Program Files\"\nand failed to eliminate \"libexec\" from the target directory it ended\nup writing to (judging from the files installed by Git for Windows'\ninstaller, I assume it should be trying to place the share folder and\nits contents in the mingw64 folder). I've been poring over the\nMakefile trying to figure out the problem, and I have a few questions\n(aside from wishing to see some sort of public Regex-like sandbox tool\nsometime in the future that would let people preview the outcomes of\nFile Name and Text Functions fed to them):\n\nWould the outcome of $(dir C:/Program\nFiles/Git/mingw64/libexec/git-core) be \"C:/Program\nFiles/Git/mingw64/libexec/\" or \"C:/ Files/Git/mingw64/libexec/\"? If\nthe latter, is there no way for the $(dir) File Name function to be\ntold to respect white-spaces in files' directories? The way the Git\nGui Makefile is set up, it's already passing the git --exec-path as a\ndefined variable, so I'm guessing doing that's a no go. Is there a\ntext function that can actually detect white spaces and substitute\nthem in and out for ?\\s for the sake of other functions that need\nthem, for example?\n\nAdditionally, would $(notdir C:/Program\nFiles/Git/mingw64/libexec/git-core) result in \"Program git-core\"?\nWhich would then cause an ifeq against \"git-core\" to fail? Should I\nhave been more panicked if the above code had actually let files be\ninstalled to \"C:Program\nFiles/Git/mingw64/libexec/git-core/share/git-gui/lib\"?\n\nI'm not really asking for a solution for myself: I'm pretty sure I can\njust change the Makefile so that I can successfully build Git Gui. I'm\njust curious if it's just been this long since a Windows user decided\nto take \"you just need the dependencies installed and then you can\nmake install\" on the README.md at face value, did so, and then\nrealized \"oh, wait, I can't just do that.\"\n\nAnyway, cheers all. I hope you're well, and I look forward to maybe\nhearing from you.\n\n~ ElTipejoLoco\n"},{"id":"399077","messageId":"c931a1a5bf041057fa75febf6c05b7435ce27881.camel@mad-scientist.net","threadId":"53605","inReplyTo":"CAGiZ90kHSZEjw2ApU4kyGqCCH0KJS2Fe1mbvkJy4W2YKXs_-=w@mail.gmail.com","subject":"Re: Questions about Git-Gui Makefile and GNU File Name and Text Functions","fromName":"Paul Smith","fromEmail":"paul@mad-scientist.net","sentAt":"2020-06-03T14:34:06Z","receivedAt":"2020-06-03T15:20:15Z","isPatch":false,"sender":{"key":"paul@mad-scientist.net","avatar":"https://avatars.githubusercontent.com/u/109636?v=4"},"body":"On Wed, 2020-06-03 at 02:56 -0500, Edua Vioz wrote:\n> Would the outcome of $(dir C:/Program\n> Files/Git/mingw64/libexec/git-core) be \"C:/Program\n> Files/Git/mingw64/libexec/\" or \"C:/ Files/Git/mingw64/libexec/\"?\n\nI'm not super-familiar with the Git build system so maybe there are\nmitigations for this there but: GNU make always treats whitespace as a\nword separator so it will apply the \"dir\" function to each word.  So:\n\n  $(dir C:/Program Files/Git/mingw64/libexec/git-core)\n\nis equivalent to writing:\n\n  $(dir C:/Program) $(dir Files/Git/mingw64/libexec/git-core)\n\nand the expected result is:\n\n  C:/ Files/Git/mingw64/libexec\n\n> If the latter, is there no way for the $(dir) File Name function to\n> be told to respect white-spaces in files' directories?\n\nNo.  Make in general, and GNU make in particular, doesn't expect to be\ngiven paths with whitespace in them.\n\nAgain I'm not an expert in the Git build system but my understanding is\nthat the install can be relocatable: in that case I recommend you build\nit into a location where there is no whitespace in the path, then move\nit wherever you like after building.\n\n> Additionally, would $(notdir C:/Program\n> Files/Git/mingw64/libexec/git-core) result in \"Program git-core\"?\n\nYes.  All GNU make functions work the same way.\n\n"}]}