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

Keep original files. #44

Closed
leoheck opened this issue Mar 14, 2021 · 13 comments
Closed

Keep original files. #44

leoheck opened this issue Mar 14, 2021 · 13 comments

Comments

@leoheck
Copy link
Contributor

leoheck commented Mar 14, 2021

The option to keep svg keeps only the diff. Is it possible to keep the 2 original versions too?

@leoheck
Copy link
Contributor Author

leoheck commented Mar 14, 2021

Can you guide me on what I should do to be able to do that? This language is so complex haha.

@leoheck
Copy link
Contributor Author

leoheck commented Mar 14, 2021

I would like to test how this can work with Kidiff, but I need to get original images instead of the final diff.

@jnavila
Copy link
Owner

jnavila commented Mar 14, 2021

If you use the internal diff, then none of the original version are generated, because this isn't the internal format used to compute the difference. If you use the external diff (which would be the good way), the versions are generated on disk, ready to be diffed, so it is just up to you to modify the diffing script in order to put both created files into their respective directories. You don't need to fiddle with the source of plotgitsch in the last case.

@leoheck
Copy link
Contributor Author

leoheck commented Mar 15, 2021

I am not aware of those internal/external diffs.
I just want to have the svg from both commits and also the final svg with the diff as the outputs of the tool.
For instance, the -k flag could save these extra 2 files for the user. what do you think?
If it is not needed to change the tool, Can you show me an example of the command line to generate these extra svgs?

@leoheck
Copy link
Contributor Author

leoheck commented Mar 19, 2021

So, I never knew I could omit -i flag. Alright, doing this it is opening with the image with the ImageMagic tool it is creating these 2 images from_board.svg and to_board.svg. But ImageMagickc remains open. How can I close ImageMagick automatically or avoid it from opening? Any idea?

It displays this before opening ImageMagic
use compare (ImageMagick) between bitmaps between Git rev HEAD and Git rev HEAD~1

@leoheck
Copy link
Contributor Author

leoheck commented Mar 19, 2021

For instance, this is the output window that remains open after the operation.
IT is called from_board.svg, but it has the 3 things. from, to, and dff.
image

@jnavila
Copy link
Owner

jnavila commented Mar 21, 2021

Hello,

Sorry to be late and not responsive. You are free to define the diffing program as you want. For instance, instead of generating the diff and displaying it, you can simply copy the svg files to another location.

Combining a call with the -i option in order to get a diff image and one without the -i option with a selected "comparison" program would get you the two versions and the diff.

@leoheck
Copy link
Contributor Author

leoheck commented Mar 21, 2021

Sorry, but I believe this is not right.

The -i flag is not passing a diff tool but as a visualization tool.

For instance, your examples have this -ifirefox then it opens the generated file which is diff_board.svg only.

I can use the -iinkscape for instance to open it directly on Inkcaspe.
I can also use -iecho then it will display the parameters this -i flag is going to take from plotgitsch which is diff_board.svg only.

If this -i was considering a diff tool instead of a visualization tool it would pass 2 files, (to_board.svg and from_board.svg). Unless this is a bug which makes sense.

For instance, for the sake of comparison, I would like to use the textual diff as the diff tool. Then I would use like -idiff to have a textual diff from these 2 image files. But this wont work since it is taking only one argument.

image

@leoheck
Copy link
Contributor Author

leoheck commented Mar 21, 2021

Also, I would like to keep the original svgs of each board even if we don't have any diff. We could have a flag for that.

@leoheck
Copy link
Contributor Author

leoheck commented Mar 21, 2021

I was able to make a version that generates these images even if we don't see any diff.
I was not able to fix this -i flag. Opam is too complex for me. I was also able to change git-imagediff to save/keeep 3 svgs at the end. But having this by default on this repo would be nice. At least fixing this -i thing that is not a diff tool but a visualization tool. Or by adding another flag to be able to set the diff tool, then I would be able to make a script that saves these images instead of making the diff.

@jnavila
Copy link
Owner

jnavila commented Mar 21, 2021

Sorry, I wasn't clear enough. About the diffing program, I was the referring to the case you don't use the -i option. Then the git-imgdiff need not be the one that is provided by the project. If you override the "$PATH" environment variable and provide a git-imgdiff of your own with the behaviour that you desire, then you can have access to svg files of both revisions.

@jnavila
Copy link
Owner

jnavila commented Mar 21, 2021

Or by adding another flag to be able to set the diff tool, then I would be able to make a script that saves these images instead of making the diff.

That's a good option. I'll have a look at doing it (don't expect it soon though).

@leoheck
Copy link
Contributor Author

leoheck commented Mar 21, 2021

Sorry, I wasn't clear enough. About the diffing program, I was the referring to the case you don't use the -i option. Then the git-imgdiff need not be the one that is provided by the project. If you override the "$PATH" environment variable and provide a git-imgdiff of your own with the behaviour that you desire, then you can have access to svg files of both revisions.

Oh, ok. This makes sense. Thanks for explaining.
Alright, I am creating my version of git-diffimg and pre-pending this on PATH.
This will work for me. Thank you one more time.

@leoheck leoheck closed this as completed Mar 21, 2021
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

No branches or pull requests

2 participants