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

Re: BUG when trying to delete symbolic refs

From
René Scharfe <rene.scharfe@lsrfire.ath.cx>
Date
Oct 18, 2012, 11:59 UTC
Message-ID
<507FEF0B.1060309@lsrfire.ath.cx>
In-Reply-To
<7vr4oytn4q.fsf@alter.siamese.dyndns.org>
Am 16.10.2012 18:09, schrieb Junio C Hamano:
Show 5 quoted lines
> Having said all that, I think your patch is going in the right
> direction.  If somebody had a symbolic ref in refs/heads/, the
> removal should remove it, not the pointee, which may not even
> exist.  Does "branch -d sym" work correctly with your patch when
> refs/heads/sym is pointing at something that does not exist?

No, it doesn't, neither with nor without the patch. But we can make it work, and also address a UI issue. This series starts with two patches that only move code around, then follows the patch you commented on, a patch addressing dangling symrefs and finally a change to the way deleted symrefs are reported by git branch.

  branch: factor out check_branch_commit()
  branch: factor out delete_branch_config()
  branch: delete symref branch, not its target
  branch: skip commit checks when deleting symref branches
  branch: show targets of deleted symrefs, not sha1s
 builtin/branch.c  | 75 ++++++++++++++++++++++++++++++++++++-------------------
 t/t3200-branch.sh | 19 ++++++++++++++
 2 files changed, 68 insertions(+), 26 deletions(-)
-- 
1.7.12
Previous: Junio C HamanoNext: René Scharfe
Message 5 of 16 in “BUG when trying to delete symbolic refs”
  1. Johan HerlandOct 15, 2012
  2. René ScharfeOct 16, 2012
  3. refs: lock symref that is to be deleted, not its targetRené Scharfe, Oct 16, 2012
  4. Junio C HamanoOct 16, 2012
  5. René ScharfeOct 18, 2012
  6. 1/5 branch: factor out check_branch_commit()René Scharfe, Oct 18, 2012
  7. 2/5 branch: factor out delete_branch_config()René Scharfe, Oct 18, 2012
  8. 3/5 branch: delete symref branch, not its targetRené Scharfe, Oct 18, 2012
  9. 4/5 branch: skip commit checks when deleting symref branchesRené Scharfe, Oct 18, 2012
  10. Junio C HamanoOct 18, 2012
  11. 0/2 Fix remaining issue when deleting symrefsJohan Herland, Oct 21, 2012
  12. 1/2 t1400-update-ref: Add test verifying bug with symrefs in delete_ref()Johan Herland, Oct 21, 2012
  13. 2/2 Fix failure to delete a packed ref through a symrefJohan Herland, Oct 21, 2012
  14. René ScharfeOct 21, 2012
  15. Junio C HamanoOct 21, 2012
  16. 5/5 branch: show targets of deleted symrefs, not sha1sRené Scharfe, Oct 18, 2012

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.