Coder Social home page Coder Social logo

kaleidoscopevcstidbits's Introduction

Kaleidoscope Version Control Tidbits

Some fun ways to make version control and Kaleidoscope dance.

Everything is git right now, but glad to take pull requests for other kinds of VCS.

KSReview

KSReview is a useful way to do codereviews of feature branches. It will send all the work done on a feature branch since it diverged from master or a specified mainline branch to Kaleidoscope.

Git Alias

ksreview = "!sh -c 'SHA=${1:-HEAD}; BRANCH=${2:-master}; if [ $SHA == $BRANCH ] ; then SHA=HEAD; fi; git difftool -y -t Kaleidoscope $BRANCH...$SHA;' -"

Git One Liner

git config --global alias.ksreview '!f() { local SHA=${1:-HEAD}; local BRANCH=${2:-master}; if [ $SHA == $BRANCH ]; then SHA=HEAD; fi; git difftool -y -t Kaleidoscope $BRANCH...$SHA; }; f'

Git Usage

To review HEAD with master as your mainline branch

git ksreview

To review a branch or sha when master is your mainline branch

git ksreview some-feature-branch-or-sha

To review a branch (or sha) by name with a custom mainline branch

git ksreview some-feature-branch-or-sha mainline-branch

KSShow

This one comes care of https://twitter.com/stevelosh/status/270931273214746625 with the addition of HEAD as a default value.

KSShow gives you the contents of an arbitrary sha in Kaleidoscope.

Git Alias

ksshow = "!sh -c 'SHA=${1:-HEAD}; git difftool -y -t Kaleidoscope $SHA^..$SHA;' -"

Git One Liner

git config --global alias.ksshow '!f() { local SHA=${1:-HEAD}; git difftool -y -t Kaleidoscope $SHA^..$SHA; }; f'

Git Usage

To open the most recent commit on the current branch in Kaleidoscope

git ksshow

To open an arbitrary sha in Kaleidoscope

git ksshow some-sha

KSDiff

KSDiff is just a more compact version of difftool -y -t Kaleidoscope for people who don't use Kaleidoscope as the default difftool.

Git Alias

ksdiff = difftool -y -t Kaleidoscope

Git One Liner

git config --global alias.ksdiff "difftool -y -t Kaleidoscope"

Git Usage

To see the contents of the most recent commit

git ksdiff HEAD^..HEAD

Notes

A coworker of mine pointed out that it might be nice to give some of these more idiomatic git like names, so for people that like that kind of thing:

ksreview becomes

review = "!sh -c 'SHA=${1:-HEAD}; BRANCH=${2:-develop}; if [ $SHA == $BRANCH ] ; then SHA=HEAD; fi; git diff $BRANCH...$SHA;' -"

and

reviewtool = "!sh -c 'SHA=${1:-HEAD}; BRANCH=${2:-develop}; if [ $SHA == $BRANCH ] ; then SHA=HEAD; fi; git difftool -y -t Kaleidoscope $BRANCH...$SHA;' -"

ksshow becomes

showtool = "!sh -c 'SHA=${1:-HEAD}; git difftool -y -t Kaleidoscope $SHA^..$SHA;' -"

kaleidoscopevcstidbits's People

Contributors

bryant1410 avatar rustle avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.