You know how it goes. You continuously stack stuff in the most convenient place (shelf, drawer, desk, ...) and it's all fine, up until the moment you no longer can find what you need. That is the day when you need to put everything else aside and clean up your mess. Not sure if it is Conway's Law to blame but this seams to happen to my repositories on GitHib. And today was the day when I no longer could recall which repo is under which account, where it resides on my local hard drive and if it's actually in sync. So today was my GitHub cleanup day. Just in case you need to cleanup yours or if you use one of my projects and something is no longer where you expect it to be, here is what changed.
Azzazzel is my private account which I have had since GitHub's early days. As of today it had over 30 repositories. If that was not enough, this user is member of Commsen organization which represents the company I own (that's why my open source projects use com.commsen as package prefix and Maven group id). That organization account had another 5 repos.
MilenDyankov is the GitHub account I created after I joined Liferay. This user is member of Liferay organization (plus few other Liferay related ones) and this is where all Liferay related work goes. Unfortunately I've also occasionally used it to throw there demos, PoCs, small projects, ... As of today it had another 15 repositories.
Altogether there are 50+ repositories which contain:
I'm sure for many of you those numbers are far from impressive, but for me this was the point where I started to get lost and I had to do something about it.
I've been using two github accounts for several years now. I didn't have to change anything to continue doing it. I just though I'll share with you my approach in case you have the same issue. So what I do is as simple as configuring my ~/.ssh/config file like this:
Host milendyankov.github.com
User git
Hostname github.com
IdentityFile ~/.ssh/<key_for_milendyankov_account>
Host azzazzel.github.com
user git
Hostname github.com
IdentityFile ~/.ssh/<key_for_azzazzel_account>
Then I make sure my git remotes use appropriate hostname instead of just github.com! For example:
→ git remote -v
origin [email protected]:azzazzel/modular-dukes-forest.git (fetch)
origin [email protected]:azzazzel/modular-dukes-forest.git (push)
This onetime configuration allows me to tie a particular local clone to appropriate GitHub account. Of course if you know of a better way, please let me know.
Back to clean up task. The most obvious thing is to get rid of what you don't need. It doesn't make sense to keep clones of someone's repo just because you've contributed to it in the past. I have no idea why I kept those so long but now they are gone. I can always clone them again if I need to.
Now the hard part - the repositories that are (or could be) actually in use. After trying out different things I decided to group those into 4 categories:
And that's it ... well, almost!
While GitHub does great job redirecting all links to the Git repository on the Web and through Git activity, it doesn't redirect GitHub Pages associated with the repositories. Luckily quick search found me Redirecting GitHub Pages after a repository move which was all I needed.
In my case project sites move from Azzazzel to Commsen account. Since both already host websites (milendyankov.com and commsen.com respectively), it was just a matter of creating the appropriate [project-name]/index.html files in the former with the following content:
<!DOCTYPE html>
<meta charset="utf-8">
<title>Redirecting to http://commsen.com/[project-name]/</title>
<meta http-equiv="refresh" content="0; URL=http://commsen.com/[project-name]/">
<link rel="canonical" href="http://commsen.com/[project-name]/">
Now you should be automatically redirected to the new place if you go to WeDeploy Java client or WeDeploy Maven Plugin for example!
I'm about to clean up my local filesystem now, but I will not bother you with the details. Enough to say, now that I've decided in which space given codebase lives, it's kind of obvious how to restructure it.
I tested the changes as much as I could and everything seams to work fine (including existing clones of the moved repositories). However if you encounter missing or broken links or any other issues, please let me know.
Of course, if you have a better strategy for keeping you GitHub accounts and repos nice and tidy, please share!
What to expect in post-JPMS Java world
The atmosphere around Java 9 (and most notably JPMS a.k.a. JSR 376 a.k.a. Jigsaw) is getting really hot. Java community seams to be divided into 3 camps "developers who honestly believe JPMS can simplify modularity", "developers who have been dealing with modularity long enough to clearly see the issues Java platform architects don't want to see" and "developers who don't care (for now)". I personally think the 3rd group is by far the largest and this is the main issue and the main reason for the noise. Why? Because those are the developers who never cared about modularity. Most of them still don't care, but now they will be forced to learn about modularity. The question is what will they learn? Real modularity as described in Modulariy Maturiy Model or limited version of it wrapped in a package with a label "simple" on it?
Am I against JPMS and microservices?
I started writing this on my way back home from Devoxx BE 2017. The reason is, two things happened during the conference, that made me ask myself this question.