- Use git add -i (<filename>)
- Select 5 (or p) then enter to see changes for selection.
- Choose files by type number in front of each file name and enter.
- Enter again to start.
- Type y or n to choose or not choose changes.
Type s to divide changes to smaller sectioin.
Type e to manually choose change.
- After back to main prompt choose 7 (or q) and enter to leave.
Wednesday, February 16, 2011
Tuesday, February 8, 2011
Ant OS specific value
<condition property="os.dep.value" value="value for MacOSX">
<os family="mac" />
</condition>
<condition property="os.dep.value" value="value for Windows">
<os family="windows" />
</condition>
<condition property="os.dep.value" value="value for Unix" >
<os family="unix" />
</condition>
Use as "${os.dep.value}"
Creadit: Can I make the Ant copy task OS-specific? - Stack Overflow, How to make a conditional decision in an Ant build script based on operating system | java ant | devdaily.com
Wednesday, February 2, 2011
Generate current Git version in Ant for Hudson
At the time I wrote this blog there is no Git Ant task. Workaround for getting current commit version is to use exec directly invoke git describe as below.
Now you can get result value of git describe from ${build.commit}.
Credit: How to lookup the latest git commit hash from an ant build script - Stack Overflow
But there is also some problems with Hudson's git plug-in which it always tags build revision that causes our git describe return the wrong result. There was someone send patch to fix this but this is not build to the plug-in yet. Currently workaround is provided in that patch page, add paramter to git describe, "--match=[^(hudson)]*", to ignore tag from Hudson. So we have to add more arg line to Ant's exec task:
That's all.
<exec executable="git" outputproperty="build.commit">
<arg value="describe"/>
<arg value="--tags"/>
<arg value="--abbrev=20"/>
</exec>
Now you can get result value of git describe from ${build.commit}.
Credit: How to lookup the latest git commit hash from an ant build script - Stack Overflow
But there is also some problems with Hudson's git plug-in which it always tags build revision that causes our git describe return the wrong result. There was someone send patch to fix this but this is not build to the plug-in yet. Currently workaround is provided in that patch page, add paramter to git describe, "--match=[^(hudson)]*", to ignore tag from Hudson. So we have to add more arg line to Ant's exec task:
<arg value="--match=[^(hudson)]*">
That's all.
Disable SSH host key checking
I summarized this from Linux Commando: How to disable SSH host key checking
He suggested 3 approaches
He suggested 3 approaches
- $ sed -i 3d ~/.ssh/known_hosts
- Use parameters
* StrictHostKeyCheckin
* UserKnownHostsFilessh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no username@hostname
- Config file ~/.ssh/config (or /etc/ssh/ssh_config for global) & restart ssh
Host 192.168.0.*
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
Monday, November 22, 2010
[Java] What will be printed to a console?
ArrayList<Integer> list = new ArrayList<Integer>();
list.add(1);
list.add(2);
list.add(3);
list.remove(1);
System.out.println(list);
Thursday, November 18, 2010
Note for starting new Eclipse workspace
- Import Formatter.
- Customize Save Actions.
- Set text editor "spaces for tabs" and "displayed tab width".
- For MacOSX, change "Content Assist" short-key.
- Set content assist to help import favorite static members.
Monday, November 1, 2010
[Java] Jars inside Jar
Jar that contains multiple jars inside is not support directly by Java. There are some workarounds on this.
Java: Easiest way to merge a release into one jar-file
Is it possible to package all the jar dependencies in one big jar ?
- Put jars in to jar as ordinary files then load them with your own customized classloader. There is a tool such as One-JAR™ but some people told that it causes performance problem (I have not try this).
- Extract jars to .class and pack them together to a single jar. You can archive this easily with Ant's Zip Task
Java: Easiest way to merge a release into one jar-file
Is it possible to package all the jar dependencies in one big jar ?
Subscribe to:
Posts (Atom)
Collectd PostgreSQL Plugin
I couldn't find this link when searching with google https://www.collectd.org/documentation/manpages/collectd.conf.html#plugin-postgresq...
-
sudo su postgres supply your Mac password modify /Library/PostgreSQL/9.x/data/pg_hba.conf from local all all md5 to local all all ...
-
This error occurs when you or some of your vim plugins try to access register '*' which is a system clipboard. In default Mac OSX vi...
-
Put your cursor on the text box of the post/comment you want to indent Go to the menubar at the top of the screen Edit > Emoji & ...