Re: [PATCH v3 10/21] checkout: split part of it to new command 'switch'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 27, 2019 at 5:24 PM Phillip Wood <phillip.wood123@xxxxxxxxx> wrote:
>
> On 26/03/2019 15:48, Elijah Newren wrote:
> > On Tue, Mar 26, 2019 at 8:24 AM Duy Nguyen <pclouds@xxxxxxxxx> wrote:
> >> On Tue, Mar 26, 2019 at 10:01 PM Elijah Newren <newren@xxxxxxxxx> wrote:
> >
> >> Yeah.. --ignore-in-process does not necessarily mean aborting
> >> something when you just want to get out to examine some other commit.
> >> And I agree doing nothing seems like the best (or least
> >> confusing/surprising) option.
> >>
> >> There will be some funny thing. Like if you commit after switching
> >> away and MERGE_HEAD is there, I think you will be creating a merge
> >> commit.
> >
> > Yes, and in the middle of a cherry-pick with a range you've added some
> > commits to one branch and some to another.  In the middle of a revert
> > you're doing similar.  It sounds like crazytown to me (and maybe we
> > shouldn't provide the --ignore-in-process flag unless users clamor for
> > it

I missed this part in my last reading. I think if we could safely
switch away and get back to resume, then --ignore-in-process could
still be useful. I sometimes switch to another commit to check out
stuff then back. For interactive rebase with "edit" command for
example, it's quite safe to do so. (yes the other option is "git
worktree add", but that could be a heavy hammer sometimes)

> I think that could be the way to go for merges and cherry-picks, or

Just so we're clear, what is your "the way" to go? to remove
CHERRY_HEAD_PICK and MERGE_HEAD (and other MERGE_* as well) if
--ignore-in-process is specified? Or to leave MERGE_* and
CHERRY_PICK_HEAD alone and delete other stuff?

> possibly require --discard-changes as well. The only time I use checkout
> like this is during a rebase if I want to rewind it - I edit the todo
> list with the output of 'git log --pretty="pick %h %s" --reverse' and do
> 'git checkout' followed by 'git rebase --continue' Though these days I
> could add a 'reset' line to the todo list and skip the checkout.
-- 
Duy



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux