Skip to content

feat: add git ai fetch-notes command for synchronous notes fetch#987

Open
Krishnachaitanyakc wants to merge 4 commits intogit-ai-project:mainfrom
Krishnachaitanyakc:implement/synchronous-git-ai-fetch-notes-command
Open

feat: add git ai fetch-notes command for synchronous notes fetch#987
Krishnachaitanyakc wants to merge 4 commits intogit-ai-project:mainfrom
Krishnachaitanyakc:implement/synchronous-git-ai-fetch-notes-command

Conversation

@Krishnachaitanyakc
Copy link
Copy Markdown
Contributor

@Krishnachaitanyakc Krishnachaitanyakc commented Apr 6, 2026

Summary

  • Adds a new user-facing git ai fetch-notes command that synchronously fetches AI authorship notes from a remote
  • Supports positional remote arg (git ai fetch-notes upstream), --remote <name> flag, and auto-detection of default remote
  • Includes --json output mode for programmatic use and --help for usage documentation
  • Added to git ai help output alongside existing commands

Details

Currently, notes fetching runs asynchronously in the background during git fetch and git pull hooks. This command provides a way to force a synchronous fetch of authorship notes, useful for:

  • Initial setup after cloning (when hooks didn't run)
  • Debugging missing notes
  • CI/CD pipelines that need notes available immediately
  • Scripting with --json output

Test plan

  • 8 new integration tests covering:
    • Default remote detection (no args)
    • Explicit remote as positional arg
    • --remote flag
    • --json output with no notes on remote
    • --json output with notes found
    • Human-friendly output with notes found
    • --help flag
    • Unknown option error handling
  • cargo fmt -- --check passes
  • cargo clippy --all-targets -- -D warnings passes
  • RUSTDOCFLAGS="-D warnings" cargo doc --no-deps passes

Closes #966


Open with Devin

@Krishnachaitanyakc Krishnachaitanyakc force-pushed the implement/synchronous-git-ai-fetch-notes-command branch from 2d1734e to 80b5e96 Compare April 6, 2026 16:22
Adds a user-facing `git ai fetch-notes` command that synchronously
fetches AI authorship notes from a remote. This complements the existing
async notes fetch that runs in the background during `git fetch`/`git pull`.

Closes git-ai-project#966
… coverage

- Reject duplicate remote specifications (positional + --remote flag)
- Include remote name in JSON error output when available
- Add tests for --remote missing value, duplicate remote, and JSON error paths
@Krishnachaitanyakc Krishnachaitanyakc force-pushed the implement/synchronous-git-ai-fetch-notes-command branch from 8e2c0a2 to 7ff0847 Compare April 6, 2026 18:03
@Krishnachaitanyakc Krishnachaitanyakc marked this pull request as ready for review April 6, 2026 21:35
devin-ai-integration[bot]

This comment was marked as resolved.

In --json mode, success responses go to stdout but error responses
were written to stderr via print_json_error. This meant programmatic
consumers capturing stdout got an empty string on error. Change
eprintln! to println! so all JSON output uses a single predictable
stream, with exit code indicating the outcome.
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

Successfully merging this pull request may close these issues.

Synchronous git ai fetch-notes command to force fetching notes

1 participant