Re: [PATCH v6 15/27] switch: add --discard-changes
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Apr 25, 2019, 10:12 UTC
- Message-ID
- <CACsJy8BF5DwykEmmPGDR7+AzhOAFreJnML073K0xNBdTDjqMJg@mail.gmail.com>
- In-Reply-To
- <17402ee1-68c1-e51f-dc32-0795e0b63bc8@gmail.com>
On Thu, Apr 25, 2019 at 5:02 PM Phillip Wood <phillip.wood123@gmail.com> wrote:
Show 13 quoted lines
> > On 29/03/2019 10:39, Nguyễn Thái Ngọc Duy wrote: > > --discard-changes is a better name than --force for this option since > > it's what really happens. > > I didn't realize when I suggested the name that --force overwrites > untracked files as well as discarding changes from tracked files. I > think we should document that. It would be nice if read-tree --reset -u > took an optional argument so read-tree --reset=tracked -u would not > overwrite untracked files. Then we could have --discard-changes just > discard the changes and not overwrite untracked files. I had a quick > look at unpack trees and it looks like a fairly straight forward change > (famous last words) - perhaps I'll have a go at it next week.
So, --discard-changes is all about tracked changes, and we may have --overwrite-untracked to cover the other part, and --force enables both? That does not sound so bad (and maybe a good cure for those "overwriting untracked" reports we've seen quite often lately).
Good luck with unpack-trees.c. But if it turns out you're too busy, just let me know if want to hand that back to me.
-- Duy