Diff command - #2476
Conversation
There was a problem hiding this comment.
Codex Review: Here are some suggestions.
Reply with @codex fix comments to fix any unresolved comments.
About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request that is ready for review, or mark a draft as ready for review. You can also ask for a review by commenting "@codex review".
Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".
|
|
||
| /// Returns the closest git sha to HEAD that is on a remote as well as the diff to that sha. | ||
| pub async fn git_diff_to_remote(cwd: &Path) -> Option<GitDiffToRemote> { | ||
| let is_git_repo = run_git_command_with_timeout(&["rev-parse", "--git-dir"], cwd) |
There was a problem hiding this comment.
Hmm, should run_git_command_with_timeout() add these env vars like we do in the unit tests:
let envs = vec![
("GIT_CONFIG_GLOBAL", "/dev/null"),
("GIT_CONFIG_NOSYSTEM", "1"),
];
There was a problem hiding this comment.
I don't think so. We don't for other non-test use cases. I think we set these for tests so local git settings don't interfere with tests but when not in a test, we want this to respect their git settings.
|
|
||
| #[derive(Serialize, Deserialize, Clone, Debug)] | ||
| pub struct GitDiffToRemote { | ||
| pub sha: String, |
There was a problem hiding this comment.
Consider sha1::Digest as the type instead of String.
| .lines() | ||
| .map(|s| s.to_string()) | ||
| .collect(); | ||
| for file in untracked { |
There was a problem hiding this comment.
Consider running these in parallel?
|
|
||
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, TS)] | ||
| #[serde(rename_all = "camelCase")] | ||
| pub struct GitDiffToRemoteParams { |
There was a problem hiding this comment.
Create a specific response type?
No description provided.