Re: [PATCH 2/3] worktree: warn when removing a worktree with orphan commits

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

 



Rubén Justo <rjusto@xxxxxxxxx> writes:

> Maybe "HEAD position was" fits for both usages.  This is how it would
> look like:
> ...
> I think, if there are no objections or better suggestions, I'll re-roll
> with "HEAD was at". 

But does it convey the more important point?  The reason why "HEAD
WAS at" may matter is because the user is about to lose history
leading to it.  I wonder if we want to be more direct and alarming,
e.g.

    $ git checkout -
    About to lose history leading to 2efe05c commit-a
    HEAD is now at 7906992 commit-b

Whichever phrasing you end up using, I think the order of messages
should be made consistent between the two cases.  That is,

> Maybe "HEAD position was" fits for both usages.  This is how it would
> look like:
>
>    $ git checkout -
>    HEAD position was 7906992 commit-b
>    HEAD is now at 2efe05c commit-a

Here "git checkout" reports the lost HEAD and then the end result.

>    $ git worktree add test --detach && git worktree remove test
>    Preparing worktree (detached HEAD 2efe05c)
>    HEAD is now at 2efe05c commit-a
>    HEAD position was 2efe05c commit-a

But here "git worktree add" reports the end resultfirst and then
reports the lost HEAD.  It probably should report them in reverse.

Thanks.




[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