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

Re: What's cooking in git.git (Jun 2019, #02; Thu, 6)

From
Duy Nguyen <pclouds@gmail.com>
Date
Jun 12, 2019, 09:07 UTC
Message-ID
<CACsJy8CRwvRhxT7OBWn8f716=xX93gD-jho_gE09c5aGe=Vskg@mail.gmail.com>
In-Reply-To
<xmqqimtiqyey.fsf@gitster-ct.c.googlers.com>
On Fri, Jun 7, 2019 at 3:19 AM Junio C Hamano <gitster@pobox.com> wrote:
Show 51 quoted lines
> * nd/switch-and-restore (2019-05-07) 43 commits
>  - Declare both git-switch and git-restore experimental
>  - help: move git-diff and git-reset to different groups
>  - doc: promote "git restore"
>  - user-manual.txt: prefer 'merge --abort' over 'reset --hard'
>  - completion: support restore
>  - t: add tests for restore
>  - restore: support --patch
>  - restore: replace --force with --ignore-unmerged
>  - restore: default to --source=HEAD when only --staged is specified
>  - restore: reject invalid combinations with --staged
>  - restore: add --worktree and --staged
>  - checkout: factor out worktree checkout code
>  - restore: disable overlay mode by default
>  - restore: make pathspec mandatory
>  - restore: take tree-ish from --source option instead
>  - checkout: split part of it to new command 'restore'
>  - doc: promote "git switch"
>  - completion: support switch
>  - t: add tests for switch
>  - switch: make --orphan switch to an empty tree
>  - switch: reject if some operation is in progress
>  - switch: no worktree status unless real branch switch happens
>  - switch: implicit dwim, use --no-guess to disable it
>  - switch: add short option for --detach
>  - switch: only allow explicit detached HEAD
>  - switch: reject "do nothing" case
>  - switch: stop accepting pathspec
>  - switch: remove -l
>  - switch: add --discard-changes
>  - switch: better names for -b and -B
>  - checkout: split part of it to new command 'switch'
>  - checkout: split options[] array in three pieces
>  - checkout: move 'confict_style' and 'dwim_..' to checkout_opts
>  - checkout: make "opts" in cmd_checkout() a pointer
>  - checkout: factor out some code in parse_branchname_arg()
>  - checkout: keep most #include sorted
>  - checkout: inform the user when removing branch state
>  - checkout: advice how to get out of detached HEAD mode
>  - t: rename t2014-switch.sh to t2014-checkout-switch.sh
>  - git-checkout.txt: fix monospace typeset
>  - doc: document --overwrite-ignore
>  - git-checkout.txt: fix one syntax line
>  - git-checkout.txt: spell out --no-option
>  (this branch is used by jl/status-reduce-vertical-blank.)
>
>  Two new commands "git switch" and "git restore" are introduced to
>  split "checking out a branch to work on advancing its history" and
>  "checking out paths out of the index and/or a tree-ish to work on
>  advancing the current history" out of the single "git checkout"
>  command.

It's probably ok to move both switch and restore to 'next' more more testing. I've been using both for months. I had to switch back to git-checkout one time (because of submodule stuff) and it felt weird. So they're probably good enough, overall.

I do have two or three small refinement patches (for both switch and restore), but I'm still hung up on handling "git restore *.c" (with shell's expanding *.c). I think I know what should be a good compromise now, just need some more time to code it up.

>  cf. <20190329103919.15642-1-pclouds@gmail.com> (switch v6)
>  cf. <20190425094600.15673-1-pclouds@gmail.com> (restore v3)

-- Duy

Previous: Junio C HamanoNext: Derrick Stolee
Message 2 of 4 in “What's cooking in git.git (Jun 2019, #02; Thu, 6)”
  1. Junio C HamanoJun 6, 2019
  2. Duy NguyenJun 12, 2019
  3. Derrick StoleeJun 12, 2019
  4. Junio C HamanoJun 12, 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.