wfxr / forgit

:zzz: A utility tool powered by fzf for using git interactively.
MIT License
4.4k stars 137 forks source link

Handle .gitconfig pager attribute. #103

Closed vedang closed 4 years ago

vedang commented 4 years ago

The existing script handles the core.pager attribute, but does not account for the pager attribute in git-config. Tools like diff-highlight which ship with git recommend using the pager attribute, and provide beautiful diffs.

I've made minor changes in the script to use these configuration parameters if they are defined.

Ref: https://github.com/git/git/tree/master/contrib/diff-highlight

Check list

Description

Description is part of the commit message above. This change lets me use diff-highlight tool to show beautiful diffs.

Type of change

Test environment

wfxr commented 4 years ago

@vedang Thank you. This would be a good improvement.

cjappl commented 4 years ago

Thanks! Will complete this on Monday

On Sat, Aug 8, 2020 at 12:40 AM Wenxuan notifications@github.com wrote:

Assigned #103 https://github.com/wfxr/forgit/pull/103 to @cjappl https://github.com/cjappl.

— You are receiving this because you were assigned.

Reply to this email directly, view it on GitHub https://github.com/wfxr/forgit/pull/103#event-3635452522, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADMDXY362ZAKLBW3XVOD5NLR7T6NDANCNFSM4PYQJMVQ .

cjappl commented 4 years ago

Hi @vedang!

thanks for the great PR.

Just so I know that I've copied the behavior exactly, can you describe how you have your .gitconfig set up to have this functionality?

Is it just like in that link you sent, you have a section that is something like:

[pager]
    log = diff-highlight | less
    show = diff-highlight | less
    diff = diff-highlight | less

Also, would you add a screenshot of what the output of forgit looks like with this set up properly?

Thanks a lot!

vedang commented 4 years ago

Yes,

I have the pager section exactly as mentioned in the link (as you've copied over)

I have the compaction heuristic diff config as well. I'll share the relevant sections of ths gitconfig and the screenshots once I'm in front of my computer.

/vedang (Sent from my phone, please excuse brevity)

On Mon, Aug 10, 2020, 10:06 PM Chris Apple notifications@github.com wrote:

Hi @vedang https://github.com/vedang!

thanks for the great PR.

Just so I know that I've copied the behavior exactly, can you describe how you have your .gitconfig set up to have this functionality?

Is it just like in that link you sent, you have a section that is something like:

[pager] log = diff-highlight | less show = diff-highlight | less diff = diff-highlight | less

Also, would you add a screenshot of what the output of forgit looks like with this set up properly?

Thanks a lot!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/wfxr/forgit/pull/103#issuecomment-671460812, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAUUHU2MO5KQETLMKM4V3DSAAOYBANCNFSM4PYQJMVQ .

cjappl commented 4 years ago

Awesome thanks! Look forward to seeing the screenshot. I’ll get rolling on this tomorrow

On Tue, Aug 11, 2020 at 8:00 AM Vedang Manerikar notifications@github.com wrote:

Yes,

I have the pager section exactly as mentioned in the link (as you've copied over)

I have the compaction heuristic diff config as well. I'll share the relevant sections of ths gitconfig and the screenshots once I'm in front of my computer.

/vedang (Sent from my phone, please excuse brevity)

On Mon, Aug 10, 2020, 10:06 PM Chris Apple notifications@github.com wrote:

Hi @vedang https://github.com/vedang!

thanks for the great PR.

Just so I know that I've copied the behavior exactly, can you describe how you have your .gitconfig set up to have this functionality?

Is it just like in that link you sent, you have a section that is something like:

[pager] log = diff-highlight | less show = diff-highlight | less diff = diff-highlight | less

Also, would you add a screenshot of what the output of forgit looks like with this set up properly?

Thanks a lot!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/wfxr/forgit/pull/103#issuecomment-671460812, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AAAUUHU2MO5KQETLMKM4V3DSAAOYBANCNFSM4PYQJMVQ

.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/wfxr/forgit/pull/103#issuecomment-671998947, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADMDXY3TMCZTFGH6BUIM273SAFMJHANCNFSM4PYQJMVQ .

vedang commented 4 years ago

Hello! I know I'm late to this, but here is a screenshot and the relevant parts of my gitconfig:

Screen Shot 2020-08-14 at 8 36 23 AM
[diff]
    compactionHeuristic = true
[pager]
    log = diff-highlight | less
    show = diff-highlight | less
    diff = diff-highlight | less
[interactive]
    diffFilter = diff-highlight
cjappl commented 4 years ago

Awesome! I think i got it all sorted, but I appreciate the follow up.

Thanks for contributing!

On Thu, Aug 13, 2020 at 8:14 PM Vedang Manerikar notifications@github.com wrote:

Hello! I know I'm late to this, but here is a screenshot and the relevant parts of my gitconfig:

[image: Screen Shot 2020-08-14 at 8 36 23 AM] https://user-images.githubusercontent.com/84510/90209627-81160f80-de09-11ea-9c30-99831cc5f1ea.png

[diff]

compactionHeuristic = true

[pager]

log = diff-highlight | less

show = diff-highlight | less

diff = diff-highlight | less

[interactive]

diffFilter = diff-highlight

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/wfxr/forgit/pull/103#issuecomment-673859276, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADMDXY2LNBDICB5CBITCBRDSASTY7ANCNFSM4PYQJMVQ .