2014-06-17 23:24:08 +04:00
<?xml version='1.0'?> <!-- * - nxml - * -->
< !DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<!--
Copyright 2014 Anne LoVerso <anne.loverso @ s t u d e n t s . o l i n . e d u >
2018-01-30 22:26:26 +03:00
SPDX-License-Identifier: LGPL-2.0+
2014-06-17 23:24:08 +04:00
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
2021-12-07 04:20:55 +03:00
License along with this library. If not, see <https: / / w w w . g n u . o r g / l i c e n s e s /> .
2014-06-17 23:24:08 +04:00
-->
<refentry id= "ostree" >
<refentryinfo >
<title > ostree commit</title>
<productname > OSTree</productname>
<authorgroup >
<author >
<contrib > Developer</contrib>
<firstname > Colin</firstname>
<surname > Walters</surname>
<email > walters@verbum.org</email>
</author>
</authorgroup>
</refentryinfo>
<refmeta >
<refentrytitle > ostree commit</refentrytitle>
<manvolnum > 1</manvolnum>
</refmeta>
<refnamediv >
<refname > ostree-commit</refname>
<refpurpose > Commit a new revision</refpurpose>
</refnamediv>
<refsynopsisdiv >
<cmdsynopsis >
2014-11-29 20:15:21 +03:00
<command > ostree commit</command> <arg choice= "opt" rep= "repeat" > OPTIONS</arg> --branch=<arg choice= "req" > BRANCH</arg> <arg choice= "opt" > PATH</arg>
2014-06-17 23:24:08 +04:00
</cmdsynopsis>
</refsynopsisdiv>
<refsect1 >
<title > Description</title>
<para >
2016-05-23 22:32:36 +03:00
This allows you to commit changes to a branch. The specification of the branch is required. The command will print the checksum of a successful commit.
2014-06-17 23:24:08 +04:00
</para>
</refsect1>
<refsect1 >
<title > Options</title>
<variablelist >
<varlistentry >
2014-11-11 05:28:43 +03:00
<term > <option > --subject</option> , <option > -s</option> ="SUBJECT"</term>
2014-06-17 23:24:08 +04:00
<listitem > <para >
2016-05-23 22:32:36 +03:00
One line subject. (optional)
2014-06-17 23:24:08 +04:00
</para> </listitem>
</varlistentry>
<varlistentry >
2014-11-11 05:28:43 +03:00
<term > <option > --body</option> , <option > -m</option> ="BODY"</term>
2014-06-17 23:24:08 +04:00
<listitem > <para >
2016-05-23 22:32:36 +03:00
Full description. (optional)
</para> </listitem>
</varlistentry>
2020-07-31 12:52:39 +03:00
<varlistentry >
<term > <option > --body-file</option> , <option > -F</option> ="FILE"</term>
<listitem > <para >
Full commit description from a file. (optional)
</para> </listitem>
</varlistentry>
2016-05-23 22:32:36 +03:00
<varlistentry >
<term > <option > --editor</option> , <option > -e</option> </term>
<listitem > <para >
Open a text editor for the commit description. It will use OSTREE_EDITOR, VISUAL, EDITOR, or vi, in descending order of preference. The commit will be aborted if the message is left empty.
2014-06-17 23:24:08 +04:00
</para> </listitem>
</varlistentry>
<varlistentry >
2014-11-11 05:28:43 +03:00
<term > <option > --branch</option> , <option > -b</option> ="BRANCH"</term>
2014-06-17 23:24:08 +04:00
<listitem > <para >
2016-05-23 22:32:36 +03:00
Branch. Required, unless --orphan is given.
2014-06-17 23:24:08 +04:00
</para> </listitem>
</varlistentry>
2020-07-31 12:52:39 +03:00
<varlistentry >
<term > <option > --parent</option> ="COMMIT"</term>
<listitem > <para >
Parent checksum or "none" to explicitly use no parent. If not specified, <literal > BRANCH</literal> is used as parent (no parent in case <literal > BRANCH</literal> does not exist).
</para> </listitem>
</varlistentry>
2014-06-17 23:24:08 +04:00
<varlistentry >
2014-11-11 05:28:43 +03:00
<term > <option > --tree</option> ="dir=PATH" or "tar=TARFILE" or "ref=COMMIT"</term>
2014-06-17 23:24:08 +04:00
<listitem > <para >
2019-05-21 16:28:19 +03:00
Overlay the given argument as a tree. When committing an archive, the TARFILE can be specified as <literal > -</literal> to read the archive from standard input.
2014-06-17 23:24:08 +04:00
</para> </listitem>
</varlistentry>
commit: Add --base argument
I was trying to followup the `--selinux-policy-from-base` work
to add a `cosa build --fast=overlay` for coreos-assembler,
but hit on the fact that using e.g. `--owner-uid` disables
commit optimizations.
A while ago, https://github.com/ostreedev/ostree/pull/1643 landed
which optimized this for the case where no modifications are provided.
But, we really need the SELinux policy bits, and it's super convenient
to run `ostree commit` as non-root.
It's fairly surprising actually that it's taken us so long to
iterate on a good interface for this "commit changes on top of a base"
model. In practice, many nontrivial cases really end up needing
to do a (hardlink) checkout, and that case is optimized.
But for this coreos-assembler work I want to directly overlay onto
a commit object another commit object.
That previous PR above added exactly the API we need, so let's
expose it in the CLI.
What you can see happening in the test is that we provide
`--owner-uid 42`, but that only applies to directories/files
that were added in the commit.
And now that I look at this, I think what we really want here
is to avoid changing directories that exist in the base, but
eh; in practice the main use here is for `--owner-uid 0` while
committing as non-root; and that works fine with this since
the baseline uid will be zero as well.
2020-04-06 01:23:39 +03:00
<varlistentry >
<term > <option > --base</option> ="REV"</term>
<listitem > <para >
Start from the content in a commit. This differs from <literal > --tree=ref=REV</literal> in that no commit modifiers are applied. This is usually what you want when
creating a derived commit. This is also used for <literal > --selinux-policy-from-base</literal> .
</para> </listitem>
</varlistentry>
2014-06-17 23:24:08 +04:00
<varlistentry >
<term > <option > --add-metadata-string</option> ="KEY=VALUE"</term>
<listitem > <para >
2020-07-31 12:52:39 +03:00
Add a key/value pair to metadata. Can be specified multiple times.
</para> </listitem>
</varlistentry>
<varlistentry >
<term > <option > --add-metadata</option> ="KEY=VALUE"</term>
<listitem > <para >
Add a key/value pair to metadata, where the KEY is a string, and VALUE is g_variant_parse() formatted. Can be specified multiple times.
</para> </listitem>
</varlistentry>
<varlistentry >
<term > <option > --keep-metadata</option> ="KEY"</term>
<listitem > <para >
Keep metadata KEY and its associated VALUE from parent. Can be specified multiple times.
2014-06-17 23:24:08 +04:00
</para> </listitem>
</varlistentry>
<varlistentry >
<term > <option > --add-detached-metadata-string</option> ="KEY=VALUE"</term>
<listitem > <para >
2014-11-11 05:28:43 +03:00
Add a key/value pair to detached metadata.
2014-06-17 23:24:08 +04:00
</para> </listitem>
</varlistentry>
<varlistentry >
<term > <option > --owner-uid</option> ="UID"</term>
<listitem > <para >
Set file ownership user id.
</para> </listitem>
</varlistentry>
<varlistentry >
<term > <option > --owner-gid</option> ="GID"</term>
<listitem > <para >
Set file ownership group id.
</para> </listitem>
</varlistentry>
<varlistentry >
<term > <option > --no-xattrs</option> </term>
<listitem > <para >
Do not import extended attributes.
</para> </listitem>
</varlistentry>
2021-03-11 04:36:13 +03:00
<varlistentry >
<term > <option > --bootable</option> </term>
<listitem > <para >
Inject standard metadata for a bootable Linux filesystem tree.
</para> </listitem>
</varlistentry>
2014-06-17 23:24:08 +04:00
<varlistentry >
<term > <option > --link-checkout-speedup</option> </term>
<listitem > <para >
Optimize for commits of trees composed of hardlinks into the repository.
</para> </listitem>
</varlistentry>
<varlistentry >
<term > <option > --tar-autocreate-parents</option> </term>
<listitem > <para >
When loading tar archives, automatically create parent directories as needed.
</para> </listitem>
</varlistentry>
<varlistentry >
<term > <option > --skip-if-unchanged</option> </term>
<listitem > <para >
If the contents are unchanged from previous commit, do nothing.
</para> </listitem>
</varlistentry>
2017-10-04 00:34:06 +03:00
<varlistentry >
<term > <option > --consume</option> </term>
<listitem > <para >
When committing from a local directory (i.e. not an archive or --tree=ref),
assume ownership of the content. This may simply involve deleting it,
but if possible, the content may simply be <literal > rename()</literal> ed
into the repository rather than creating a new copy.
</para> </listitem>
</varlistentry>
2014-06-17 23:24:08 +04:00
<varlistentry >
<term > <option > --statoverride</option> ="PATH"</term>
<listitem > <para >
2021-07-14 23:07:16 +03:00
File containing list of modifications to make permissions (file mode in
decimal, followed by space, followed by file path). The specified mode
is ORed with the file's original mode unless preceded by "=".
2016-04-22 19:35:48 +03:00
</para> </listitem>
</varlistentry>
<varlistentry >
<term > <option > --skip-list</option> ="PATH"</term>
<listitem > <para >
File containing list of file paths to skip (one path per line).
2014-06-17 23:24:08 +04:00
</para> </listitem>
</varlistentry>
<varlistentry >
<term > <option > --table-output</option> </term>
<listitem > <para >
Output more information in a KEY: VALUE format.
</para> </listitem>
</varlistentry>
<varlistentry >
<term > <option > --generate-sizes</option> </term>
<listitem > <para >
Generate size information along with commit metadata.
</para> </listitem>
</varlistentry>
<varlistentry >
2014-11-11 05:28:43 +03:00
<term > <option > --gpg-sign</option> ="KEY-ID"</term>
2014-06-17 23:24:08 +04:00
<listitem > <para >
GPG Key ID with which to sign the commit (if have GPGME - GNU Privacy Guard Made Easy).
</para> </listitem>
</varlistentry>
<varlistentry >
2014-11-11 05:28:43 +03:00
<term > <option > --gpg-homedir</option> ="HOMEDIR"</term>
2014-06-17 23:24:08 +04:00
<listitem > <para >
GPG home directory to use when looking for keyrings (if have GPGME - GNU Privacy Guard Made Easy).
</para> </listitem>
</varlistentry>
2015-11-09 13:35:46 +03:00
<varlistentry >
<term > <option > --timestamp</option> ="TIMESTAMP"</term>
<listitem > <para >
Override the timestamp of the commit to TIMESTAMP.
</para> </listitem>
</varlistentry>
2016-05-23 09:53:34 +03:00
<varlistentry >
<term > <option > --orphan</option> </term>
<listitem > <para >
2016-05-23 22:32:36 +03:00
Create a commit without writing to a ref (branch)
2016-05-23 09:53:34 +03:00
</para> </listitem>
</varlistentry>
<varlistentry >
<term > <option > --fsync</option> ="POLICY"</term>
<listitem > <para >
POLICY is a boolean which specifies whether fsync should be used or not. Default to true.
</para> </listitem>
</varlistentry>
2019-11-10 19:17:58 +03:00
<varlistentry >
<term > <option > -s, --sign-type</option> </term>
<listitem > <para >
Use particular signature engine. Currently
available <arg choice= "plain" > ed25519</arg> and <arg choice= "plain" > dummy</arg>
signature types.
The default is <arg choice= "plain" > ed25519</arg> .
</para> </listitem>
</varlistentry>
<varlistentry >
<term > <option > --sign</option> ="KEY-ID"</term>
<listitem > <para >
There <literal > KEY-ID</literal> is:
<variablelist >
<varlistentry >
<term > <option > for ed25519:</option> </term>
<listitem > <para >
<literal > base64</literal> -encoded secret key for commit signing.
</para> </listitem>
</varlistentry>
<varlistentry >
<term > <option > for dummy:</option> </term>
<listitem > <para >
ASCII-string used as secret key.
</para> </listitem>
</varlistentry>
</variablelist>
</para> </listitem>
</varlistentry>
2014-06-17 23:24:08 +04:00
</variablelist>
</refsect1>
<refsect1 >
<title > Example</title>
<para > <command > $ ostree commit --branch=my-branch --subject="Initial commit"</command> </para>
2014-11-29 20:15:21 +03:00
<programlisting >
2014-06-17 23:24:08 +04:00
67e382b11d213a402a5313e61cbc69dfd5ab93cb07fbb8b71c2e84f79fa5d7dc
2014-11-29 20:15:21 +03:00
</programlisting>
2014-06-17 23:24:08 +04:00
</refsect1>
</refentry>