summaryrefslogtreecommitdiff
path: root/src/libostree/ostree-repo-refs.c
Commit message (Collapse)AuthorAgeFilesLines
* repo: Add a private helper to replace a file, honoring fsync policyColin Walters2015-04-131-3/+2
| | | | Extracted from discussion in https://github.com/GNOME/ostree/pull/83
* refs: Use *at for writes, honor repo fsync flagColin Walters2015-04-131-43/+51
| | | | | | | | | | | | | I was looking at https://bugzilla.gnome.org/show_bug.cgi?id=738954 which wants us to ensure we chown() the refs. As part of that, I did a generic conversion to use `*at()` (which naturally gives us more low level control so we can call `fchown` etc. This patch also sneaks in a change to respect the repo's `disable_fsync` flag - if fsync is not set, then we never `fdatasync()` (unlike the `g_file_replace_contents()` default. Also unlike it, if fsync is enabled, we *always* sync even if the file didn't exist.
* ostree-repo-refs: Drop unused function "parse_rev_file".Giuseppe Scrivano2015-03-061-67/+0
| | | | | | | If it will be needed in future, it can be retrieved from the git history. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* refs: Use G_IO_ERROR_NOT_FOUND when a ref lookup failsColin Walters2015-01-061-1/+1
| | | | | | | rpm-ostree had code to check for this, which didn't actually work. I don't see a no backwards compatibility concern in changing this, as it's unlikely a caller would try to sensibly disambiguate FAILED.
* refs: Don't try searching for input strings that can't be objectsColin Walters2014-07-231-0/+8
| | | | | | | | | | I noticed OSTree was a bit slower, did some investigation and saw we were enumerating all objects for things like $ ostree rev-parse blah Since "blah" can never be an object (because of the 'l' and 'h'), just return no matches.
* Fix typo in previous commitColin Walters2014-07-181-1/+1
|
* ostree-repo-resolve-rev: Add function to accept a partial checksumAnne LoVerso2014-07-181-1/+77
| | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a function that will parse a partial checksum when resolving a refspec. If the inputted refspec matches a truncated existing checksum, it will return that checksum to be parsed. If multiple truncated checksums match the partial refspec, it is not unique and will return false. This addition is inspired by the same functionality in Docker, which allows a user to reference a specific commit without typing the entire checksum. partial checksums: Add function to abstract comparison This modifies the list_objects and list_objects_at functions to take an additional argument for the string that a commit starts with. If this string arg is not null, it will only list commit objects beginning with that string. This allows for a new function ostree_repo_list_commit_objects_starting_with to pass a partial string and return a list of all matching commits. This improves on the previous strategy of listing refs because it will list all commit objects, even ones in past history. This update also includes bugfixes on error handling and string comparison, and changes the output structure of resolve_partial_checksum. The new strcuture will no longer return FALSE without error. Also, the hashtable foreach now uses iter. Also includes modified test file
* core: Use ostree_commit_get_parent in ostree_repo_resolve_revJames Antill2014-07-181-4/+1
|
* repo: Don't require a txn for writingColin Walters2014-05-261-14/+16
| | | | | | | | | | | | | | The current "transaction" symlink was introduced to fix issues with interrupted pulls; normally we assume that if we have a metadata object, we also have all objects to which it refers. There used to be a "summary" which had all the available refs, but I deleted it because it wasn't really used, and was still racy despite the transaction bits. We still want the pull process to use the transaction link, so don't delete the APIs, just relax the restriction on object writing, and introduce a new ostree_repo_set_ref_immediate().
* Drop refs/summaryColin Walters2014-02-091-50/+0
| | | | | I'm not aware of anyone using this, and it's not efficient to write a whole file every time a ref changes, plus it's not atomic.
* Move ref writing to be transaction-basedJasper St. Pierre2013-09-061-62/+42
| | | | | | | | | | Rather than having separate write_ref calls, make clients start a transaction, add some refs, and then commit it. While this doesn't make it 100% atomic, it makes it easier for us to use an atomic model, and it means we don't do as much I/O updating the summary file and such. https://bugzilla.gnome.org/show_bug.cgi?id=707644
* Fix warnings about unused variablesTobias Hunger2013-08-301-3/+0
|
* libostree: Extend gtk-doc coverage for refs and prune APIsColin Walters2013-08-191-10/+47
|
* libostree: Fix many gtk-doc warningsColin Walters2013-08-171-2/+2
|
* core: Remove old "archive" modeColin Walters2013-08-161-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | We'll always have "bare" mode for keeping files-as-hardlinks as root. But "archive" was my second attempt at a format for non-root file storage, used by the gnome-ostree buildsystem which runs as non-root. It was really handy to have a "tar" like mode where I can create tarballs as a user, that contain files owned by root for example. The "archive" mode stored content files as two pieces in the filesystem; ".file" contained metadata, and ".filecontent" was the actual content, uncompressed. The nice thing about this was that to check out a tree as non-root, you could just hardlink into the repo. However, archive was fairly bad for serving via HTTP; it required *two* HTTP requests per content object, greatly magnifing the already inefficient fetch process. So "archive-z2" was introduced. To allow gnome-ostree to still check out trees as a user, the "uncompressed-object-cache" was introduced, and that's how things have been working for a while. So we should just be able to kill this code. Specifically note just how much better the stage_object() function became. https://bugzilla.gnome.org/show_bug.cgi?id=706057
* Install a shared libraryColin Walters2013-07-261-0/+12
| | | | | This required a fair bit of surgery because previously ostree.h included otutil.h, but that's supposed to be a private library.
* libostree: Split off -refs.cColin Walters2013-07-091-0/+670
Continuing to break up ostree-repo.c.