Re: What's cooking in git.git (Jul 2019, #06; Thu, 25)

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

 



On Fri, Aug 09, 2019 at 11:05:34AM -0700, Phil Hord wrote:

> On Fri, Aug 9, 2019 at 10:48 AM Junio C Hamano <gitster@xxxxxxxxx> wrote:
> >
> > Jeff King <peff@xxxxxxxx> writes:
> >
> > > I don't know of any plans for checkout in particular, but I think the
> > > docs for restore/switch make it clear that it's way too early to start
> > > scripting around them:
> > >
> > >   $ git grep EXPERIMENTAL Documentation/
> > >   Documentation/git-restore.txt:THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOR MAY CHANGE.
> > >   Documentation/git-switch.txt:THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOR MAY CHANGE.
> >
> > Would it ever be OK to script around checkout, restore and/or switch
> > Porcelain commands?
> 
> Users who wish to get their job done will script around porcelain all
> the time.  I would be surprised if even 1% of build scripts use 'git
> checkout-index' instead of 'git checkout'.

It's even worse if you really want to switch branches, and not checkout
files. You'd probably need to use symbolic-ref, read-tree, and
checkout-index.

IMHO scripting around "action" commands like checkout is less bad than
around "output" commands like log. The general action of "switch to this
branch" is unlikely to be changed much over the years (or via config),
but the output of log, etc, is.

There are no guarantees, of course, but I imagine that the tradeoff in
simplicity of using git-switch versus manually reimplementing it is
probably a good one for many scripts.

-Peff



[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