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

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

 



Jeff King <peff@xxxxxxxx> writes:

> 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.

Another reason why scripting around "action" may be OK is that most
of the time scriptors would want to (blindly) adopt improvements
made to the underly ing command anyway.  If you scripted around "git
checkout" before we introduced multiple worktree feature where a
branch that is already active in another worktree is protected from
getting checked out elsewhere, your script will automatically get
that protection (and more importantly, the error message given as an
explanation to the end users) for free.  Of course your script must
be prepared to react correctly to a failure from "git checkout", but
that goes without saying for any command you invoke in your script.




[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