Lately, the version control system of my choice for personal small projects is mercurial. I find it easy to use and to install (I’ve never encountered a system without python) so it is always my first choice. However, a friend of mine asked me to go through his project’s code that was hosted on a git repo. I must say that before this I had never used git, I was reluctant and git’s weird options and arguments kept me away initially.
Enough with the introduction. One command used extensively by me (while using mercurial) was:
hg glog
which has the following output (copied shamelessly from http://mercurial.selenic.com/wiki/TutorialMerge)):
$ hg glog
@ changeset: 4:d2ecac0134d8
|\ tag: tip
| | parent: 2:c3844fde99f0
| | parent: 3:86794f718fb1
| | user: mpm@selenic.com
| | date: Tue May 06 23:44:19 2008 +0200
| | summary: Merged changes from my-hello-new-output
| |
| o changeset: 3:86794f718fb1
| | parent: 1:82e55d328c8c
| | user: mpm@selenic.com
| | date: Mon May 05 01:20:46 2008 +0200
| | summary: Express great joy at existence of Mercurial
| |
o | changeset: 2:c3844fde99f0
|/ user: mpm@selenic.com
| date: Tue May 06 20:10:35 2008 +0200
| summary: Add description of hello.c
|
o changeset: 1:82e55d328c8c
| user: mpm@selenic.com
| date: Fri Aug 26 01:21:28 2005 -0700
| summary: Create a makefile
|
o changeset: 0:0a04b987be5a
user: mpm@selenic.com
date: Fri Aug 26 01:20:50 2005 -0700
summary: Create a standard "hello, world" program
The above ascii graphlog is way too useful. Especially if you are a DVCS newbie! As you understand I needed such a command for git. Luckily enough, a quick glance at git-log manual’s page revealed the following:
git log --graph
which renders the desired output (django-cms2’s repository):
* commit 0e2d41477ceeb4482b9743b61792d523034db586
| Author: Peter-Paul van Gemerden
| Date: Fri Nov 20 19:27:04 2009 +0000
|
| l10n: First version of the Dutch translation.
|
| This is a nearly complete and fairly natural Dutch translation. It's pretty consistent and there's very little 'forced' translations. I have tested it, but not thoroughly.
|
| Transmitted-via: Transifex (www.transifex.net)
|
* commit f91fc2cbbd2001d9ebbe5ac1e4df70567295294a
|\ Merge: c0f5c6e 51b8d27
| | Author: Patrick Lauber
| | Date: Fri Nov 20 09:17:34 2009 +0100
| |
| | Merge branch '2.0.X'
| |
| * commit 51b8d272f6202574062739d63d8626d184a9a4d3
| | Author: dstufft
| | Date: Fri Nov 20 07:41:48 2009 +0800
| |
| | fixed issue where pages 3+ levels deep wasn't stripping the home page slug
| |
| * commit 2a58eae233d82358b847ff99a1daf6bc4a5b7e8c
| | Author: stefanfoulis
| | Date: Tue Nov 3 22:44:18 2009 +0800
| |
| | added buildout stuff to gitignore
output snipped here
It would be intresting to find/match the most used commands/workflows while using mercurial and git and compare them. Maybe a feature post although I’m sure that if I google it a bit around, surely something like this will come up.
