Skip to content
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

Unable to retrieve objects replaced by git-replace #1081

Closed
orhun opened this issue Sep 1, 2024 · 3 comments
Closed

Unable to retrieve objects replaced by git-replace #1081

orhun opened this issue Sep 1, 2024 · 3 comments
Labels
upstream An upstream issue with libgit2

Comments

@orhun
Copy link

orhun commented Sep 1, 2024

Description

git2 does not return the new values for objects replaced via git-replace command.

Reproduce steps

cd $(mktemp -d)
git init .
git commit --allow-empty -m 'test: test commit'

log example works fine:

$ cargo run --example log -- --git-dir /tmp/<path>

commit 37c00d39b18b49ae5819b798b2b3256b4169223b
Author: Orhun Parmaksız <[email protected]>
Date:   Sun Sep  1 15:25:43 2024 +0300

    test: test commit

Then edit the last commit via git-replace:

git replace --edit HEAD # e.g. change "test" -> "best"

log example still shows the old commit message:

$ cargo run --example log -- --git-dir /tmp/<path>

commit 37c00d39b18b49ae5819b798b2b3256b4169223b
Author: Orhun Parmaksız <[email protected]>
Date:   Sun Sep  1 15:25:43 2024 +0300

    test: test commit

Whereas git log command shows the replaced commit message (it also says "replaced")

$ git log

commit 37c00d39b18b49ae5819b798b2b3256b4169223b (HEAD -> master, replaced)
Author: Orhun Parmaksız <[email protected]>
Date:   Sun Sep 1 12:25:43 2024 +0300

    test: best commit

Additional context

Please see orhun/git-cliff#826

Presumably an extra lookup query needs to happen for every object used to get the replacements (if any).

@weihanglo weihanglo added the upstream An upstream issue with libgit2 label Sep 1, 2024
@weihanglo
Copy link
Member

It seems like the upstream libgit2 does not yet support it: libgit2/libgit2#1730

@ehuss
Copy link
Contributor

ehuss commented Sep 1, 2024

Thanks! Yea, closing as this looks like an upstream issue.

@ehuss ehuss closed this as not planned Won't fix, can't repro, duplicate, stale Sep 1, 2024
@orhun
Copy link
Author

orhun commented Sep 1, 2024

See you guys in another 10 years 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream An upstream issue with libgit2
Projects
None yet
Development

No branches or pull requests

3 participants