Quick Tip: Subversion Change Logs For Files

Yesterday I needed to determine who last edited portions of a file with subversion, and came across a couple great suggestions on stack overflow which I’d like to share here.

Subversion offer a few ways to perform this task, including the following two methods I learned yesterday;

1. The first method returns the log of previous revisions on the file and is ideal when you need to review a more detailed change log.

 svn log --diff filename 

2. The second method is more concise, and only provides the revision number and author name for the last change to a specific file’s line. This approach is performed with the aptly named subcommand blame.

 svn blame filename 
Advertisements

Quick tip: searching your shell history

My boss recently shared a great tip for performing a reverse search of your shell history. The next time you’re trying to remember a command you recently typed in terminal. Try the key stroke combination of Ctrl + r.

Typing Ctrl + r in your terminal will prompt you for a search string, and the first result it matches in your history will be returned. If the match is not correct, you can add more characters to make the search more specific, or type Ctrl + r again, and the next valid match will be displayed.

Note: The filtered search results may include the string in any portion of a history log entry, and are not limited to the beginning characters of each log entry. This also means that if multiple matches exists in a single log entry, Ctrl + r will move the search cursor to the next match in the same entry.

Mapping Britain’s Genetic History

I recently had a chance to read a very interesting article on the mapping of Britain’s genetic make up. Not only has the genetic composition of the region been surprisingly consistent, but many of the invasions in Britain’s history have had little genetic impact (eg. The Roman occupation for nearly 400 years, did not drastically change the genetic make-up of the region’s peoples).

This is a wonderful example of geomatics being applied to subjects not often researched by the field. If you’re interested, check out the full article here.

Quick Tip: Exploring Your Bash History

Typically when you type a shell command its recorded in the bash history. If you ever needed to see what you typed in the past, a useful tool is the history command. By typing history in the shell it will display a list of commands (commonly the last 500) in the shell.

Example:
user@computer:~$ history
1 ls
2 mkdir testdir
3 cd testdir/
4 vi testdoc
5 ls
6 cd ..
7 rm -r testdir/
8 history

One of the benefits of the history command is if there is a command in your history you wish to execute again. You can do so by typing !<history number>.

Example:
Using the history list above, typing !2 would execute the command mkdir testdir again.