Skip to content

gitdiffview, gitshowview, svndiffview display -h/-v output in view not on console #140

Closed

Description

@BrianInglis

Could we please bypass view when displaying gitdiffview, gitshowview, svndiffview -h/-v output?

Activity

  1. sergiomb2 commented on Oct 5, 2025

    @sergiomb2
    Contributor

    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

  2. BrianInglis commented on Oct 5, 2025

    @BrianInglis
    ContributorAuthor

    I am referring to -h/-v help/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.

  3. sergiomb2 commented on Oct 14, 2025

    @sergiomb2
    Contributor

    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?

  4. BrianInglis commented on Oct 14, 2025

    @BrianInglis
    ContributorAuthor

    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).

  5. added a commit that references this issue on Oct 19, 2025
  6. sergiomb2 commented on Oct 19, 2025

    @sergiomb2
    Contributor

    For example gitdiffview --help displays only a few lines without much detail, and gitdiffview --version dumps git

    my next step will be improve usage of gitdiff, gitdiffview, gitshow, gitshowview, svndiff and svndiffview

  7. added 2 commits that reference this issue on Oct 21, 2025
  8. added 6 commits that reference this issue on Dec 30, 2025
  9. added a commit that references this issue on Jan 12, 2026
  10. twaugh commented on Jan 12, 2026

    @twaugh
    Owner

    Fixed via #158

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions