-
Notifications
You must be signed in to change notification settings - Fork 200
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
[verible-patch-tool] color the diffs/hunks presented to the user #526
Comments
b/161930379 |
@fangism I would like to work on this issue. Thanks :) |
Thank you. |
@DhairyaBahl had any time to look into this? |
@fangism I am extremely sorry for delay towards the issue. I will try my best to push a PR in a day or so. Thank you :) sorry again :) |
@fangism Work Update: I am trying to understand how verible works, about its various features to resolve this issue and to first understand the issue. I get that i have to change the color of the text or make it look more interactive but i am confused that how to change the colordiff if its installed by default in the system by the apt-get install commands. Kindly guide me a bit to how to approach this problem. Thanks a lot for having patience towards me :) |
The patch-tool is a small piece of the Verible project that is generic and only operates on patch files. The top-level main file is https://cs.opensource.google/verible/verible/+/master:common/tools/patch_tool.cc To build and run this:
A simpler demo (do all of the following from the same dir):
So let's start small, say only colorize the prompt: As for colorization itself, which is done by printing control characters to the terminal, see if there's a simple way to do it without introducing a library. You might research source code for other tools that colorize output. Do you they use a common library? or do their own thing?
Maybe report back with a few options before coding up an implementation. In the worst case, we may make a tiny colorize library for ourselves. |
@fangism I am trying to build my verible-patch-tool but it is showing following error : I thought this error was occuring because output_user_root contains spaces so i passed commands with different output_user_root="" commands but everytime it says unable to find flex binary Kindly guide me further, now I am moving to the passive part i.e. understand the codebase and other things u mentioned in the previous message. Thanks :) |
Strange, bazel is supposed to know how to fetch/build/install I wonder if this due to locally installed flex being an indirect dependency through Kythe. Try to @ivan444 in case you have any other suggestions. |
If i forgot to mention i would like to tell, I am on windows. Could that be an issue ? |
@fangism So do i have to install all kythe dependencies individually or there is any other option to build the patch tool. after installing the flex it is now giving this error: Thanks:) |
After installing Is there any other clue where "empty string" is coming from? I unfortunately have no experience building on Windows, but at least one contribution came from someone using Windows in the past. You might have to reach out to one of the bazel users mailing lists for help. |
According to these files: It's looking for |
Yes I can run flex --help it is showing other possible flags like --version
I have no idea, i am working for the first time on bazel itself
Okay, I guess I should join the mailing list now !! @fangism Thanks |
I have set the environment variables for the system so that they can find flex. however I've also made it available for the mingw64 in its local bin directory !! Should environment variable still be an issue ?? @fangism Thanks |
I don't really know myself, unfortunately. The kythe project I referenced is at https://github.com/kythe/kythe -- they might have some idea about to control the locations of flex/bison. I'm trying to think if there's a way for you to locally patch out the kythe dependency, because you don't need it for this task. |
@fangism I tried and it worked, but now its showing new erro: The target you are compiling requires Visual C++ build tools. Visual C++ build tools seems to be installed at C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC Please check your installation following https://docs.bazel.build/versions/master/windows.html#using I guess, i should reinstall the Microsoft Visual studio package again or only the missing files if i can !! and should read the documentation linked by the bazel and try to fix it myself. Thanks :) |
Ok, that's progress, I'm glad there some documentation to guide you. |
We'll have to do something about those Kythe dependencies. The introduced complexity is not appropriate. I'll address it together with reducing the c++ build requirements (lowering it from c++17 to c++11). |
@fangism bazel needs some tools for which i have to install latest version of C++ redistributable build tools 2019 but my pc doesn't support it. It only support till 2015 version. What should i do ?? Is there any alternative to bazel ?? or any other way to build without using bazel then kindly tell me. Thanks |
At this time we can only support bazel building, I'm afraid. Thanks for trying. |
@fangism I will try one more time to install this package with bazel, if I failed then I will unassign myself :) |
@fangism I am extremely sorry for inconvenience. I won't be able to solve this issue, because I am unable to solve the problem of bazel for the time-being. Thank you for your time and effort :) |
@DhairyaBahl Thanks for the update, and thanks again for trying. Some day our build support for VS will improve. |
First attempt on solving chipsalliance#526. Still rough but relatively clean to get started.
First attempt on solving chipsalliance#526. Still rough but relatively clean to get started.
First attempt on solving chipsalliance#526. Still rough but relatively clean to get started.
First attempt on solving chipsalliance#526. Still rough but relatively clean to get started.
…atting Color the diffs/hunks presented to the user #526
For the underlying patch-tool described here:
https://github.com/google/verible#interactive-formatting
It would be nice if the diff could be colorized for readability. Currently it is monochrome.
Example mock-up using (github markdown's default coloring):
Would also color the prompt
Apply this hunk?
a little differently like this (dark-themed):Task:
isatty()
, and only apply colors in this case.The text was updated successfully, but these errors were encountered: