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

Slight inconsistency between ref delete commands.

From
SOSergei Organov <osv@javad.com>
Date
May 21, 2014, 10:35 UTC
Message-ID
<871tvn5shp.fsf@osv.gnss.ru>
Hello,

Was writing conversion script from CVS to git for my repo and noticed slight inconsistency in git-tag, git-branch, and git-update-ref behavior:

$ git --version
git version 1.9.3
$ git tag -d && echo success
success
$ git branch -d && echo success
fatal: branch name required
$ git update-ref -d && echo success
usage: git update-ref [options] -d <refname> [<oldval>]
   or: git update-ref [options]    <refname> <newval> [<oldval>]
   or: git update-ref [options] --stdin [-z]
    -m <reason>           reason of the update
    -d                    delete the reference
    --no-deref            update <refname> not the one it points to
    -z                    stdin has NUL-terminated arguments
    --stdin               read updates from stdin
Noticed when used xargs without -r switch, like this:
git for-each-ref --format="%(refname)" "refs/tags/*-merge" | xargs -n 1 git update-ref -d
-- Sergey.
Next: Jeff King
Message 1 of 2 in “Slight inconsistency between ref delete commands.”
  1. Sergei OrganovMay 21, 2014
  2. Jeff KingMay 21, 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.