Sonntag, 15. November 2009

Git and KDiff3

I wrote a small patch for yakuake. Yakuake still uses subversion (because KDE still uses SVN, but it will switch to git) I tried the SVN mercurial plugin. Well, for some reason it failed ("abort: None" wtf?) so I tried the git SVN plugin. Well, I like hg a bit more than git but whatever. There are both good DSCMs.

Because I like to use kdiff3 to view changes I googled how to use it with git. I found this message and extended the script:
#!/bin/sh -e

# Usage: git kdiff3 [commit1 [commit2]]

SUBDIRECTORY_OK=1
. "`git --exec-path`/git-sh-setup" || exit 1
cd_to_toplevel

O=".git-kdiff3-tmp-$$"
list=$O/.git-kdiff3-list
trap "rm -rf $O" 0
mkdir $O || exit 1

function diff_working_copy () {
	git diff --name-only -z "$1" > $list || exit 1
	xargs --arg-file=$list -0 git archive --prefix=a/ "$1" | tar xf - -C $O || exit 1
	{ cat $list; printf '\0'; } | while read -r -d '' fname; do
		if [ -e "$fname" ]; then
			dir=`dirname "$fname"`
			dest="$O/b/$dir"
			mkdir -p "$dest" || exit 1
			cp "$fname" "$dest" || exit 1
		fi
	done
}

case $# in
	2)
	git diff --name-only -z "$1" "$2" > $list || exit 1
	xargs --arg-file=$list -0 git archive --prefix=a/ "$1" | tar xf - -C $O || exit 1
	xargs --arg-file=$list -0 git archive --prefix=b/ "$2" | tar xf - -C $O || exit 1
	;;

	1)
	diff_working_copy "$1"
	;;

	0)
	diff_working_copy master
	;;

	*)
	echo >&2 "error: illegal number of arguments"
	exit 1
	;;
esac

if [ -e $O/a -a -e $O/b ]; then
	kdiff3 $O/a $O/b
	exit $?
fi
When you copy it to `git --exec-path`/git-kdiff3 you can use it by issuing the command git kdiff3.

Dienstag, 10. November 2009

Things I hate about Eclipse

As a follow up to "Things I love about Eclipse" I think I really need to write this posting.

Uninstall Plugins

You simply can't. There is no built in mechanism to do that. You have to manually guess and delete the files.

Broken Copy/Cut+Paste

During application development you have often to restructure your code, copy some small parts, move things from one file to another etc. For this one selects the text (either with the mouse or the keyboard) hits Ctrl+C (or Ctrl+X) and then at the target position you hit Ctrl+V. Well, not with Eclipse. It is so freaking broken that it never understands right what you've selected. You have to select the text, wait at least two or three seconds, copy/cut, move cursor to target and then paste. This extremely slows you down! You would never thing an editor as advanced as Eclipse would suffer from such an behaviour. You forget that it does and so you often have to undo the wrongly inserted text, move back to the source and copy it again. I mean WTF? This is the 21st century. No other editor, as crappy or old you can imagine, suffers from such an problem. And the worst thing is, this issue seem to have got worse in recent Eclipse releases! Gaaaah! This bug actually makes me think about moving to NetBeans.

Search

It could be a lot more handy. The free floating window often obscures the text, only one occurrence of the search string is highlighted at a time and F3 doesn't do a "search again". I'm accustomed by almost every other advanced editor (well, not vim) that F3 means "search again".

Dienstag, 6. Oktober 2009

Things I love about Eclipse

In this posting I list a few things I really like about Eclipse. Most of these things (but not all) are currently not (or only very limited) supported by Qt Creator (1.2). I'd really like to see these features in Qt Creator, because I use almost all of them all the time when I write Java Code (only the last two I use less often). Note that NetBeans also supports these features in some way. There are differences between Eclipse and NetBeans that make me use either IDE for certain projects, but none of them concern the basic features I describe here.

All the Sub-Windows

I have a widescreen monitor and I really like how I can move and place all parts/tabs of eclipse to my liking so I fill the screen neatly. I also like how you can trace errors in the project tree. Also note the red mark beside the scrollbar. This marks the line containing the error. You can jump to the corresponding line by clicking the mark. Other marks supported by Eclipse are warnings and TODOs (in comments).

Highlight Symbols

When you place the cursor into a symbol all occurrences of it get highlighted. See also the gray markings beside the scroll bar.

Auto Completion

Camel Case Wildcards

(I think this is already supported by Qt Creator.) You can abbreviate names by only typing the uppercase letters (and the initial lowercase letter for members) to speed up autocompletion.

Overloaded Methods

Overloaded methods are listed like any other. In Qt Creator some kind of strange tool tip gets displayed (only method signature, no documentation). I think this is confusing. I don't expect a tool tip to capture my up/down key strokes. Also you have to go through all in order to look if there is a signature that fits your needs. The way Eclipse does it you see all (or as much as possible) signatures at once.

Granted, the way Eclipse does it pollutes the drop down menu. I think it depends on the preference of the programmer. This should be an option.

Advanced Tool Tips

Eclipse displays tool tips for classes, methods, fields etc. on mouse hover.

There are a lot of nice things about the tool tips in Eclipse. When you click them they get a bar with which you can resize and move them.

You can also navigate the documentation displayed in a tool tip.

Class Creation

Eclipse provides a neat class creation dialog. You can fill in generic types, enter the package name etc.

Auto Correction

For a lot of common errors Eclipse provides auto correction when you click the red x icon beside the line number. This comes really handy from time to time.

Code Generation

Eclipse provides means to generate common and simple code. This code is trivial and just cumbersome to write.

Refactoring Preview

Before you apply any refectoring step you can preview it in a nice diff view.

Visual Type Hierarchy

I think the images speak for them self.

Visual Call Hierarchy

Find References of Classes

Sonntag, 20. September 2009

E-Mails and Web-Forms

I don't know whether this is already covered by one of the new xform standards but I think there should be support for automatic public key attachment to the from data when you supply an email address in a web form. There are a lot of sites that send you your password as a confirmation in a plain text email. When one could easily(!) attach a public key, maybe such sites would use it and less plain text passwords would be sent over the net. Just a thought.

Sonntag, 13. September 2009

Bookmarklet: Remove Plenks

I wrote a bookmarklet to remove plenks from a webpage. Right click to make a bookmark here. :)

Here is an example text with plenks you can tidy up by clicking the JavaScript link.
Hello , my name is Mr . Plenk .
I write ( very ugly ) texts ! ?
But sometimes I write things that don't contain plenks, e.g. when I write about .xml files.
logo

pub - panzi's uni blog

Archiv

November 2009
Mo
Di
Mi
Do
Fr
Sa
So
 
 
 
 
 
 
 1 
 2 
 3 
 4 
 5 
 6 
 7 
 8 
 9 
11
12
13
14
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
 
 
 
 
 
 
 

User Status

Du bist nicht angemeldet.

Suche

 

Aktuelle Beiträge

Git and KDiff3
I wrote a small patch for yakuake. Yakuake still uses...
panzi - 15. Nov, 01:47
Things I hate about Eclipse
As a follow up to "Things I love about Eclipse" I think...
panzi - 10. Nov, 23:17
Thanks for that tip!!!...
Thanks for that tip!!! It worked for me. Oliver.
Oliver (anonym) - 9. Nov, 18:09
Things I love about Eclipse
img { border: 0px; }p.img {text-align: center;}In this...
panzi - 6. Okt, 22:21
From Brazil
Congratulation! Very Very good! Similar the www.diigo.com Thanks
Rogerio M. Souza (anonym) - 20. Sep, 16:46

Status

Online seit 1661 Tagen
Zuletzt aktualisiert: 15. Nov, 01:47

Credits

twoday.org

based on antville powered by Helma


  • xml version of this page

(sci)fi
algodat
c
comic
dies und das
film & tv
gefahren des internet
graphik
iug1
java
k(r)ampf mit dem computer
literatur
mathe
musik
netzkultur
open source
... weitere
Profil
Abmelden
Weblog abonnieren