You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gitdiffview, gitshowview, svndiffview display -h/-v output in view not on console #140
I'm not sure I understood the request — do you want to print the -v right in the header?
I ended up creating a wrapper script that not only solves this issue but also centralizes and organizes the scripts.
I am referring to -h/-vhelp/version output which normally displays on terminal screens, but piped to vim -R adds delay and appears unfriendly to me.
For example gitdiffview --help displays only a few lines without much detail, and gitdiffview --version dumps git diff help to stderr if not run in a repo directory, and pipes one filterdiff version line to vim -R.
And vim -R does not always exit cleanly, requiring a terminal reset to restore the screen!
Despite my being a *g*vim user, I am not a fan of vim -R, nor view, which seems even more limited and less reliable (quits as it does not like pipes nor some .vimrc profile commands!?), although described as similar to vim -R.
Hi, sorry for the detail and thanks for the report.
Ah, okay, , I’ve understood the problem but -v with not --version, is --verbose and -h is not --help
Anyway, if gitdiffview is not run in a repository directory, it can cause an issue. I’ll check if there’s something I can do about it.
In #143, I added an option to read the editor from the environment.
Currently, it only reads the EDITOR variable, or uses the default vim.
Any suggestions on how to handle environment variables?
Also please do not pipe to a pager if output is not a tty: it's annoying in pipelines!
Any command that ends up running git dumps help if not in a repo dir.
To be complete, you could use ${VISUAL:-${EDITOR:-vim}}; check if it is executable in the PATH, or use vim, or vi; for example use:
for e in ${VISUAL:-${EDITOR:-vim}} vim vi # or $VISUAL $EDITOR vim vi
do
type $e > /dev/null 2>&1 && break # allow aliases or functions
done
if [ -z "$e" ] # anti-vim/vi fanatic ;^>
then
...
else
...
fi
or equivalent in python/perl; use option -R if it contains vi; if it contains emacs, append --eval '(setq view-read-only t)' (don't know much about emacs).
Activity
sergiomb2 commentedon Oct 5, 2025
I'm not sure I understood the request — do you want to print the -v right in the header?
I ended up creating a wrapper script that not only solves this issue but also centralizes and organizes the scripts.
#143
BrianInglis commentedon Oct 5, 2025
I am referring to
-h/-vhelp/version output which normally displays on terminal screens, but piped tovim -Radds delay and appears unfriendly to me.For example
gitdiffview --helpdisplays only a few lines without much detail, andgitdiffview --versiondumpsgit diffhelp tostderrif not run in a repo directory, and pipes onefilterdiffversion line tovim -R.And
vim -Rdoes not always exit cleanly, requiring a terminalresetto restore the screen!Despite my being a
*g*vimuser, I am not a fan ofvim -R, norview, which seems even more limited and less reliable (quits as it does not like pipes nor some.vimrcprofile commands!?), although described as similar tovim -R.sergiomb2 commentedon Oct 14, 2025
Hi, sorry for the detail and thanks for the report.
Ah, okay, , I’ve understood the problem but -v with not --version, is --verbose and -h is not --help
Anyway, if gitdiffview is not run in a repository directory, it can cause an issue. I’ll check if there’s something I can do about it.
In #143, I added an option to read the editor from the environment.
Currently, it only reads the
EDITORvariable, or uses the defaultvim.Any suggestions on how to handle environment variables?
BrianInglis commentedon Oct 14, 2025
Also please do not pipe to a pager if output is not a tty: it's annoying in pipelines!
Any command that ends up running
gitdumps help if not in a repo dir.To be complete, you could use
${VISUAL:-${EDITOR:-vim}}; check if it is executable in thePATH, or usevim, orvi; for example use:or equivalent in
python/perl; use option-Rif it containsvi; if it containsemacs, append--eval '(setq view-read-only t)'(don't know much aboutemacs).(twaugh#140) Return error if one of the commands on pipes fails
sergiomb2 commentedon Oct 19, 2025
my next step will be improve usage of gitdiff, gitdiffview, gitshow, gitshowview, svndiff and svndiffview
(twaugh#140) Return error if one of the commands on pipes fails
(#140) Return error if one of the commands on pipes fails
(twaugh#140) Return error if one of the commands on pipes fails
(twaugh#140) bugfix: As chatgpt, I can't explain it any better.
(twaugh#140) bugfix: As chatgpt, I can't explain it any better.
(twaugh#140) bugfix: Pipes are only done from stdout to stdin
(twaugh#140) Return error if one of the commands on pipes fails
(twaugh#140) bugfix: Pipes are only done from stdout to stdin
Merge pull request #158 from sergiomb2/0.4.x
twaugh commentedon Jan 12, 2026
Fixed via #158