-
Notifications
You must be signed in to change notification settings - Fork 4
feat: Add remote management, fetch, and push subcommands #59
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
base: main
Are you sure you want to change the base?
Conversation
- Implement remote add/remove/rename/set-url/show operations - Add fetch and push subcommands for remote synchronization - Create remote_wrapper class for RAII management - Add comprehensive test suite (19 tests, all passing) - Fix CMakeLists.txt to find CLI11 in conda/pixi environment Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
fa573f4 to
6ef5d64
Compare
src/subcommand/fetch_subcommand.cpp
Outdated
| int sideband_progress(const char* str, int len, void*) | ||
| { | ||
| printf("remote: %.*s", len, str); | ||
| fflush(stdout); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer C++ standard streams.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think the agent adopted some of the style of the codebase which uses printf:
ag printf
src/subcommand/clone_subcommand.cpp
21: printf("remote: %.*s", len, str);
src/subcommand/merge_subcommand.cpp
173: printf("Merge made\n");
src/subcommand/fetch_subcommand.cpp
Outdated
|
|
||
| if (git_oid_is_zero(a)) | ||
| { | ||
| printf("[new] %.20s %s\n", b_str, refname); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer C++ standard streams.
src/subcommand/fetch_subcommand.cpp
Outdated
| { | ||
| git_oid_fmt(a_str, a); | ||
| a_str[GIT_OID_SHA1_HEXSIZE] = '\0'; | ||
| printf("[updated] %.10s..%.10s %s\n", a_str, b_str, refname); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
src/subcommand/fetch_subcommand.cpp
Outdated
|
|
||
| int fetch_progress(const git_indexer_progress* stats, void* payload) | ||
| { | ||
| static bool done = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notice that this will prevent to use this function with many fetches . Since we're not going to implement it in this PR, I think it's fine for now, but you should add a note about it, stating this needs refactoring in order to be usable from mutiple fetches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. The agent must have taken some inspiration from those current uses.
Signed-off-by: Julien Jerphanion <git@jjerphan.xyz> Co-authored-by: Johan Mabille <johan.mabille@gmail.com>
add,remove,rename,set-url,showoperationsfetchandpushsubcommands for remote synchronizationremote_wrapperclass for RAII managementNote that 6ef5d64 was generated.