Tag: vcs

Ubuntu clone with git ‘hung up unexpectedly’ problem solved

I was experiencing a very strange issue where I was unable to clone or pull from some repositories on github. It would only be for some (larger) respositories, and I could sometimes pull them fine using the https:// protocol, but not using the git:// or ssh:// protocols.

What I would see in the output, is that git would contact the remote server, and just hang for several minutes, before giving, rather cryptically, the 'remote end hung up unexpectedly' message. Doing a ‘git pull’ on an existing repo would give me 'error: RPC failed; result=56, HTTP code = 0'

I could clone the same repos fine on my OSX workstation, and on other Ubuntu linux boxes, so something weird was definitely up.

I suspected it was some sort of low-level networking issue, and after trying many things, came upon the solution:

My MTU size was set to ‘automatic’, and had defaulted to 1500. Apparently this can sometimes cause TCP connections to hang in some network environments!

I set my MTU size to 1492 on my network adapter (Under Edit Connections… in the UI) and everything started to work as expected! Huzzah.

 

Recovering lost IntelliJ IDEA shelved changesets

Imagine the following scenario:

  • You are moving your beloved project out from a subdirectory of an svn repository, into it’s own brand spanking new repository.
  • You have about 3 days worth of large refactorings to the codebase waiting in the wings, with most of the tests passing, but not quite ready for commit to the trunk
  • You use IDEA’s shelve feature to put those changes into safe keeping, so you can make changes and commits to the repository in preparation for the move
  • You manage to successfully migrate the svn repository across, managing to keep all the history (yay)
  • You then open the new (and renamed) project in IDEA, and all of your shelved changes are gone

Gulp.

Luckily, IDEA never deletes any of the shelved changesets, and conveniently stores them in unified .diff format in $USERDIR$.IntelliJIdea80configshelf

Also, conveniently, there’s the ‘Version Control -> Apply Patch’ menu item, so you don’t have to worry about mucking about with the *nix patch command line tool.

Day saved. Hurrah!

** Perhaps this sort of thing is a good argument for using a Distributed VCS system, like git or mercurial or monotone et al. You would normally be doing lots of small commits to your local repository, without necessarily worrying about breaking trunk for everybody, and your changes stay safe