After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 707582 - Add a new API for `ostree init`
Add a new API for `ostree init`
Status: RESOLVED FIXED
Product: ostree
Classification: Infrastructure
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: OSTree maintainer(s)
OSTree maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-09-05 17:44 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2013-09-05 18:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
repo: Use constructed, not constructor (2.18 KB, patch)
2013-09-05 17:44 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
repo: Move the 'init' builtin command to a public API, ostree_repo_create (10.06 KB, patch)
2013-09-05 17:44 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
repo: Rename ostree_repo_check to ostree_repo_open (5.61 KB, patch)
2013-09-05 17:44 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
repo: Use constructed, not constructor (2.25 KB, patch)
2013-09-05 17:59 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
repo: Move the 'init' builtin command to a public API, ostree_repo_create (9.88 KB, patch)
2013-09-05 17:59 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
repo: Rename ostree_repo_check to ostree_repo_open (5.74 KB, patch)
2013-09-05 17:59 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review

Description Jasper St. Pierre (not reading bugmail) 2013-09-05 17:44:32 UTC
See patches. Also renames ostree_repo_check to ostree_repo_open,
as we discussed on IRC.
Comment 1 Jasper St. Pierre (not reading bugmail) 2013-09-05 17:44:34 UTC
Created attachment 254196 [details] [review]
repo: Use constructed, not constructor
Comment 2 Jasper St. Pierre (not reading bugmail) 2013-09-05 17:44:36 UTC
Created attachment 254197 [details] [review]
repo: Move the 'init' builtin command to a public API, ostree_repo_create
Comment 3 Jasper St. Pierre (not reading bugmail) 2013-09-05 17:44:40 UTC
Created attachment 254198 [details] [review]
repo: Rename ostree_repo_check to ostree_repo_open

And add a cancellable parameter.
Comment 4 Colin Walters 2013-09-05 17:51:26 UTC
Review of attachment 254196 [details] [review]:

This could use just a very brief "why" - just like "It's simpler since we don't need to override anything."?

::: src/libostree/ostree-repo.c
@@ -169,1 @@
 

Hm, and we don't need to chain up because the parent is GObject?  I guess that's OK, but it feels like the best practice is to chain anyways in case you change the base class later.
Comment 5 Colin Walters 2013-09-05 17:54:53 UTC
Review of attachment 254197 [details] [review]:

Just a minor doc comment.

Also I do tend to say "why" in the commit, in this case something like:

"Continuing the goal of moving more of the commandline into API."

::: src/libostree/ostree-repo.c
@@ +53,3 @@
  * repositories that can be served via a static HTTP server.
  *
+ * An #OstreeRepo object is just a wrapper around a file path; creating

...until you open it.  Something like:

"Creating an #OstreeRepo involves no disk I/O.  Use ostree_repo_check() to load existing repositories from disk, or ostree_repo_create() to make a new one at the given path."  ?
Comment 6 Colin Walters 2013-09-05 17:55:33 UTC
Review of attachment 254198 [details] [review]:

"It's a better name."  Or something.  Otherwise looks good!
Comment 7 Jasper St. Pierre (not reading bugmail) 2013-09-05 17:59:05 UTC
Created attachment 254201 [details] [review]
repo: Use constructed, not constructor

It's simpler to do this after the object is constructed, rather
than in the middle of construction.
Comment 8 Jasper St. Pierre (not reading bugmail) 2013-09-05 17:59:08 UTC
Created attachment 254202 [details] [review]
repo: Move the 'init' builtin command to a public API, ostree_repo_create

This continues the goal of making more of ostree accessible by API,
rather than forking out to subprocesses.
Comment 9 Jasper St. Pierre (not reading bugmail) 2013-09-05 17:59:11 UTC
Created attachment 254203 [details] [review]
repo: Rename ostree_repo_check to ostree_repo_open

As it more clearly describes what the function does: load the
repo from disk and initialize it.

At the same time, add a cancellable parameter.
Comment 10 Colin Walters 2013-09-05 18:00:19 UTC
Review of attachment 254201 [details] [review]:

Yep!
Comment 11 Colin Walters 2013-09-05 18:00:38 UTC
Review of attachment 254202 [details] [review]:

Looks good.
Comment 12 Colin Walters 2013-09-05 18:00:55 UTC
Review of attachment 254203 [details] [review]:

Looks good, thanks!
Comment 13 Jasper St. Pierre (not reading bugmail) 2013-09-05 18:26:49 UTC
git-bz messed up