git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Archiving off old branches

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 23, 2014, 17:43 UTC
Message-ID
<xmqqzjjcymac.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20140423120850.3f6fb535@bigbox.christie.dr>
Tim Chase <git@tim.thechases.com> writes:
> Reading up on "git help update-ref", it states that it updates the
> name "safely".

I think that description is well intended but is misleading. There are many potential sources of risk, and the "safely" refers to protection against a particular kind of risk: updating from a value that you did not intend to (i.e. you examined and decided the update is good, time passes while somebody else might have mucked with the ref, and then you execute the update you decided to do). And the safety afforded to you is with "git update-ref ref newvalue oldvalue" that makes sure the ref still points at the oldvalue and refuses to update it to newvalue if it doesn't.

Previous: Tim ChaseNext: Jonathan Nieder
Message 2 of 5 in “Archiving off old branches”
  1. Tim ChaseApr 23, 2014
  2. Junio C HamanoApr 23, 2014
  3. Jonathan NiederApr 23, 2014
  4. Tim ChaseApr 23, 2014
  5. Junio C HamanoApr 23, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.