Generator-jhipster: File Diff not refreshing after manual change(s)

Created on 13 Feb 2020  路  8Comments  路  Source: jhipster/generator-jhipster

Overview of the issue

When I upgrade an existing project with jhipster command, a diff tool command line program is used to compare files to find the difference(s).

Like that :
? Overwrite pom.xml? (ynaxdH)

This diff tool used to refresh the differences everytime the user press d key.
This is not the case, as of jhipster v6.7.0.

Motivation for or Use Case

Sometime you want to manually correct the difference in your file and to check if everything is ok you use the embedded diff tool.

Reproduce the error

Upgrade an existing jhipster project using the new v6.7.0. In a file where there is changes, press d. Manually change a line and press d again. The diff is NOT reflecting the changes.

Related issues
JHipster Version(s)

v6.7.0

Browsers and Operating System

OS : Windows 10
Command line : cmd.exe

  • [ X ] Checking this box is mandatory (this is just to show you read everything)
area jhipster-internals

All 8 comments

This is something provided directly by yeoman, it is not provided by JHipster.
Not sure we can do something on our side...

Looks like you are using jhipster upgrade. Correct?
Its all git magic. There is nothing we can do.

@mshima : I don't think so. I think @unknownboy used simply jhipster command and saw the prompt ? Overwrite pom.xml? (ynaxdH) ; then, he tried to modify manually the diff but Yeoman still compared to the file which is in memory, not the new one

@mshima : I don't think so. I think @unknownboy used simply jhipster command and saw the prompt ? Overwrite pom.xml? (ynaxdH) ; then, he tried to modify manually the diff but Yeoman still compared to the file which is in memory, not the new one

Yep, exactly.

What was jhipster version with this old behavior?

Release 6.5.1 fore sure but I guess v6.6.0 had it too.

This is related to yeoman.
But it shouldn't had any behavior change on yeoman part too.

This is where diff is chosen:
https://github.com/yeoman/generator/blob/668d91fbcab5ec1cf801317e6676bccab24e559d/lib/util/conflicter.js#L311

The file should be loaded just before printing the diff:
https://github.com/yeoman/generator/blob/668d91fbcab5ec1cf801317e6676bccab24e559d/lib/util/conflicter.js#L136

Looks like a cache problem to me.
It shouldn't be difficult to add an option to reload the file, but I don't think it will help if there is a cache problem.
You can post a feature request there.

This is not related to jhipster.
If you want to move this conversation forward, post it in https://github.com/yeoman/generator/issues
I can handle from there.
Closing

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SudharakaP picture SudharakaP  路  3Comments

SudharakaP picture SudharakaP  路  3Comments

marcelinobadin picture marcelinobadin  路  3Comments

shivroy121 picture shivroy121  路  3Comments

frantzynicolas picture frantzynicolas  路  3Comments