Open Mark2xv opened 9 years ago
After running synx, the .git folder seems to get destroyed. It is still there, but git does not recognize it as such.
What does this mean exactly? What makes it seem like it was destroyed? What is not working?
The folder is still there, but git does not recognize it as a repository.
Steps taken:
synx /Users/mark/touch/touch.xcodeproj
Wait for it to finish.. Finishes without any errors.
Afterwards, check git status
:
fatal: Not a git repository (or any of the parent directories): .git
I'll check tomorrow what's actually changing in the .git directory to try and figure out what's changing.
That's weird... does it look like anything is missing from .git
?
Yes, some things are definitely missing.
A diff -r touch/.git backupSynxedGit
shows this:
Only in touch/.git: FETCH_HEAD
Only in touch/.git: HEAD
Only in touch/.git: config
Only in touch/.git: index
Only in touch/.git/logs: HEAD
and a whole lot more such as the contents of .git/modules
.
I also spotted this in the output of synx:
Syncing files that are not included in Xcode project..
Localizable.strings/
.git
COMMIT_EDITMSG
config
FETCH_HEAD
HEAD
index
logs
HEAD
refs
heads
develop
feature
-featurenameredacted-
-featurenameredacted-
hotfix
2.5.5
master
remotes
origin
feature
-featurenameredacted-
-featurenameredacted-
HEAD
hotfix
2.5.5
modules
touch
And basically the entire contents of .git. Why is it putting it as if it's 'under' Localizable.strings? It is most surely not located there.
Why not just completely ignore any directory called .git and any file called .gitmodules or .gitignore? I can't think of any circumstance where you would want to change the location of those.
Synx creates another directory in a temporary location on your computer, builds the synced up version of your project there, and then moves it over to replace the original. So, because it works this way, synx can't just ignore things like .git
-- it needs to bring them over to the synced up version.
I've never heard of this issue before, so I'm assuming that there is something unique with the way your project is setup. Mostly people's .git
directory lives alongside their project directory. IE,
└── YourClonedRepo
├── .git
├── YourProject
It seems like yours is more like
└── YourProject
├── .git
which is why Synx needs to tamper with the .git
directory.
As far as why it's not moving your .git
directory correctly, I'm not sure. It doesn't seem like it should be treating it any differently than any other directory. It's hard to diagnose without having the project.
For a number of reasons I can't show you the project, and absolutely under no circumstance share the files themselves. What would you need to try and figure out what's going on?
@Mark2xv Would you be able to create a similar project which can be used to reproduce the issues? Steps to reproduce, or an example project you can run with Synx to reproduce would help figuring out the problem.
what @kylef said
Alright, I'll see if I can recreate the same scenario.
@Mark2xv any luck?
Haven't really had the chance to investigate/reproduce this issue as of yet. I'll try to do so this weekend.
Having a really hard time figuring out what is the cause of this is... None of my reproduction cases seem to have any effect.
On a sidenote: I noticed that in another issue (#65) that the -e option does not do what I thought it does. Not that it has/had any effect though, including exclusion options or not, it still seems to delete roughly 2/3rds of my folders contents. (Goes from 550MB to 200MB).
Is there no way of making sure it absolutely ignores any folder that is a submodule? So that it completely copies it over, exactly as it was, to the newly synced folder?
I have the same issue. I'm still trying to figure this one out and came here to see if anybody as the same problem.
I haven't had much time lately to try and figure out what's causing all of this. Unfortunately, I can not give any more information regarding our project structure either...
I really hope this issue will get solved as this would save a lot of time!
Managed to get this to reproduce reliably, after a particularly terrifying afternoon.
Works with XCode Version 7.2 (7C68)
@nunogoncalves @Mark2xv I guess it's been a long time since you guys have had this problem, but just FYI it seemed to work for me after this: I moved the offending files out of the project structure, removed references in XCode, then dragged them into the project and let xcode put them wherever it wants.
Thanks for the info @jonzhan . On a company project I was doing also had translations (therefor the Base.lproj folder). In that project I always remove the .git files before I run synx. This is dangerous because it's not automated, and I guess it's just a matter of time before I make a wrong copy paste and have to checkout the whole project all over again :)
I am facing the same problem. I tried the code of https://github.com/venmo/synx/pull/104 but I couldn't resolve the problem.
Any news on this? I'm having the same problem
Is this project still maintained? This is still an issue.
Burned up my .git
directory as well 👎 In the log I can definitely see synx
handling .git
folder. Why on earth should it do that? I think all hidden directories (aka, starts with a .
) should be ignored.
Plus, the Pods
directory...
Well, there should be an option to let me decide which directories to ignore altogether -- not just only an option to ignore groups.
Since I don't know Ruby, I opted to fix these issues using a shell script. You can grab a copy here:
https://gist.github.com/noordawod/ea1a5fc1fb5654fcba509f6e5862a4eb
After running synx, the .git folder seems to get destroyed. It is still there, but git does not recognize it as such. I do not get any error messages during the run.
This is a rough distribution of our product, as seen in XCode:
This is roughly how it is reflected in filesystem: