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

[PATCH v7 0/8] protect branches checked out in all worktrees

From
Anders Kaseorg <andersk@mit.edu>
Date
Dec 1, 2021, 22:15 UTC
Message-ID
<20211201221547.1796213-1-andersk@mit.edu>

‘git fetch’ (without ‘--update-head-ok’), ‘git receive-pack’, and ‘git branch -M’ protect the currently checked out branch from being accidentally updated. However, the code for these checks predates ‘git worktree’. Improve it to protect branches checked out in all worktrees, not just the current one.

Anders Kaseorg (8):
  fetch: lowercase error messages
  receive-pack: lowercase error messages
  branch: lowercase error messages
  worktree: simplify find_shared_symref() memory ownership model
  fetch: protect branches checked out in all worktrees
  receive-pack: clean dead code from update_worktree()
  receive-pack: protect current branch for bare repository worktree
  branch: protect branches checked out in all worktrees
 branch.c                        |  45 +++++++-----
 builtin/branch.c                |   7 +-
 builtin/fetch.c                 | 119 +++++++++++++++++---------------
 builtin/notes.c                 |   6 +-
 builtin/receive-pack.c          |  92 +++++++++++++-----------
 t/t2018-checkout-branch.sh      |   2 +-
 t/t3200-branch.sh               |  11 ++-
 t/t5504-fetch-receive-strict.sh |   2 +-
 t/t5516-fetch-push.sh           |  32 +++++++++
 worktree.c                      |   8 +--
 worktree.h                      |   5 +-
 11 files changed, 198 insertions(+), 131 deletions(-)
-- 
2.34.1
Next: Anders Kaseorg
Message 1 of 20 in “protect branches checked out in all worktrees”
  1. 0/8 protect branches checked out in all worktreesAnders Kaseorg, Dec 1, 2021
  2. 1/8 fetch: lowercase error messagesAnders Kaseorg, Dec 1, 2021
  3. 3/8 branch: lowercase error messagesAnders Kaseorg, Dec 1, 2021
  4. 4/8 worktree: simplify find_shared_symref() memory ownership modelAnders Kaseorg, Dec 1, 2021
  5. Eric SunshineDec 1, 2021
  6. Anders KaseorgDec 1, 2021
  7. Eric SunshineDec 2, 2021
  8. Eric SunshineDec 2, 2021
  9. Anders KaseorgDec 2, 2021
  10. Eric SunshineDec 2, 2021
  11. 2/8 receive-pack: lowercase error messagesAnders Kaseorg, Dec 1, 2021
  12. 5/8 fetch: protect branches checked out in all worktreesAnders Kaseorg, Dec 1, 2021
  13. Eric SunshineDec 2, 2021
  14. Anders KaseorgDec 2, 2021
  15. 6/8 receive-pack: clean dead code from update_worktree()Anders Kaseorg, Dec 1, 2021
  16. 7/8 receive-pack: protect current branch for bare repository worktreeAnders Kaseorg, Dec 1, 2021
  17. 8/8 branch: protect branches checked out in all worktreesAnders Kaseorg, Dec 1, 2021
  18. Jiang XinDec 23, 2021
  19. Jiang XinJan 12, 2022
  20. Junio C HamanoJan 12, 2022

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.