Skip to content

Conversation

@dgutov
Copy link
Owner

@dgutov dgutov commented Oct 17, 2025

Fixes #250

@dgutov
Copy link
Owner Author

dgutov commented Oct 17, 2025

@whhone Hi!

Aside from test failures, does this change look good for you? Previously you submitted this code change in #248.

I think the proposed keeps buffer-local diff-hl-reference-revision working, but if you had any other such vars which would stop working, please chime in.

@whhone
Copy link
Contributor

whhone commented Oct 17, 2025

This change looks very good to me. Passing a revision just avoids hitting the buffer-local issue.

I also patched and verified it works. Thanks @dgutov !

@dgutov
Copy link
Owner Author

dgutov commented Oct 17, 2025

Thanks for checking.

A test reminds, though, that this way we might dropping support for buffer-local values of vc-hg-program, for example. Is that an issue?

@whhone
Copy link
Contributor

whhone commented Oct 17, 2025

You are right. buffer-local vc-hg-program does not work after this change. It is indeed not ideal.

@dgutov
Copy link
Owner Author

dgutov commented Oct 19, 2025

I can revert that part, if that's needed.

Something of note, however, is that the Git implementation, and the newly added Jj one, don't support buffer-local values for their corresponding programs. Should we fix that too?

Maybe we could come up with a shared solution.

@whhone
Copy link
Contributor

whhone commented Oct 22, 2025

I believe JJ and git already respect buffer-local variables since they do not switch to a temp buffer.

For example, you can try setting vc-git-program or vc-jj-program as a buffer-local variable and see if they are being respected.

@dgutov
Copy link
Owner Author

dgutov commented Oct 23, 2025

Is Git really not affected?

diff-hl-resolved-reference-revision calls vc-git--rev-parse, whose definition is wrapped in with-temp-buffer.

Similarly for vc-jj--process-lines.

you can try setting vc-git-program or vc-jj-program as a buffer-local variable and see if they are being respected

Doesn't seem to have effect after setq-local.

@whhone
Copy link
Contributor

whhone commented Oct 23, 2025

Ops... I did not go into the implementation detail of vc-git--rev-parse and vc-jj--process-lines.

I don't have strong opinion on respecting respecting buffer-local variables or not. I can find workaround in my case. Thanks!

@dgutov
Copy link
Owner Author

dgutov commented Oct 24, 2025

All right, then I'm merging now.

Open to revisiting this issue later, preferably with a solution that handles vc-git-program as well.

@dgutov dgutov merged commit b2a57ac into master Oct 24, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

diff-hl-show-hunk* doesn't work correctly with jj

2 participants