Feature: Add git diff#18
Conversation
|
The diff generation using |
|
It's also possible to use the system-installed find_package(libgit2 CONFIG REQUIRED)This comes from Not sure which approach is better -- system package vs FetchContent. |
Yes, using a system-installed library seems like a good idea as well. I think we can leave this decision to the end user. Therefore, if a user already has libgit2-dev installed, we can use the find_package approach; otherwise, we can use FetchContent. What do you think? Let me know your opinion about it. |
Yeah, it sounds good to me. I'll update the PR with this new feature. |
I liked this solution of having a callback for |
Introduce the git-diff command to compare duplicate functions through a unified git-style patch output powered by libgit2. The command resolves function name patterns against the similarity table, validates that both functions are marked as duplicates, and renders a colored diff directly in the CLI. Add support for: - function pattern normalization using :: separators - ambiguity detection for multiple matches - git-style hunk and file headers - colored additions and deletions - empty diff reporting Also register the new command in the orchestrator command map and expose the corresponding CLI metadata and help text. Signed-off-by: Gabriel Almeida <gabrielsousa230@gmail.com>
Signed-off-by: Gabriel Almeida <gabrielsousa230@gmail.com>
6c1ddf2 to
3a30321
Compare

Refers to #1
This PR is related to a new feature in Arkanjo. Now, it is possible to see the diff, like the git diff command, between two functions marked as similar from the Arkanjo preprocessor. For this resource, it was used the libgit2 project as git tool.
How to use:
After running the
arkanjo preprocessorcommand, the git-diff command is ready to be used. The syntax is arkanjogit-diff <function_1_name> <function_2_name>.For those cases when there are multiple functions with the same name, it is also possible to pass the full path provided by the tool to see the git diff.