git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Phil Hord <phil.hord@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	"Randall S. Becker" <rsbecker@nexbridge.com>,
	Christian Couder <christian.couder@gmail.com>,
	Git <git@vger.kernel.org>
Subject: Re: What's cooking in git.git (Jul 2019, #06; Thu, 25)
Date: Sat, 10 Aug 2019 02:10:07 -0400	[thread overview]
Message-ID: <20190810061006.GB25876@sigill.intra.peff.net> (raw)
In-Reply-To: <CABURp0pb4QY+Qbvn6YAtQ=bevSQW+vQXFMChyd_phtUK4P5M7w@mail.gmail.com>

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@pobox.com> wrote:
> >
> > Jeff King <peff@peff.net> 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

  reply	other threads:[~2019-08-10  6:10 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-26  0:19 What's cooking in git.git (Jul 2019, #06; Thu, 25) Junio C Hamano
2019-07-26 14:33 ` Johannes Schindelin
2019-07-26 20:23   ` Junio C Hamano
2019-07-27 19:38 ` Rohit Ashiwal
2019-07-27 20:40   ` Elijah Newren
2019-07-27 20:57     ` Rohit Ashiwal
2019-07-27 21:42       ` Elijah Newren
2019-07-28 20:34 ` Carlo Arenas
2019-08-09  0:13 ` Taylor Blau
2019-08-09  1:34   ` Ariadne Conill
2019-08-09  2:07     ` Taylor Blau
2019-08-09  3:04       ` Ariadne Conill
2019-08-09  3:07       ` Phil Hord
2019-08-09  3:21         ` Ariadne Conill
2019-08-09 11:21           ` Taylor Blau
2019-08-09 11:41         ` Jeff King
2019-08-09 17:39           ` Phil Hord
2019-08-09 14:06     ` Randall S. Becker
2019-08-09 16:29       ` Jeff King
2019-08-09 16:32         ` Randall S. Becker
2019-08-09 17:45         ` Junio C Hamano
2019-08-09 18:05           ` Phil Hord
2019-08-10  6:10             ` Jeff King [this message]
2019-08-12  0:39               ` Junio C Hamano
2019-08-12 13:39                 ` Randall S. Becker
2019-08-09 17:44       ` Junio C Hamano
2019-08-09 19:06         ` Randall S. Becker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190810061006.GB25876@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=phil.hord@gmail.com \
    --cc=rsbecker@nexbridge.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).