Git Push a Local PodSpec - ios

I am currently trying iOS developing on my own and my project has now become quite large, so i want to git push to github just in case i screw up.
However, as i tried to git push, it always gives this
"large files are detected, File Pods/nighthawk-webrtc/lib/libWebRTC-8444-arm-intel-Release.a is 118.31 MB; this exceeds GitHub's file size limit of 100.00 MB"..
It is the local "nighthawk-webrtc-8444.podspec" that i have causes the problem.
I sort of thought it may have to do with the .gitignore file, because i include the PODS for push, so i have my .gitignore written as this
# Xcode
.DS_Store
*/build/*
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
profile
*.moved-aside
DerivedData
.idea/
*.hmap
*.xccheckout
#CocoaPods
Pods
to exclude the Pods library. However it doesn't work. It still trying to git push the entire local nighthawk-webrtc-library to github and i still end up with the same error.
This nighthawk-webrtc-library is a pod spec created by a third part, when i run pod spec lint, it gives me the following validation errors:
-> nighthawk-webrtc (8444)
- ERROR | The name of the spec should match the name of the file.
- WARN | There was a problem validating the URL www.perch.co.
which i do not have idea whether it has anything to do with git push, but even if it has, i can't seem to edit it.
To be just clear: I wish to git push the local pod spec to the github, but i do not wish to git push the entire library like what the system is currently doing. Anyway to fix this?
Thanks a lot.

Although the files are git ignored, I'd bet you a dollar that you need to remove them from the local git, and them commit AND push that. Ignore changes are NOT RETRO-ACTIVE, i.e. if a file was added you need to remove it.
Drop to a shell and type:
git rm <FILE(S)>
OR use SourceTree/Tower or whatever you prefer

Related

DVTSourceControlGitXPCClient crash on Xcode 14

Since a few days ago, I've been experiencing a repetitive crash on Xcode every 3-8 minutes.
The only tangible thing I can find in the crash logs is that it always shows:
Crashed Thread: Dispatch queue: DVTSourceControlGitXPCClient :: Proxy Completion Queue
It seems to be Source Control related, but I wonder how?
I will add everything related to my current project in case it is relevant:
Xcode 14.2 (14C18)
Using Source Control with GitHub
Swift targets iOS and macOS
SPM
It seems like some folks are experiencing a similar issue, as seen on the Developer Forums
Any leads as to why or how to solve it?
After some struggling I decided to check how was git doing, directly from the Terminal.
It turns out there were some things that didn't make sense, specifically a file I deleted from my project but then added again, was showing as modified, even though I had already committed all changes for that file a few days ago; but I had done it directly from Xcode Source Control.
From the Terminal, I staged all changes and committed them. Since then Xcode hasn't crashed for a few hours yet.
My limited understanding of the problem points out that Xcode had issues staging those changes I made a few days ago, and since then the repository has not been in a "healthy state"; Xcode tries somehow to understand the state of the repository but after a while, it just crashes.
Common scenarios where this could have happened:
A file was deleted
A file was renamed, specially with case-sensitive renames, for example from MyViewcontroller.swift to MyViewController.swift
The solution for me was to just put it back in a "healthy state", aka make a commit directly from the Terminal.
Example
From the Terminal
# navigate to the directory of your repository
$ cd /someFolder/myProjectApp
$ git status
# check that you get "nothing to commit"
# or if there are changes they should make sense
# if some changes do not make sense
# try staging and committing everything
# example:
$ git add .
$ git commit -m "Cleaning state"

Go modules pulls old version of a package

I'm trying to add a new package to my project with go modules. This package is using github.com/docker/docker/client and works fine outside of the project. When I run go mod vendor it pulls docker client package of version v1.13.1 which does not have some of the methods I am using in my code, but in go modules it is tagged as latest. How do I make go mod use the truly latest version of a package?
Go Wiki: Modules:
When needed, more specific versions of dependencies can be chosen with commands such as go get foo#v1.2.3, go get foo#master, go get foo#e3702bed2, or by editing go.mod directly.
If you need the latest commit on the master branch, use
go get github.com/docker/docker/client#master
This was driving me insane, too: Downloading the "master" or "latest" tag would often download versions one or two commits before HEAD. I found the answer here:
The go command defaults to downloading modules from the public Go
module mirror at proxy.golang.org. It also defaults to validating
downloaded modules, regardless of source, against the public Go
checksum database at sum.golang.org. These defaults work well for
publicly available source code.
And apparently there is some caching going on; if you wait a while it usually starts to work, alternatively it helps to temporarily set the version to a specific commit.
To fix it, I set GOPRIVATE=github.com/myuser.
In order to get the latest un-tagged version, you need to specify the commit tag you want to have when doing go get
go get github.com/docker/docker/client#[commit-hash]
Would recommend using a specific version (preferred tagged version, if not latest pseudo version instead of master). Having dependency versions locked down in the go.mod file ensures repeatability.
The latest version available in one of the go proxies is https://search.gocenter.io/github.com~2Fdocker~2Fdocker/info?version=v1.14.0-0.20190511020111-3998dffb806f
Spent the last 20 hours trying to fix a similar problem, in my case, the following steps solved the problem:
delete $GOPATH/pkg/sumdb
delete the go.mod and go.sum files
recreate the module: go mod init name
go test ./...
My circumstances don't align perfectly with the original question, but I feel it may be worth mentioning to help others in situations similar to mine:
Context
Was working with private modules, i.e., a Go module hosted from private git repository.
Access to the private repo was not an issue.
Would make and push changes to the private module.
A program that imported the private module would consistently pull an old version when running go get, even after running:
go clean -modcache
rm go.sum
go get
go mod tidy
Root Cause: I'm an Idiot
I had forgotten that Go uses VCS tagging with versioning.
Failed to update the tag to match the current commit.
The Fix
The version wasn't ready to be bumped (learning, here), so, in the private module, I ran the following command to align the version with the current commit:
Note: This assumes that all repo content has been staged/committed/pushed.
In the private module repo
git tag -d v0.0.0
git push --delete v0.0.0
git tag v0.0.0
git push origin v0.0.0
In the repo that was importing the private repo
go clean -modcache
rm go.sum
go get
go mod tidy

Gerrit version 2.14.4 online reindexing stuck

How do i know that online reindexing is done ?
I had a repository with name datadelivery-feed-tcp-c++ which I moved to datadelivery-feed-tcp-cpp and deleted the datadelivery-feed-tcp-c++ repository.
But On kicking online reindexing it gives a lot of below warning.It is stuck at this warning.
[2017-09-28 07:00:27,300] [Index-Batch-3] WARN com.google.gerrit.server.index.change.StalenessChecker : error checking staleness of 8737 in datadelivery-feed-tcp-c%252B%252B
org.eclipse.jgit.errors.RepositoryNotFoundException: repository not found: Invalid name: datadelivery-feed-tcp-c%252B%252B
I have tried flushing cache also
ssh -p 29418 host gerrit flush-caches --all
How do I resolve it ?
EDIT : By renaming a repo I meant, I have cloned it and imported all the data into other project, verified it and then removed it using delete project plugin
I think you already had changes in the datadelivery-feed-tcp-c++ repository and you just renamed it at the filesystem, correct? You can't do that because you need to adjust the database data accordingly. The better way to rename a repository is doing the following:
1) Clone the original repository (with all existing changes) creating a new one with the new name. Use the importer plugin to do that.
2) Remove the original repository (and all related changes). Use the delete-project plugin to do that.
Notes:
i) In your current case, first rename the repository back to the original name at the filesystem.
ii) You can download the plugins here.

Cannot commit - messed up my sourceCode control, how to fix it?

Hello fellow programmers,
I accidentally added my whole project to my project, not once, but twice, as I was looking for another functionality. Since the folders didn't show up in Xcode itself, I went to Finder and deleted them manually from the filesystem again (so far so good, since I got all warning 4x).
But now, when I want to commit changes to the sourceCode control, I get this error:
fatal: Could not switch to '/Users/myID/Developer/iOS/ProjectName/ProjectName/ProjectName': No such file or directory
I have pretty much no clue what to do, has anyone ever had such a problem? Cleaning the project does not help, that's all I could think off, as I'm not that experienced!
Help I HIGHLY appreciated!
PS: I'm running Xcode 4.3.2 on OSX 10.7.4
For something as serious as this I would create a new git repo, starting from the commit revision before the screw-up.
Assume your code is in ~/Source/MyProject.
First you are going to need the commit revision before the screw-up. You can get his from the command line using git log or better still you can use the excellent (and free) SourceTree Mac App. Lets assume it's 62a6614fb55d692cd5a6e251cc05dea45d9668fe.
Next start a new repo: $ mkdir ~/Source/MyProjectNew; cd ~/Source/MyProject/New; git init.
Add the old project as the 'remote origin' of the new project: $ git remote add origin ~/Source/MyProject.
Fetch the pre-screwed code: $ git fetch origin 62a6614fb55d692cd5a6e251cc05dea45d9668fe.
Reset the master branch to the pre-screwed commit: $ git reset --hard FETCH_HEAD.
Remove the origin: $ git remote rm origin.
You now have a new repo without the screwed-up code. You need to rename the old and new repo and carry on with your life.

Github and Non-Ignoring files in the .gitignore

I had a file I needed to edit in my .gitignore file.
I edited .gitignore, committed it, and still my file was unavailable to commit.
I deleted the file, readded it, and once it has the same name, its still unavailable to commit.
I tried -f, which then added an empty version of the file to my repository. And the worst apart about that is that if I deployed, it would break my entire application at this point.
Update:
The file I want to add is :
public/javascripts/ckeditor/config.js
my .gitignore file says :
public/stylesheets/*.css
*.swp
*.pid
.idea
config/database.yml
log/*.log
db/*.sqlite3
tmp/**/*
doc/api
doc/app
doc/plugins
public/system/*
coverage.data
coverage/*
.DS_STORE
.DS_Store
solr/data/**/*
solr/pids/**/*
config/initializers/mail_delivery_override.rb
Git status reveals this :
# On branch testing
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: public/javascripts/ckcustom.js
#
no changes added to commit (use "git add" and/or "git commit -a")
That ckcustom.js is a compiled file form the ckeditor suite that is made by other changes. But I can't just edit that file, I had to edit its inner workings.
Next time try:
git add -f path/to/ignore_file
Ok I'm pretty sure this worked, and this was really strange! Almost lost some dreadlocks over this one.
To begin, I logged in manually into my server, deleted the crappy file git had made. Recreated it, copied and pasted my file back in, and got my server back online.
Then I went to github.com and manually opened, edited, and committed the file right from the online API.
I readded the .gitignore file, and the ckcustom.js file, and the problem seems to be fixed.
Sheesh!

Resources