Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional diff representation like GNU diff #24026

Closed
1 task done
mbrandl87 opened this issue Oct 27, 2023 · 3 comments · Fixed by #24020
Closed
1 task done

Additional diff representation like GNU diff #24026

mbrandl87 opened this issue Oct 27, 2023 · 3 comments · Fixed by #24020

Comments

@mbrandl87
Copy link

Overview of the feature request

It would be really helpful if there was a possibility to have diffs represented like GNU diff does with < and > instead of colouring.
It would be even nicer if there was also paging involved.

Motivation for or Use Case

When the generator detects a file conflict and asks if it should overwrite or diff, as a blind user I am almost unable to tell what changed as it just uses different colours.
If you could pipe the files into the diff command, it would be way easier to grasp.
If "more" or "less" could enter the game as well, I wouldn't have to hit shipft+page-up dozens of times just to get at the beginning. :)

Or does that already work and there is a setting I just didn't find sofar? :)

Related issues or PR
  • Checking this box is mandatory (this is just to show you read everything)
@mshima
Copy link
Member

mshima commented Oct 28, 2023

I’ve changed to show the diff similar to git using +/- prefixes.
The pagination would probably involve opening an outside command like less.
It could be implemented as an additional option here https://github.com/yeoman/yeoman-api/blob/36746f8c49fe56c1971decf29b6c493ec4cf0d17/workspaces/conflicter/src/conflicter.ts#L362

@mbrandl87
Copy link
Author

Thx that was really quick :) I guess that will be in the next JHipster release?

I think I found the location inside the logger where a function using a pager could be added and also a simple npm dependency feeding an outside pager. Maybe I'll try to do a PR if its ok.

I haven't read all the code so far, is there anything simpler to try it out than getting jhipster main and include my changed version, create a project and trigger a diff? Something at the tests maybe?

@mshima
Copy link
Member

mshima commented Oct 31, 2023

Tests are not interactive.
Many times I start by changing the code directly inside node_modules.
Since the project is inside a monorepository, I don’t know the best approach, I think linking and install from git doesn’t work.

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

Successfully merging a pull request may close this issue.

3 participants