avp::ptr weblog

Everything that is in our mind.

Archive for February, 2012

Colored Diffs add-on for Thunderbird

with 2 comments

Reading todays post-hook emails with the latest diffs of some project the thought rushed to my head that it would be nice to have the diffs displayed in color. Since I am using Thunderbird as my email client I found a great add-on named “Colored Diff”.

Although, the add-on seems to be outdated to work with the latest Thunderbird version (which is 10.0 right now) there is an easy way to install the add-on while the automatic installer refuses to do so. Here is what you can do to make the installation work.

  1. Download the colored diffs *.xpi file
  2. Open the archive with an archive manager of your choice
  3. Edit the contained install.rdf with a text editor of your choice
  4. Change the maxVersion parameter to be equal or greater then the current version of Thunderbird
    Before: <em:maxVersion>3.1.*</em:maxVersion>
    After: <em:maxVersion>13.1.*</em:maxVersion>
  5. Save the changes and store them back into the archive
  6. Install the add-on

Do not forget to check out the preferences after you installed the add-on. You can choose 4 different types to display the diffs and customize the colors as well.

If you feel interested to enhance the add-on you can do so. The “Colored diffs” project is hosted on Google Code open for people to participate.

Written by tobi

February 8th, 2012 at 4:33 pm

Amend files to a git commit without changing the commit message

with 3 comments

Quiet often there is the need to add files to the recent commit. This can be done with 2 simple commands.

git add file
git commit --amend

In case you do not wand to change the commit message there is the new option --no-edit for git commit introduced in git 1.7.9. The git release notes describe how the --no-edit option can be used.

git commit --amend” learned “--no-edit” option to say that the
user is amending the tree being recorded, without updating the
commit log message.

git commit --amend --no-edit

Of course, I added an alias for the new option to my global git configuration.

ci = commit
cm = commit -m
ca = commit --amend
cn = commit --amend --no-edit

Written by tobi

February 5th, 2012 at 10:11 pm

Posted in Uncategorized

Tagged with , , ,

Reset the author of a git commit

without comments

Once in a while one forgets to configure the user name and email address for git when initializing or cloning a new git repository. So do I. But git would not be git if it does not have an answer to that problem. Here is what git prints out when you commit without previously configuring the user credentials.

$ git cm 'Initial import.';
[master (root-commit) 0396c37] Initial import.
Committer: User User@Machine.(none);
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:

    git config --global user.name ''Your Name''
    git config --global user.email you@example.com

After doing this, you may fix the identity used for this commit with:

    git commit --amend --reset-author

1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 file

Well done git!

Written by tobi

February 5th, 2012 at 9:54 pm

Posted in Uncategorized

Tagged with , , , ,