<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/Documentation/git-update-ref.txt, branch v2.33.6</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.33.6</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.33.6'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2020-11-16T21:44:01Z</updated>
<entry>
<title>update-ref: allow creation of multiple transactions</title>
<updated>2020-11-16T21:44:01Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2020-11-13T08:12:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=262a4d28feb26aff89705b3254cdfc015eaa3ef9'/>
<id>urn:sha1:262a4d28feb26aff89705b3254cdfc015eaa3ef9</id>
<content type='text'>
While git-update-ref has recently grown commands which allow interactive
control of transactions in e48cf33b61 (update-ref: implement interactive
transaction handling, 2020-04-02), it is not yet possible to create
multiple transactions in a single session. To do so, one currently still
needs to invoke the executable multiple times.

This commit addresses this shortcoming by allowing the "start" command
to create a new transaction if the current transaction has already been
either committed or aborted.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Reviewed-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Modify pseudo refs through ref backend storage</title>
<updated>2020-07-27T17:06:49Z</updated>
<author>
<name>Han-Wen Nienhuys</name>
<email>hanwen@google.com</email>
</author>
<published>2020-07-27T16:25:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=09743417a201511888aee42480e468ebf47fcecb'/>
<id>urn:sha1:09743417a201511888aee42480e468ebf47fcecb</id>
<content type='text'>
The previous behavior was introduced in commit 74ec19d4be
("pseudorefs: create and use pseudoref update and delete functions",
Jul 31, 2015), with the justification "alternate ref backends still
need to store pseudorefs in GIT_DIR".

Refs such as REBASE_HEAD are read through the ref backend. This can
only work consistently if they are written through the ref backend as
well. Tooling that works directly on files under .git should be
updated to use git commands to read refs instead.

The following behaviors change:

* Updates to pseudorefs (eg. ORIG_HEAD) with
  core.logAllRefUpdates=always will create reflogs for the pseudoref.

* non-HEAD pseudoref symrefs are also dereferenced on deletion. Update
  t1405 accordingly.

Signed-off-by: Han-Wen Nienhuys &lt;hanwen@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>update-ref: implement interactive transaction handling</title>
<updated>2020-04-02T18:09:49Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2020-04-02T07:10:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e48cf33b61b8fecf1558fb32fcf5ee2987e82890'/>
<id>urn:sha1:e48cf33b61b8fecf1558fb32fcf5ee2987e82890</id>
<content type='text'>
The git-update-ref(1) command can only handle queueing transactions
right now via its "--stdin" parameter, but there is no way for users to
handle the transaction itself in a more explicit way. E.g. in a
replicated scenario, one may imagine a coordinator that spawns
git-update-ref(1) for multiple repositories and only if all agree that
an update is possible will the coordinator send a commit. Such a
transactional session could look like

    &gt; start
    &lt; start: ok
    &gt; update refs/heads/master $OLD $NEW
    &gt; prepare
    &lt; prepare: ok
    # All nodes have returned "ok"
    &gt; commit
    &lt; commit: ok

or

    &gt; start
    &lt; start: ok
    &gt; create refs/heads/master $OLD $NEW
    &gt; prepare
    &lt; fatal: cannot lock ref 'refs/heads/master': reference already exists
    # On all other nodes:
    &gt; abort
    &lt; abort: ok

In order to allow for such transactional sessions, this commit
introduces four new commands for git-update-ref(1), which matches those
we have internally already with the exception of "start":

    - start: start a new transaction

    - prepare: prepare the transaction, that is try to lock all
               references and verify their current value matches the
               expected one

    - commit: explicitly commit a session, that is update references to
              match their new expected state

    - abort: abort a session and roll back all changes

By design, git-update-ref(1) will commit as soon as standard input is
being closed. While fine in a non-transactional world, it is definitely
unexpected in a transactional world. Because of this, as soon as any of
the new transactional commands is used, the default will change to
aborting without an explicit "commit". To avoid a race between queueing
updates and the first "prepare" that starts a transaction, the "start"
command has been added to start an explicit transaction.

Add some tests to exercise this new functionality.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-update-ref.txt: add missing word</title>
<updated>2020-03-30T17:34:11Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2020-03-30T13:46:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=faa35eec4d119e9d4faa25d10a2b00029d8f1bdb'/>
<id>urn:sha1:faa35eec4d119e9d4faa25d10a2b00029d8f1bdb</id>
<content type='text'>
The description for the "verify" command is lacking a single word "is",
which this commit corrects.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ah/doc-updates'</title>
<updated>2018-10-30T06:43:47Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-10-30T06:43:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=90d228b0d702d105dc2738f49528deb5fdb0e201'/>
<id>urn:sha1:90d228b0d702d105dc2738f49528deb5fdb0e201</id>
<content type='text'>
Doc updates.

* ah/doc-updates:
  doc: fix formatting in git-update-ref
  doc: fix indentation of listing blocks in gitweb.conf.txt
  doc: fix descripion for 'git tag --format'
  doc: fix inappropriate monospace formatting
  doc: fix ASCII art tab spacing
  doc: clarify boundaries of 'git worktree list --porcelain'
</content>
</entry>
<entry>
<title>doc: fix formatting in git-update-ref</title>
<updated>2018-10-23T03:23:09Z</updated>
<author>
<name>Andreas Heiduk</name>
<email>asheiduk@gmail.com</email>
</author>
<published>2018-10-22T20:45:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=081d91618bd4541fda824e746e5a22838c2e2495'/>
<id>urn:sha1:081d91618bd4541fda824e746e5a22838c2e2495</id>
<content type='text'>
Remove the parapgraph numbers from lines explaining the reflog format
and typeset these lines in monospace.

Signed-off-by: Andreas Heiduk &lt;asheiduk@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>update-ref: allow --no-deref with --stdin</title>
<updated>2018-09-12T22:17:17Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2018-09-05T17:25:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d345e9fbe75c8bec6469253f0ee7e34228f41917'/>
<id>urn:sha1:d345e9fbe75c8bec6469253f0ee7e34228f41917</id>
<content type='text'>
If passed both --no-deref and --stdin, update-ref would error out with a
general usage message that did not at all suggest these options were
incompatible.  The manpage for update-ref did suggest through its
synopsis line that --no-deref and --stdin were incompatible, but it sadly
also incorrectly suggested that -d and --no-deref were incompatible.  So
the help around the --no-deref option is buggy in a few ways.

The --stdin option did provide a different mechanism for avoiding
dereferencing symbolic-refs: adding a line reading
  option no-deref
before every other directive in the input.  (Technically, if the user
wants to do the extra work of first determining which refs they want to
update or delete are symbolic, then they only need to put the extra
"option no-deref" lines before the updates of those refs.  But in some
cases, that's more work than just adding the "option no-deref" before
every other directive.)

It's easier to allow the user to just pass --no-deref along with --stdin
in order to tell update-ref that the user doesn't want any symbolic ref
to be dereferenced.  It also makes the update-ref documentation simpler.
Implement that, and update the documentation to match.

Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>doc: keep first level section header in upper case</title>
<updated>2018-05-02T08:03:33Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-04-30T15:35:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=76a8788c141e9d4e2713acaa7886475fb6b27ca5'/>
<id>urn:sha1:76a8788c141e9d4e2713acaa7886475fb6b27ca5</id>
<content type='text'>
When formatted as a man page, 1st section header is always in upper
case even if we write it otherwise. Make all 1st section headers
uppercase to keep it close to the final output.

This does affect html since case is kept there, but I still think it's
a good idea to maintain a consistent style for 1st section headers.

Some sections perhaps should become second sections instead, where
case is kept, and for better organization. I will update if anyone has
suggestions about this.

While at there I also make some header more consistent (e.g. examples
vs example) and fix a couple minor things here and there.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>update-ref and tag: add --create-reflog arg</title>
<updated>2015-07-21T21:08:35Z</updated>
<author>
<name>David Turner</name>
<email>dturner@twopensource.com</email>
</author>
<published>2015-07-21T21:04:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=144c76fa39254903cb1e8e2d6d159603077356a7'/>
<id>urn:sha1:144c76fa39254903cb1e8e2d6d159603077356a7</id>
<content type='text'>
Allow the creation of a ref (e.g. stash) with a reflog already in
place. For most refs (e.g. those under refs/heads), this happens
automatically, but for others, we need this option.

Currently, git does this by pre-creating the reflog, but alternate ref
backends might store reflogs somewhere other than .git/logs.  Code
that now directly manipulates .git/logs should instead use git
plumbing commands.

I also added --create-reflog to git tag, just for completeness.

In a moment, we will use this argument to make git stash work with
alternate ref backends.

Signed-off-by: David Turner &lt;dturner@twopensource.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>update-ref --stdin -z: deprecate interpreting the empty string as zeros</title>
<updated>2014-04-07T19:09:13Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2014-04-07T13:48:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1fbd504942b20a541ba4fcbe90d3ea21b03717e4'/>
<id>urn:sha1:1fbd504942b20a541ba4fcbe90d3ea21b03717e4</id>
<content type='text'>
In the original version of this command, for the single case of the
"update" command's &lt;newvalue&gt;, the empty string was interpreted as
being equivalent to 40 "0"s.  This shorthand is unnecessary (binary
input will usually be generated programmatically anyway), and it
complicates the parser and the documentation.

So gently deprecate this usage: remove its description from the
documentation and emit a warning if it is found.  But for reasons of
backwards compatibility, continue to accept it.

Helped-by: Brad King &lt;brad.king@kitware.com&gt;
Signed-off-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
