Defect #8940

git shell out hangs if commit message is too long

Added by Anonymous almost 11 years ago.

Status:NewStart date:2011-07-28
Priority:NormalDue date:
Assignee:-% Done:


Target version:-
Resolution: Affected version:1.2.1


Redmine Version: 1.2.1
Git Version:

When running Repository#fetch_changesets on a Git repository, it will shell out to get the comments for the changeset. It runs something like:

git --git-dir /home/example/git/example.git log --no-color --encoding=UTF-8 --raw --date=iso --pretty=fuller --reverse 4e6f0873e74e2db0e9f5825dad73ff2e66ae264a..master

By default git log uses the the default system pager (more?). If the message is longer than a "page", the shellout command will land in the pager and hang there forever.

You can set the GIT_PAGER=cat environment variable but it's unclear in the SCM adapter how to set environment variables. Another workaround is to have the user set the user's core.pager to cat in the ~/.gitconfig.

For my own fork ( I sent the environment variable directly to the cmd variable set by IO.popen, but this is an ugly hack and it would be better if there were an easy way to set environment variables in the SCM adapters. Is there?

Also available in: Atom PDF