Code Monkey home page Code Monkey logo

Comments (3)

dandavison avatar dandavison commented on June 12, 2024

Hi @infokiller, nice to hear from you. I view it as desired behavior, not a bug, that git does not use delta when output is going to a pipe: IMO delta's output is for humans to read, not for machines to parse, so there are few scenarios when one wants delta's output to go to a pipe/file. Do you have such a scenario?

As you say, the way this (IMO desired) behavior is achieved is that git itself doesn't invoke its pager when output is not a tty (because the git authors view the pager output as for human eyes, not machines). That means also that there's a simple solution for the cases when one does want delta's output to go to a pipe: pipe it into delta explicitly:

git diff | delta | head

So I'm definitely happy to hear ideas about GIT_EXTERNAL_DIFF, but I'm going to close this since I don't think delta should change anything regarding this behavior. But do feel free to reopen.

from delta.

dandavison avatar dandavison commented on June 12, 2024

That said there is something fairly esoteric in one of the end-to-end tests that does what you're asking for I think!

# Trick git and delta into invoking their pager child processes, despite
# output not being a tty.
script -q /dev/null git -c pager.log="$DELTA" log -p HEAD~2...HEAD > /dev/null
?

from delta.

infokiller avatar infokiller commented on June 12, 2024

Hi @dandavison great to talk to you again and thanks for the quick response!
My use case was using it for fzf previews. Indeed, both of your suggestions work fine for this use case, thanks!

from delta.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.