Pathogen not loading plugins correctly in Cygwin? - cygwin

I recently discovered how awesome Pathogen is for managing Vim plugins, using the Git submodule approach for keeping plugins up-to-date with Github. You can view my modest dotfiles repo here.
I recently was forced to switch to a Windows development environment from for work, so the first thing I did was a complete install of Cygwin (I had hard drive space to spare and didn't feel like picking and chosing packages).
The problem: With Cygwin installed (using Mintty), I clone my dotfiles repo to ~/. Then I put symlinks in ~/ for .vim, .vimrc, and .bashrc. The .vimrc configuration file is being read in (the options work), but Pathogen isn't correctly loading my Vim plugins.
Forgive my incompetence, but I'm new to Cygwin and I don't fully understand its quirks yet. In any case, the exact same repository works fine under *nix machines. Is there something that I should be doing differently to get it to work under Cygwin?

Ok so I'm an idiot. I didn't realize that you have to do git submodule init and git submodule update after forking the repository as well (I thought you only had to do it on creation / first commit. To be clear, the issue had nothing to do with Cygwin specifically.
Which brings me to my next problem:
$ git submodule update
Cloning into .vim/bundle/nerdcommenter...
error: SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed while accessing https://github.com/scrooloose/nerdcommenter.git/info/refs
fatal: HTTP request failed
Clone of 'https://github.com/scrooloose/nerdcommenter.git' into submodule path '.vim/bundle/nerdcommenter' failed
Is there an quivalent of --no-check-certificate for wget?
Update: I fixed the latter problem as well. For anyone else having the same problem, you can simply edit your .git/config file and change all of the submodule HTTPS references to HTTP. Re-attempt the update and it should work.

Related

Cygwin git and git bash path confusion

So I wanted to install some vim plugins using Vundle, I got everything set up, ran PluginInstall command and got this:
fatal: Unable to create temporary file: Result too large
I should mention that I have both git-bash and cygwin git package installed on my environment.
I did some googling and found that I shouldn't use windows version of git through cygwin, installed cygwin git package, tried again to no avail. Turns out even though I have installed the cyg pkg, cygwin is still using the git-bash one.
I tried manually pulling the plugin with cygwin's git version and it worked. So how do I force cygwin to use it's own package. In my user path variable resides only cygwin's bin folder, git-bash is in the system's path variable. How do I force the user path one to take precedence over the git-bash version? Shouldn't that be the dafault behaviour?
https://askubuntu.com/questions/58814/how-do-i-add-environment-variables
Seems to do the trick, I don't know if that is the optimal solution but it works. I just plugged this into my bashrc.
export PATH="C:\cygwin64\bin"

Bare Git repo cannot add files or commit files

So I have been plagued with this weird git problem that myself and a few other developers have not been able to solve. Here it is:
I created a bare repo for managing website changes using git on test server.
For this example the repo is here: /home/website/website.git
The website public root would be here: /home/website
I created the repo by doing this command: git init --bare
inside the git repo directory "website.git"
Next I have my local repo on a machine elsewhere. This is a standard git repo. I build the site get it ready to deploy. When its ready I push it to the bare repo. From my local repo.
There is a post-receive hook that checks the latest file tree out into the public root of the website. So when I change things on the local repo and test them in the localhost environment, once satisfied I can push them to the live server.
Here is the problem I face:
I can push fine. No issues. All works as expected. Code gets checked out to public root. Everybody is happy and goes on with their life.
BUT!!!:
The site is a CMS site. Users log in to it and upload things. Files get created on the public root of the website which is the GIT_WORK_TREE.
So NBD right?! I can just commit the files every now and then from the live bare repo and pull them back to my local environment like I have before. So I log into SSH on the server. Navigate to /home/website/website.git
Then run this command:
GIT_WORK_TREE=/home/website/ git add ../
I get this mess:
error: unable to create temporary sha1 filename ./objects/cb: No such file or directory
error: error_log: failed to insert into database
error: unable to index file error_log
fatal: adding files failed
I have done this before on other servers and it worked fine from what I remember. So I was like WTF, must be something strange on this server. I went to another server I have and replicated the EXACT same steps. Got the EXACT same problem. So now I fear I am loosing my sanity and maybe these previous git experiences are all made up in my head.... *Well, lets not go that far yet.... :)
Maybe somebody can help me out here. I have used git plenty and can't seem to crack this one.
Oh, some other maybe useful specs:
running CENTOS 6.2
I double checked all permissions. I even tried changing everything to 777 recursively just to make sure Im not loosing it somehow. Made sure all the files are owned by the correct user. chowned recursively. I also tried the standard solution to this problem which is described here: https://answers.atlassian.com/questions/132671/git-commit-fails-with-sourcetree-error-unable-to-create-temporary-sha1-filename-git-objects-d8-file-exists
That didnt work either. Not sure where to go from here.
PLEASE HELP ME!!!!
I feel like Linus is playing cruel tricks on me right now.
You have a bare git repository in /home/website/website.git which is inside of a git repository in /home/website? And then you try to trick the bare git repository into having a working tree using GIT_WORK_TREE?
Maybe it is worth understanding this setup but only if you intend to be a git developer. As you are a user focused on delivering website functionality, I suggest using a standard git setup.
Move the bare git repository elsewhere:
$ mkdir /home/repo
$ mv /home/website/website.git /home/repo/website.git
$ cd /home/website
$ git remote set-url origin /home/repo/website.git
I got the solution. This is it. I was running the above command from the git repo.
Turns out the command should be run from the work tree and altered to look like this:
GIT_WORK_TREE=/home/website/ git --git-dir="./website.git/" add ./

Pull not working - TortoiseGIT / Windows 7 / GIT on Debian + gitolite

i have a weird issue. Im using TortoiseGIT (Win7) and my repositories are placed on a vritual server (Debian), where im using gitolite and SSH keys.
I can clone the repository to my PC, i can run Fetch, Push, Commit, Sync .. everything, but when trying to Pull the changes from server Pushed by other contributor, the following error appears:
git.exe pull -v --progress "origin"
fatal: 'pull' appears to be a git command, but we were not
able to execute it. Maybe git-pull is broken?
git did not exit cleanly (exit code 128)
I don't understand, why just the pull command is not working .. thanks for any help.
I can make a clone of the repository, with the contributed changes .. but can not Pull the changes to created repository on my PC.
I encountered this same issue after changing the git Bash executable sh.exe to be always run as administrator (to get round another problem). It then left git unable to access it under certain scenarios and caused various "Maybe git-* is broken?" errors. Perhaps this might help someone...
Uninstalling old Git and reinstalling the latest build fixed this issue for me.
Here's a link to the installers
Link to get installers
My exact error message was
C:\Program Files (x86)\Git/libexec/git-core\git-pull: line 304: exec: git-merge: not found
fatal: 'pull' appears to be a git command, but we were not
able to execute it. Maybe git-pull is broken?
The error message is very much linked to Git, and comes from help.c:
static const char bad_interpreter_advice[] =
N_("'%s' appears to be a git command, but we were not\n"
"able to execute it. Maybe git-%s is broken?");
That is similar to issue 40 (of another GUI, here terminal-ide).
In that case, it was due to the remote Git installation, which was incomplete
(Comments 3 of issue 19)
git-merge was also missing from install, can be fixed with
$> ln -s git git-merge
in system/bin/
The resolution might not be exactly the same in your case, but it could be related to a faulty Git installation.
I see that you're able to run "git fetch". If you can also run "git merge", running the sequence "git fetch" followed by "git merge" will accomplish the same thing as "git pull".
Source:
http://git-scm.com/docs/git-pull

How could I recover my git-daemon repositories

I had a Gitorious install that got old and it is clear now that it is not coming back. I want to recover the repos (mainly the wiki repos) from the repository. I do not want to repeat the long and painful process of setting up Gitorious again, just to get some wiki back out of it...in fact I'd like to clean up the old install soon (remove it). Although, when it was running it was awesome!
I still have the database for gitorious, so I know which .git files I want and where to find them.
I was attempting to setup git-daemon (I'm on a Linux (ubuntu) setup), but I am not having much luck. I was hopeful that maybe I could just copy the 'foo.git' file somewhere and clone it.
Currently my .git files are in user git's home folder. No problem moving them though, but I'm not sure how to go about this.
I have git daemon running, but it 'hangs up unexpectedly' if I try to connect via 'localhost', all the repos also have my 'export-ok' file in them too. I can connect accross my LAN and clone any other git initialized directory via ssh, could that help me?
Can I just copy the foo.git (more like a f13f9ed412591ce72f7b3cb793605e93ce.git) file to maybe a git initialized repo and work with it there? Is there a git tool that I could use to expand the .git file? <-- I'm sure Git would be the tool right?
The .git is a folder and not a file and git repos are lightweight in that it is just files and folders. You can copy your repo to wherever you want.
Since you said localhost, if you want you can even clone the repos with git clone /path/to/repo.git and work on the cloned repo. You do not need the daemon or anything else to be running.

problem using VCSCommand Vim plugin with Mercurial

I just installed VCSCommand and I'm getting an error of "No suitable plugin" whenever I try to run a command. I have a filed loaded in Vim that is in a directory with a mercurial repository.
I found some explanations that the "No suitable plugin" error may be displayed if you're not in a "working directory", which I took to mean that the file you're editing should be in a "working directory" of files checked out from the repository. The problem may that (as a new user to Hg) I don't grok Mercurial properly. The file I'm editing is in a directory where I created an Hg repository just to track my local changes. Commands I issued were 'hg init', then 'hg add' and I've been using 'hg commit', 'hg log', and 'hg diff' happily since. Is this directory not a "working directory" of the repo? Assuming this is the problem, how do I "checkout' the files from the hg repo into a working directory?
Or maybe the above isn't the problem with the "No suitable plugin" error at all. I do have the vcshg.vim file in the correct plugin directory, so the plugin is there.
Thanks, any help appreciated.
UPDATE: Just in case my use of mercurial was the problem I tried creating a 'clone' of my main mercurial repo and editing files in the clone. Still get same 'No suitable plugin.' message.
ALSO: I left out of original message that I'm running on Windows, and I think I've tracked things down to improper quoting of escape codes in strings. Will provide further update once I get full resolution.
I did get VCSCommand going fine. I think the issue had nothing to do with Mercurial, rather it had to do with problems in VCSCommand with quoting of system commands on Windows. At least that was the major problem.
To get VCSCommand working I first made sure that the variable b:VCSCommandVCSType was set to 'HG'. It was not getting set for some reason and that was why I was getting the 'No suitable plugin" error.
Second, I had to modify a line in vcshg.vim. The s:Executable() function consists of a one line 'return . . . ' function. The shellescape() wrapper around the system call was quoting improperly; after I removed that it works just fine. (Same problem may exist in the vcsXX.vim files for systems other than Mercurial, I haven't checked that.)
I think this quoting problem exists only on Windows, and may have cropped up because the main developer doesn't have a Windows machine to test on. . . .
First to answer the "working directory" question: your repository is your working directory. Unlike cvs/svn, you do not need to checkout files to edit. You just edit.
(FYI hg aliases its update command to checkout and co to help svn users, but hg update is a very different animal.)
Without knowing your complete environment (platform, vim installation, etc.), I can only guess that the "No suitable plugin" error is due to your VCSCommand files not in the right place. I tried its latest version 1.99.42 with my ancient vim 7.2 on cygwin by cp VCSCommand/plugin/* ~/.vim/plugin/, vim a file in an hg repo, then :VCSStatus shows me the correct result.
If you have other VCSs that VCSCommand supports (cvs, svn, svk, git, bzr), try it in one of their repositories and see if you get the same error. If you do, then it's definitely a VCSCommand installation problem.

Resources