Skip to content

Conversation

@9999years
Copy link

This can happen with submodules.

Closes #3

Before:

Error: Failed to collect commits from repository

Caused by:
    0: Object find error: An object with id fdb30228b1dc649ab1c2086d146ef9dd0ab584e6 could not be found
    1: An object with id fdb30228b1dc649ab1c2086d146ef9dd0ab584e6 could not be found

After:

⠋ Collecting commits...                                                                                   Warning: Object find error: An object with id fdb30228b1dc649ab1c2086d146ef9dd0ab584e6 could not be found
⠦ Collecting commits...                                                                                   Warning: Object find error: An object with id fc412cbdf765175ea9f3380db6b9e1b1603a68a7 could not be found
⠤ Collecting commits...                                                                                   Warning: Object find error: An object with id b699a7e01c253ffb7818b02d62bce24190ec1019 could not be found
⠁ Collecting commits...                                                                                   Warning: Object find error: An object with id b699a7e01c253ffb7818b02d62bce24190ec1019 could not be found
  Commits collected

Not the prettiest, but better than a crash!

This can happen with submodules.

Closes seeyebe#3

Before:

```
Error: Failed to collect commits from repository

Caused by:
    0: Object find error: An object with id fdb30228b1dc649ab1c2086d146ef9dd0ab584e6 could not be found
    1: An object with id fdb30228b1dc649ab1c2086d146ef9dd0ab584e6 could not be found
```

After:

```
⠋ Collecting commits...                                                                                   Warning: Object find error: An object with id fdb30228b1dc649ab1c2086d146ef9dd0ab584e6 could not be found
⠦ Collecting commits...                                                                                   Warning: Object find error: An object with id fc412cbdf765175ea9f3380db6b9e1b1603a68a7 could not be found
⠤ Collecting commits...                                                                                   Warning: Object find error: An object with id b699a7e01c253ffb7818b02d62bce24190ec1019 could not be found
⠁ Collecting commits...                                                                                   Warning: Object find error: An object with id b699a7e01c253ffb7818b02d62bce24190ec1019 could not be found
  Commits collected
```

Not the prettiest, but better than a crash!
@seeyebe
Copy link
Owner

seeyebe commented Aug 16, 2025

I like the idea of warning instead of crashing.

I was thinking we might be able to use try_find_object instead of find_object so that “missing objects” (like with submodules or shallow clones) become a handled case instead of an error. That way we can just skip those changes and log a single warning per missing id, rather than printing the same error repeatedly.

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.

Failed to collect commits from repository ... An object with id ... could not be found

2 participants