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

[PATCH 0/4] Some more on top of nd/switch-and-restore

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Jun 20, 2019, 09:55 UTC
Message-ID
<20190620095523.10003-1-pclouds@gmail.com>
This is small refinements (except 4/4).

2/4 relaxes the 'in-progress' check for bisect because switching while bisecting is normal _and_ safe. 3/4 makes 'switch -d' completion much more useful. 4/4 adds the last missing piece in 'git restore', records new files in worktree as i-t-a.

Still on the agenda (but may take some or much more time to do):
- submodule support in 'git restore'
- handling "git restore *.c" where *.c is expanded by shell

One item I have a patch for but decided not to send, is to imply --detach in 'git switch' if you are already in detached HEAD mode and want to switch to a non-branch. In other words, it behaves just like git-checkout.

No more protection is needed in that case because you're in trouble already if you don't know about detached HEAD. And if you do know, then adding '-d' is just annoyance.

But I don't find myself using it and I'm a pretty heavy detached user. So while it kinda makes sense to do, I don't think it's worth the complication.

Nguyễn Thái Ngọc Duy (4):
  t2027: use test_must_be_empty
  switch: allow to switch in the middle of bisect
  completion: disable dwim on "git switch -d"
  restore: add --intent-to-add (restoring worktree only)
 Documentation/git-restore.txt          |  7 +++
 builtin/checkout.c                     | 82 +++++++++++++++++++++++++-
 contrib/completion/git-completion.bash |  4 ++
 t/t2070-restore.sh                     | 22 ++++++-
 4 files changed, 109 insertions(+), 6 deletions(-)
-- 
2.22.0.rc0.322.g2b0371e29a
Next: Nguyễn Thái Ngọc Duy
Message 1 of 13 in “Some more on top of nd/switch-and-restore”
  1. 0/4 Some more on top of nd/switch-and-restoreNguyễn Thái Ngọc Duy, Jun 20, 2019
  2. 1/4 t2027: use test_must_be_emptyNguyễn Thái Ngọc Duy, Jun 20, 2019
  3. 2/4 switch: allow to switch in the middle of bisectNguyễn Thái Ngọc Duy, Jun 20, 2019
  4. Derrick StoleeJun 20, 2019
  5. Duy NguyenJun 20, 2019
  6. 3/4 completion: disable dwim on "git switch -d"Nguyễn Thái Ngọc Duy, Jun 20, 2019
  7. 4/4 restore: add --intent-to-add (restoring worktree only)Nguyễn Thái Ngọc Duy, Jun 20, 2019
  8. Derrick StoleeJun 20, 2019
  9. Duy NguyenJun 20, 2019
  10. Junio C HamanoJun 26, 2019
  11. Duy NguyenJun 27, 2019
  12. Duy NguyenJun 27, 2019
  13. Junio C HamanoJun 27, 2019

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.