Re: git - more like a feature request for pro-lifers

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

 



Am 21.07.20 um 10:28 schrieb Robert Muchacki:
> Greetings!
>
> Attached is a feature request for the pro-lifers. Doesn’t seem to much work to do in the code.

Commenting on attached files is hard, so here's your bug report inlined:

> Thank you for filling out a Git bug report!
> Please answer the following questions to help us understand your issue.
>
> What did you do before the bug happened? (Steps to reproduce your issue)
> I tried to switch branches:
> ```
>   > git checkout other_branch
> ```

When I do that I get:

   $ git init -q a; cd a; echo 1 >a; git add a; git commit -q -m1

   $ git checkout other_branch
   error: pathspec 'other_branch' did not match any file(s) known to git

If I create that branch, then I get:

   $ git branch other_branch
   $ git checkout other_branch
   Switched to branch 'other_branch'

If I create yet another branch, commit a modification, then modify the
file and try to switch to that branch, I get:

   $ git branch branch; echo 2 >a; git add a; git commit -q -m2
   $ echo 3 >a
   $ git checkout branch
   error: Your local changes to the following files would be overwritten by checkout:
   	a
   Please commit your changes or stash them before you switch branches.
   Aborting

> What did you expect to happen? (Expected behavior)
> A friendly information, not confusing, not anti-life, that will tell me why the process stopped.
>
>
> What happened instead? (Actual behavior)
> I got a non-pro-life informatiom, that noticed that it was ABORTING.

So you got the same kind of message that I got on my third attempt
above, right?  That means some files were modified and switching to
the other branch would have destroyed those changes.  Git detected that
and refused, to protect your code changes.

> What's different between what you expected and what actually happened?
> It should have been STOPPED or ENDED. ABORTING and TERMINATING is unrespectful for the unborn code.

Overwriting unexpectedly changed files would be irresponsible, so we
need to keep this feature.  Users can discard changes in more targeted
ways, if that is really what they want to do.

I don't see how any of git checkout's messages is unfriendly, but you
somehow seem to dislike the "Aborting" part at the end of the third
one.  https://en.wiktionary.org/wiki/abort#Verb lists nine meanings:

1. To miscarry; to bring forth (non-living) offspring prematurely.
2. To cause a premature termination of (a fetus); to end a pregnancy
   before term.
3. To end prematurely; to stop in the preliminary stages; to turn back.
4. To stop or fail at something in the preliminary stages.
5. To become checked in normal development, so as either to remain
   rudimentary or shrink away wholly; to cease organic growth before
   maturation; to become sterile.
6. To cause an organism to develop minimally; to cause rudimentary
   development to happen; to prevent maturation.
7. To abandon a mission at any point after the beginning of the mission
   and prior to its completion.
8. To terminate a mission involving a missile or rocket; to destroy a
   missile or rocket prematurely.
9. To terminate a process prior to completion.

The third, fourth and ninth are appropriate here: A checkout was
started, but had to be called off to protect uncommitted changes.

"Abending" would also fit and it has no other meanings.  "Staying on
current branch." would be more to the point.  But actually I'm not
sure we need that last line.  It's shown to emphasize that the
requested action was cancelled, but I can infer that from the rest of
the comprehensive error message already, or even from the the fact
that an error was reported at all.

Would that work as well for new or less technical users?  Dunno.

>
> Anything else you want to add:
>
> Please review the rest of the bug report below.
> You can delete any lines you don't wish to share.
>
>
> [System Info]
> git version:
> git version 2.27.0
> cpu: x86_64
> no commit associated with this build
> sizeof-long: 8
> sizeof-size_t: 8
> uname: Darwin 19.6.0 Darwin Kernel Version 19.6.0: Sun Jul  5 00:43:10 PDT 2020; root:xnu-6153.141.1~9/RELEASE_X86_64 x86_64
> compiler info: clang: 11.0.3 (clang-1103.0.32.59)
> libc info: no libc information available
>
>
> [Enabled Hooks]





[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