FWIW, it seems that this bug was addressed by ddc2a6281595fd24ea01497c496f88c40a59562f Thanks Martin, now we're no longer carrying around an extra patch for our build of git ;) --Jeremy > On Oct 17, 2011, at 14:55, Jeremy Huddleston wrote: > > ping. Did you get my response below with extra details? I just got a duplicate bug report, so it apparently effects people... > > Please let me know if I can be of further assistance. > > On Oct 11, 2011, at 2:17 PM, Jeremy Huddleston wrote: > >> Thanks for your response Junio. The text of the original bug report is below. >> >> I created a git bisect test script which bisected the problem and found out that the difference was that the trailing / was removed by your code change. git treats paths with a trailing / differently. I don't know *why* it treats them differently, but it does. >> >> There's nothing "special" about JustDoItGit.tar.bz2 except that it contains a .git dir and has a file layout that works with the bisect script I wrote. You can test this yourself by: >> >> mkdir -p ~/tmp/PR-10238070 >> cd ~/tmp/PR-10238070 >> tar xjf JustDoItGit.tar.bz2 >> cd ~/git-checkout >> /path/to/test_10238070.sh >> >> Here's the original report: >> >> I've tracked the cause of ' ##snipped title##' down to a regression in git. >> >> Unzip the attached JustDoItGit.zip project and replace the path in the following commands to the unzipped location on your system: >> >> #delete git in /usr/bin/git >> sudo rm -r /usr/bin/git >> #link it to /usr/local/bin/git since that's where ditto will place the new bits >> sudo ln -s /usr/local/bin/git /usr/bin/git >> >> # first, install git 1.7.3.2 to verify that the bug does not reproduce >> sudo ditto ~rc/Software/Slate/Roots/Git/Git-14~19.root/ / >> sudo rm -r /Users//MyGitRepo.gitdir >> git --git-dir=/Users//MyGitRepo.gitdir init --bare --quiet >> git --git-dir=/Users//MyGitRepo.gitdir --work-tree=/ add -- /Users//Desktop/JustDoItGit/ /Users//Desktop/JustDoItGit/JustDoItGit/JustDoItGitAppDelegate.h /Users//Desktop/JustDoItGit/JustDoItGitTests >> git --git-dir=/Users//MyGitRepo.gitdir --work-tree=/ commit -m "Hello." >> >> The expected result of the commit is something like "18 files changed, 7364 insertions". If that's what you get, great, now keep going. >> >> sudo rm -r /Users//MyGitRepo.gitdir >> # install the slate version of git, 1.7.5.4 >> sudo ditto ~rc/Software/Slate/Roots/Git/Git-19.root~2/ / >> sudo rm -r /Users//MyGitRepo.gitdir >> git --git-dir=/Users//MyGitRepo.gitdir init --bare --quiet >> git --git-dir=/Users//MyGitRepo.gitdir --work-tree=/ add -- /Users//Desktop/JustDoItGit/ /Users//Desktop/JustDoItGit/JustDoItGit/JustDoItGitAppDelegate.h /Users//Desktop/JustDoItGit/JustDoItGitTests >> git --git-dir=/Users//MyGitRepo.gitdir --work-tree=/ commit -m "Hello." >> >> The expected result is what's above, something like "18 files changed, 7364 insertions". But the actual result is that only the root folder "/Users//Desktop/JustDoItGit is added >> >> This is a problem because it subsequently causes ##snipped title## >> >> … and therefore breaks Xcode's snapshots feature. >> >> >> >> On Oct 11, 2011, at 10:45, Junio C Hamano wrote: >> >>> Jeremy Huddleston writes: >>> >>>> real_path will strip the trailing / from provided paths. This fixes >>>> a regression introduced in 18e051a3981f38db08521bb61ccf7e4571335353 >>> >>> What is the breakage? The above does not explain why stripping the '/' is >>> a wrong thing, and which caller that used to work is broken by that >>> behaviour. >>> >>> A new test block in some of the t/t[0-9]*.sh script to demonstrate the >>> breakage and fix to explain and justify your fix better, please? >>> >>>> >>>> Signed-off-by: Jeremy Huddleston >>>> --- >>>> >>>> Here's an updated version that should be a bit more portable and warning-free. >>>> >>>> setup.c | 10 +++++++++- >>>> 1 files changed, 9 insertions(+), 1 deletions(-) >>>> >>>> diff --git a/setup.c b/setup.c >>>> index 61c22e6..e3a8ae3 100644 >>>> --- a/setup.c >>>> +++ b/setup.c >>>> @@ -10,8 +10,16 @@ char *prefix_path(const char *prefix, int len, const char *path) >>>> char *sanitized; >>>> if (is_absolute_path(orig)) { >>>> const char *temp = real_path(path); >>>> - sanitized = xmalloc(len + strlen(temp) + 1); >>>> + sanitized = xmalloc(len + strlen(temp) + 2); >>>> strcpy(sanitized, temp); >>>> + >>>> + temp = strrchr(path, '\0'); >>>> + temp--; >>>> + if (*temp == '/') { >>>> + char *s = strrchr(sanitized, '\0'); >>>> + s[0] = '/'; >>>> + s[1] = '\0'; >>>> + } >>>> } else { >>>> sanitized = xmalloc(len + strlen(path) + 1); >>>> if (len) >>> >> >