Tuesday, June 21, 2016

Git: How to move a folder to a new empty repository, with history included

I will not write an introduction of why we need to do this. This is how I did it, not sure if it is the best way but worked 100%:

I used the git commands described in this great article https://help.github.com/articles/remove-sensitive-data/

  1.  Two repos: REPO_OLD with the folder I want to move, REPO_NEW an empty repository where I will move the folder
  2. Copy everything (.git folder included) from REPO_OLD to REPO_NEW (another way is to clone REPO_OLD into a new folder REPO_NEW)
  3. DONT FORGET THIS: Remove the origin in REPO_NEW: git remote rm origin
  4. Delete in REPO_NEW all folders you DONT need. E.g. folder name is FOLDER then

    git filter-branch --force --index-filter ' git rm --cached --ignore-unmatch -r  FOLDER/ ' --prune-empty --tag-name-filter cat -- --all

    do it with all the folders one by one, at the end only the folder you need should be in REPO_NEW. If some folders still exist it is due to some files were not added to git, you can delete the folders manually, they are not in the git history anymore.
  5. Now set origin in REPO_NEW to the remote repository where you want to push this new repo.
    E.g. git remote add origin git@bitbucket.org:someuser/REPO_NEW.git 
  6. Push everything forcing overwrite history: git push origin --force --all
  7. Ok, it is copied, but not moved. Just delete the folder in REPO_OLD using the same command you used in step 4.
  8. Done

Sunday, May 15, 2016

Released a new android app: Radar Stats for LoL

Hi all,

I created a new app to analyze my games in League of Legends. I hope you enjoy it as I do.

The link to Google Play: https://play.google.com/store/apps/details?id=ar.ignaciotcrespo.lolradar

And the webpage: http://lolradarstats.com/

Some screenshots:

Later I will describe which libraries I am using in the app.

Any feedback is welcome.


Sunday, January 26, 2014

Just when you thought you knew a lot about development...

Just when you thought you knew a lot about development someone that knows more punch you directly in the face with a few wise words.

A friend recommended me "Clean Code" and "Clean Coder", by Robert Martin.


I feel like a child learning everything again. I love these books, it is the kind of technical thing that you need to read before going to sleep.

Wednesday, November 14, 2012

Android SDK Manager can't find latest updates!

I had a nice surprise today. After updating the ADT plugin in Eclipse it says that I must update the android tools.

Ok, one more time I opened the SDK Manager and searched for the updates. But wait... there is no updates. And Eclipse doesn't work! WTF?

"It must be a bad nightmare, take it easy" I think. Just do the obvious thing, close the SDK Manager and open it again. Stupid solution, it doesn't work.

Ok, something is bad, so I enter to the preferences and what I see is "Cache size" with the option "Delete cache". Oh yea! Now it works. God exists.

Stupid cache, you think you know everything, but I am better than you :D

Tuesday, November 6, 2012

Development tools I can't live without

Every developer has his own set of preferred tools. Me too. In my case all these tools are Java oriented because is the language I use more often. Obviously these are not the best tools you can find on internet, I'm sure you use other tools better and you hate my tools, but they gave me so many satisfactions that I think my work can't be finished without them. Too bad uh?

  • Eclipse: "naaaaaaaaaaa, no way" maybe you think. I understand people complaining this fantastic IDE, but I am in love with this tool. I tried all IntelliJ, Netbeans, etc. and I think I know Eclipse so well that I can face any problem that it can have, I accept it's buggy due to the free plugins we install all the time.
  • Findbugs: great free tool to detect common programming problems.
  • CheckStyle: the best tool to detect coding standard violations. I use it inside Eclipse of course.
  • UCDetector: Unused Code Detector. When your project it's really big you notice a lot of code that it is not being used. You can remove it automatically with proguard, but the best option is to delete it. Less code, less problems. This free Eclipse plugin will do the hard work for you, with many options, and allowing to remove multiple things with quickfix.
  • ASM Bytecode Plugin: amazing plugin to see the java bytecode in real time. Sometimes when you want to improve something it is good to check the bytecode, you will get some nice surprises. You can change the code, but the bytecode could be exactly the same or even worst.
  • Lint: checks for problems in Android projects. It is included in the android SDK and the ADT plugin.
  • Total Commander: wtf? This is not for java. Of course not, it is only THE file commander. Extremely powerful, and with lot of free plugins. It's for windows only but I use it with "wine" in MacOS. If you create a plugin the author will send you a personal license for free! Thanks Ghisler, you made me happy on christmas ;)
  • Sonar: easily receive reports with code coverage and errors.
  • PlantUML: combined with Javadoc is an amazing tool to add UML graphs to your documentation.
  • Google: do I need to put the link? When you don't know something he knows it :D
And the last thing I can say is: use the tools that are more comfortable for you, and use them well and wisely. You will love your daily job.



Wednesday, October 19, 2011

What I want to see in Logcat plugin for Eclipse

The new logcat plugin is cool, now has regex and more options to filter. But it lacks of:

  • highlight searched text
  • syntax coloring for XML and others
  • selection of log format (brief, full, etc.) and ring buffer (main, radio, events)
I developed a small logcat plugin with those both features. Warning, this logcat plugin is ugly (I'm not a UI designer), it's just a small example.

You can download it here: https://skydrive.live.com/redir.aspx?cid=511e6cc6d535b08d&resid=511E6CC6D535B08D!123

A few screenshots

highlight searched text in yellow

syntax highlight in XML

I will continue using the original logcat plugin, is really great, but still has many things to improve. Congratulations to all the developers, they did a great job.


Wednesday, August 31, 2011