mbox series

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

Message ID 20190620095523.10003-1-pclouds@gmail.com (mailing list archive)
Headers show
Series Some more on top of nd/switch-and-restore | expand

Message

Duy Nguyen June 20, 2019, 9:55 a.m. UTC
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(-)

Comments

Junio C Hamano June 26, 2019, 7:58 p.m. UTC | #1
Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:

> This is small refinements (except 4/4).

What's the status of these?  As another low-prio topic interferes
with the code touched by nd/switch-and-restore and hence needs to
wait for these to stabilize, I'd rather see us focus on finishing
these before switching our attention to other things.

Thanks.
Duy Nguyen June 27, 2019, 2:53 a.m. UTC | #2
On Thu, Jun 27, 2019 at 2:58 AM Junio C Hamano <gitster@pobox.com> wrote:
>
> Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:
>
> > This is small refinements (except 4/4).
>
> What's the status of these?

Small test fixup needed. I should be able to do it later today.

> As another low-prio topic interferes
> with the code touched by nd/switch-and-restore and hence needs to
> wait for these to stabilize, I'd rather see us focus on finishing
> these before switching our attention to other things.
>
> Thanks.
Duy Nguyen June 27, 2019, 8:53 a.m. UTC | #3
On Thu, Jun 27, 2019 at 9:53 AM Duy Nguyen <pclouds@gmail.com> wrote:
>
> On Thu, Jun 27, 2019 at 2:58 AM Junio C Hamano <gitster@pobox.com> wrote:
> >
> > Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:
> >
> > > This is small refinements (except 4/4).
> >
> > What's the status of these?
>
> Small test fixup needed. I should be able to do it later today.

Actually since the patch that needs updates is 4/4, which is not part
of nd/switch-and-store-more, I think the status is "ready". You
probably could safely make them part nd/switch-and-restore.
Junio C Hamano June 27, 2019, 5:53 p.m. UTC | #4
Duy Nguyen <pclouds@gmail.com> writes:

> On Thu, Jun 27, 2019 at 9:53 AM Duy Nguyen <pclouds@gmail.com> wrote:
>>
>> On Thu, Jun 27, 2019 at 2:58 AM Junio C Hamano <gitster@pobox.com> wrote:
>> >
>> > Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:
>> >
>> > > This is small refinements (except 4/4).
>> >
>> > What's the status of these?
>>
>> Small test fixup needed. I should be able to do it later today.
>
> Actually since the patch that needs updates is 4/4, which is not part
> of nd/switch-and-store-more, I think the status is "ready". You
> probably could safely make them part nd/switch-and-restore.

Yup, that matches my understanding after re-reading them.

Thanks.\