Hi
@薛宇豪,
lakeFS follows the Git model: commits are immutable -- it is literally not possible to change commits.
This is an
internal "plumbing" API.
• "_Internal_" means that the lakeFS API compatibility guarantees do not apply, and this API can change. It will be hard to give a stable API that does this, for instance new internal fields may be added to commits. I would recommend discussing with us if you have specific needs. (Of course it is fine to use this API for experimentation - we just cannot guarantee that it will remain and will not change in future 1.x versions). Using it involves understanding the lakeFS data model - and you will get less support for your use here on
#C016726JLJW.
• "_Plumbing_" means it is not a complete use feature. So (assuming you have decided to use an internal API) you
could use this API to modify metadata at branch head:
◦ create a new commit record with the same metarange ID and your new desired metadata
◦ checkout a temporary hidden new branch at the old branch head to prevent the metarange from being garbage-collected.
◦ hard-reset the branch head to the newly-created commit record
◦ delete that temporary hidden branch - you no longer need it.
• You could even modify a commit behind the branch head, by creating successive commit records after the modified commit. Basically you would be implementing the equivalent of
git reset --interactive
at this point.
I hope I've convinced you it is
possible, but
hard to code and ensure it keeps on working.