Groesbeek, view of the 'National Liberation Museum 1944-1945' in Groesbeek. © Ton Kersten
Fork me on GitHub

Editing files and posting to git

2009-04-09 (10) by Ton Kersten, tagged as old

A couple of days ago I posted that I was converting to git. Well, that was not the completely truth. I already had switched to git.

But what I didn't like was the fact that git doesn't support keyword-expansion and therefore there's no way of knowing what version of the file you are editing. I do like this in CVS and SVN, so I implemented it in a script called vigit.

What vigit does is let you edit a file and when you quit it (after saving of course) it commits the file to git, get's the git-hash and replaces this in the file (if it's already there).

The only drawback is that the files in git are not identical to the ones on disk. I have to find a solution for this.

When you use the header script, this will give you a box with all the supported keywords. This box looks similar to:

#                    V e r s i o n   i n f o r m a t i o n                     #
# $Id:: vigit 14 2009-02-26 12:53:11Z tonk                                  $: #
# $Revision:: 14                                                            $: #
# $Author:: Ton Kersten <>                        $: #
# $Date:: 2009-02-26 13:53:11 +0100 (Thu, 26 Feb 2009)                      $: #
# $Hash:: vigit e2963ac 2009-02-26 13:37:17 +0100 tonk                      $: #
#             E n d   o f   v e r s i o n   i n f o r m a t i o n              #

Get vigit here.