You are here

Grok Blog - Redmine, git diffs and the environment

Submitted by blogmeister on Thu, 28/09/2017 - 15:51

I changed the program in my .profile used by git diff to one of my own, which caused the breakage of Redmine’s diffs. Redmine has an interface that makes it easy to display diffs between commits which are far apart, and I have opted to upload a lot of my repos to a Redmine installation to take advantage of it. It isn’t even necessary for the repo to be on the same system, thanks to a plugin from a nice man at Github

# environment variables
GIT_EXTERNAL_DIFF=$HOME/bin/ssdiff.sh
export GIT_EXTERNAL_DIFF

In ssdiff.sh I have opted vimdiff -R which displays the side by side diffs I prefer, snarfed from somewhere.

ssdiff.sh
#!/bin/bash
# un-comment one diff tool you'd like to use

# side-by-side diff with custom options:
# /usr/bin/sdiff -w200 -l "$2" "$5"

# using kdiff3 as the side-by-side diff:
# /usr/bin/kdiff3 "$2" "$5"

# using Meld
# /usr/bin/meld "$2" "$5"

# using VIM
/usr/bin/vim -dR "$2" "$5"

# icdiff
# icdiff -N "$2" "$5"

This resulted in diffs in the Redmine app not working.

The moral of the story is something breaks in your Redmine app don’t be so quick to blame it on a bug.

Which leads to the next question. How do you configure a set of environment variables for Rails app which is independent of your profile settings?

ORDERED_LIST_KEYWORDS = {
  'loweralpha' => 'a',
  'lowerroman' => 'i',
  'upperalpha' => 'A',
  'upperroman' => 'I'
   #'lowergreek' => 'a'
   #'arabic'     => '1'
   #'decimal'    => '1'
}

Vertical Tabs

Add new comment