Re: changing the experimental 'git switch' (was: [Summit topic] Improving Git UX)

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

 



On 22/10/2021 16:24, Ævar Arnfjörð Bjarmason wrote:
FWIW one reason this would be needed is that "switch" intentionally did
not take "git switch unknown-name" to create "unknown-name", but maybe
we could relax that if we just e.g. printed out a notice saying a new
branch is created (which we probably do already...).
I think the "required flag for create" is a good idea and should be kept. (My 2 cents)

having the "new name" identified, also helps the user to get the order of the arguments right.
Take
  git rebase  <upstream>   <branch>
Why is the target listed before the source? But whichever way round, it is hard to remember. If rebase would only take one <upstream>, and the optional <branch> would be a "--from", wouldn't that be easier?

If 2 letters could be used, then -c could be given twice for "create copy"
-c  => create
-c -c  => create copy
-cc  => create copy
Hrm, that's interesting. But probably better to have a long-option.
Well, both: Long and short. But long is --copy or --create-copy.
The issue is finding a short option. -cc imho is still short.

But in "git switch" a new commit for the top is given. So that differs.
Maybe someone can educate me ?
Maybe I'm being dense, but I'm not really seeing how a:

     git switch [some create option] <new> <old>

Would have caveats that we don't have already with:
I only tried to illuminate my question with some made-up examples (the examples were not meant to be a solution).

What exactly does copy/move do? Am I missing any point?
- They create a new branch (when using switch this branch will also be reset to a given commit)
- They copy the reflog
- "move" deletes the old branch (or can be seen as rename)

Anything else?





[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