-
Notifications
You must be signed in to change notification settings - Fork 305
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
[merged] Support for selective pruning #646
Conversation
There are use cases for having a single repo with branches with different lifecycles; a simple example of what I was trying to do in CentOS Atomic Host work is have "stable" and "devel" branches, were we want to prune devel, but retain *all* of stable. This patch is split into two parts - first we add a low level "delete all objects not in this set" API, and change the current prune API to use this. Next, we move more logic into the "ostree prune" command. This paves the way for demonstrating how more sophisticated algorithms/logic could be developed outside of the ostree core. Also, the --keep-younger-than logic already lived in the commandline, so it makes sense to keep extending it there. Closes: ostreedev#604
2dbcb10
to
66a48e0
Compare
Removing WIP, should be good to go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks sane overall.
Just a few minor issues.
@@ -371,12 +371,10 @@ global: | |||
* NOTE NOTE NOTE | |||
*/ | |||
|
|||
/* Remove comment when first new symbol is added | |||
LIBOSTREE_2016.XX { | |||
LIBOSTREE_2016.15 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2017.1
?
goto out; | ||
} | ||
g_hash_table_insert (retain_branch_depth, g_strndup (bd, eq - bd), | ||
GINT_TO_POINTER ((int)g_ascii_strtoll (eq + 1, NULL, 10))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is directly user-facing, we should probably validate that g_ascii_strtoll
converted successfully. Otherwise, a typo can end up pruning the whole branch.
OK, fixups ⬆️ |
Yum, delicious fixups! |
☀️ Test successful - status-atomicjenkins |
In 5c94098 / ostreedev#646 we added `--retain-branch-depth`; this adds a symmetric `--only-branch` for the case where a repo owner just wants to prune a specific branch. The implementation here is pretty straightforward; we just walk all refs and inject the equivalent of `--retain-branch-depth=$ref=-1` if they're *not* in `--only-branch`. Closes: ostreedev#1115
In 5c94098 / ostreedev#646 we added `--retain-branch-depth`; this adds a symmetric `--only-branch` for the case where a repo owner just wants to prune a specific branch. The implementation here is pretty straightforward; we just walk all refs and inject the equivalent of `--retain-branch-depth=$ref=-1` if they're *not* in `--only-branch`. Closes: ostreedev#1115
In 5c94098 / ostreedev#646 we added `--retain-branch-depth`; this adds a symmetric `--only-branch` for the case where a repo owner just wants to prune a specific branch. The implementation here is pretty straightforward; we just walk all refs and inject the equivalent of `--retain-branch-depth=$ref=-1` if they're *not* in `--only-branch`. Closes: ostreedev#1115
In 5c94098 / #646 we added `--retain-branch-depth`; this adds a symmetric `--only-branch` for the case where a repo owner just wants to prune a specific branch. The implementation here is pretty straightforward; we just walk all refs and inject the equivalent of `--retain-branch-depth=$ref=-1` if they're *not* in `--only-branch`. Closes: #1115 Closes: #1127 Approved by: jlebon
No description provided.