Re: [PATCH 1/2] read-tree --reset: add --protect-untracked

2019-05-03 Thread Phillip Wood
On 02/05/2019 11:38, Duy Nguyen wrote: On Wed, May 1, 2019 at 5:14 PM Phillip Wood wrote: From: Phillip Wood Currently there is no way to get git to discard changes to the worktree without overwriting untracked files. `reset --hard`, `checkout --force`, `checkout :/` and `read-tree --reset

Re: [PATCH 1/2] read-tree --reset: add --protect-untracked

2019-05-02 Thread Duy Nguyen
On Wed, May 1, 2019 at 5:14 PM Phillip Wood wrote: > > From: Phillip Wood > > Currently there is no way to get git to discard changes to the > worktree without overwriting untracked files. `reset --hard`, > `checkout --force`, `checkout :/` and `read-tree --reset -u` "checkout :/" does not use

Re: [PATCH 1/2] read-tree --reset: add --protect-untracked

2019-05-01 Thread Duy Nguyen
On Wed, May 1, 2019 at 5:18 PM Duy Nguyen wrote: > > On Wed, May 1, 2019 at 5:14 PM Phillip Wood wrote: > > diff --git a/unpack-trees.h b/unpack-trees.h > > index d344d7d296..732b262c4d 100644 > > --- a/unpack-trees.h > > +++ b/unpack-trees.h > > @@ -41,9 +41,15 @@ void setup_unpack_trees_porcela

Re: [PATCH 1/2] read-tree --reset: add --protect-untracked

2019-05-01 Thread Duy Nguyen
On Wed, May 1, 2019 at 5:14 PM Phillip Wood wrote: > diff --git a/unpack-trees.h b/unpack-trees.h > index d344d7d296..732b262c4d 100644 > --- a/unpack-trees.h > +++ b/unpack-trees.h > @@ -41,9 +41,15 @@ void setup_unpack_trees_porcelain(struct > unpack_trees_options *opts, > */ > void clear_un

[PATCH 1/2] read-tree --reset: add --protect-untracked

2019-05-01 Thread Phillip Wood
From: Phillip Wood Currently there is no way to get git to discard changes to the worktree without overwriting untracked files. `reset --hard`, `checkout --force`, `checkout :/` and `read-tree --reset -u` will all overwrite untracked files. unpack_trees() has known how to avoid overwriting untra