tibirna / qgit

Official git repository for QGit.
Other
174 stars 68 forks source link

How to use with custom diff commands? #45

Open bonanza123 opened 6 years ago

bonanza123 commented 6 years ago

Sorry if this sounds like a question and not an issue, but maybe it could results in an updated documentation or some new feature.

I have a couple of custom diff commands (e.g. using word-diff and special diff-commands for .tex files) defined in ~/.gitconfig. How can I use them in qgit?

[alias]
    wdiff = diff --color-words --word-diff --patience
filiperinaldi commented 6 years ago

That would require quite a bit of re-work. QGit looks for the first character on each line of the diff to decide whether to colour it green, red or leave it plain. Custom diff commands will have different diff outputs and some of them you can only tell the diff based on the colour itself (you can't just parse the raw content). I suppose one way to support such feature would be to somehow use the coloured output from the "git diff" and use it directly in QGit (as oposed to QGit colouring it based on the +/- characters).

felixwiemuth commented 1 year ago

I would also appreciate different diff formats, especially having the "color words" mode which gitk supports.

Using the coloured output of git diff seems like a good idea and should be rather straight-forward?

tibirna commented 1 year ago

@felixwiemuth Thanks for your interest in this. Generating diff representations is a non-trivial topic. To high development investment, it was a long-time goal of mine to make use of an already existing diff widget (like the KDE "kpart" available in Kompare (https://apps.kde.org/kompare/ -- the screenshot on that page doesn't make it justice). It still remains to be done. I agree that the current diff tool is simplistic. Any help is appreciated, of course.