Go to the first, previous, next, last section, table of contents.

gitredir

gitredir is a very small script that fools the git program, makeing it believe that the command started wrote something to standard error. It was not designed to be used as a stand alone program.

gitredir is useful for programs like du. We are interested in du's output and we would like to write to the status line its output (especially the output of the 'du -s' command). Normally, this is not possible because 'du -s' will display the information on the standard output (git catches only standard error) and will exit with the exit code 0. git will display the standard error contents on the status bar only if the program exit status is not 0.

So, gitredir starts a program, sends its standard output through a pipe to a subshell which read from the pipe and write to standard error. After that, gitredir exits with the exit code 1. This way, git thinks that an error occured and display the standard error redirection file to the status bar. Stupid, but useful.

See section Configuration Files,
See section git,
See section gitps,
See section gitview,
See section gitcmp,
See section gitkeys,
See section gitmount,
See section gitmatch,
See section gitaction,
See section .gitaction.

Go to the first, previous, next, last section, table of contents.