Coder Social home page Coder Social logo

jwu910 / check-it-out Goto Github PK

View Code? Open in Web Editor NEW
154.0 5.0 70.0 8.92 MB

A command line interface for Git Checkout. See branches available for checkout.

Home Page: https://jwu910.github.io/check-it-out/

License: MIT License

JavaScript 0.91% TypeScript 99.09%
git checkout cli check-out github-cli git-cli cli-tool git-branch developer-tools devtool

check-it-out's Introduction

Check It Out Logo

commitizen friendly badge first-timers-only Build Status Downloads per week npm version GitHub version Total alerts Code Climate Score Tweet


Check it out, before you checkout.

Check It Out lets you interactively see and choose what branch you want to check out without the hassle of trying to type out a long or confusing branch name. Checking out branches just got even simpler!

Requirements

Node >= v16 - note: developed and tested on Node 16 and up. There isn't a guarantee this will work on earlier versions.

Git - Required for core features

Compatibility

Check It Out currently has known issues with Windows. Some users have reported it working while others have reported that it does not. It is built and tested mostly in an Arch Linux environment with some user testing on MacOS and other Linux distributions. We're currently looking for help figuring out why Check It Out is unstable on Windows. See CIO-128

Installation

We're on NPM!

npm install -g check-it-out

Installing from source

Fork or clone the repository

git clone https://github.com/jwu910/check-it-out.git

Navigate to your repository directory and run

npm install

Create a symbolic link to the entry point

In the repository directory run:

npm link

Local development

From your repository directory run

npm run build

To start the application you can run

node dist/index.js

or

npm start

If you want to test your local build in other repositories, you can use npm link which will let you run your local build files with the cio or checkit aliases.

Usage

To get started, just run:

checkit

or

cio

Check It Out Usage

Features

See a git log for the highlighted ref by pressing SPACE

Quick Git Log!

Commands Description
j/k, / Navigate the list
h/l, / Previous/Next remote
Ctrl+r Refresh list with a fetch and prune
enter Select highlighted item
y Copy highlighted item
space Git log
& Filter lines - enter blank search to show all lines
/ Search Lines
n Jump to next search result
N Jump to previous search result
q, Ctrl+c, esc Quit

Settings

Git log argument validation is planned, but not finished. Currently, if the git log fails, space should not crash the app, but the process should not spawn at all.

Configurable settings can be found at ~/.config/configstore/check-it-out.json

Options include:

  • gitLogArguments
    • Type: Array
    • Default: ['--color=always', '--pretty=format:%C(yellow)%h %Creset%s%Cblue [%cn] %Cred%d ']
    • Array of strings of valid git log arguments.
  • sort
    • Type: String
    • Default: -committerdate
    • Sort references by latest commit date. Value must be a valid sort key or Check It Out will break on start.
  • themeColor
    • Type: String
    • Default: #FFA66D
    • A hex color code to style Check It Out

To reset Check It Out to its original configurations listed above, start with the flag --reset-config:

cio --reset-config

Contributing

Please refer to the Contributing Guidelines before contributing.

See the rest of our issues

Contributors

This project wouldn't have been possible with the help so many contributors both in and out of the source code. I look forward to working with you as this project continues to evolve and improve.

Brandon Benefield
Brandon Benefield

📖
Aaron Casanova
Aaron Casanova

💻
Drew Brokke
Drew Brokke

💻 🤔 🚧
Johanna Tchon
Johanna Tchon

💻
Jenell Pizarro
Jenell Pizarro

📖
Rebecca Hong
Rebecca Hong

🎨
Jesse Ma
Jesse Ma

💻
Kien Do
Kien Do

💬 🐛 🤔
Vu Tran
Vu Tran

💬 📖 🤔 📢
Efrain 'Rain' Rivas
Efrain 'Rain' Rivas

💬 🐛 💡 🚇 💻 📖
Phuc Le
Phuc Le

💬 📢
Can Cellek
Can Cellek

💻 📖
Aras Atasaygin
Aras Atasaygin

🎨
Donald Lika
Donald Lika

💻
Connor Markwell
Connor Markwell

💻
ahlaw
ahlaw

💻
Kwadwo Busumtwi
Kwadwo Busumtwi

📖
Dev Kant K Chouhan
Dev Kant K Chouhan

📖
Jaya Krishna Namburu
Jaya Krishna Namburu

💻
Céleste Robinson
Céleste Robinson

📖
Juliardi عبدالله
Juliardi عبدالله

💻
Omar Roa
Omar Roa

📖
Rachana
Rachana

💻
aksappy
aksappy

🐛
Mahendra Kumar
Mahendra Kumar

💻 📖
Anthony Camarillo
Anthony Camarillo

💻 👀 🚧
TheCoolBlackCat
TheCoolBlackCat

💻 📖
Jimmy Vu
Jimmy Vu

📖
Catherine Njenga
Catherine Njenga

📖
Himanshu Chauhan
Himanshu Chauhan

🐛

Acknowledgements

@drewbrokke was the initial spark that inspired the creation of this project and encouraged me to let me curiosity drive this forward. @kiend gave me the inspiration and motivation to finish this project after letting it sit for so long. Check This Out. Thank you both for the encouragement and support through my career.

Logo Design by @arasatasaygin @openlogos

License

MIT @ Joshua Wu

check-it-out's People

Contributors

a-camarillo avatar ahlaw avatar aksappy avatar allcontributors[bot] avatar catherinenjenga avatar celesterobinson avatar cmarkwell avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar devkant avatar donaldlika avatar drewbrokke avatar excalith avatar jayakrishnanamburu avatar jimmy-vu avatar jwu910 avatar lorsen avatar rainrivas avatar rebeccahongsf avatar rn2293 avatar sog01 avatar thecoolblackcat avatar vutran avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

check-it-out's Issues

Feature: Implement Tabs

Branches should be grouped by remotes and sorted into tabs.

h/l, left/right should switch between tabs

l currently selects, and should be unset first.

Tabs should be listed above headers and highlight current remote.

Request: Compatibility with Node 6

Node 7 is currently required due to the use of async await functions.

Looking to add Node 6 and compatibility and maybe older versions in the future as well.

If this project is required to build before deployment, we may have to move that route which would require some reorganization.

Implement testing suite

Need find and implement a testing suite to test utility functions.

I have used Jest for web app projects, but not for CLI tools.

Clean up index.js code

Code is messy and hard to read. Need to componentize code


check-it-out/index.js

Lines 22 to 27 in 28797e4

* @todo Clean up index.js code
* @body Code is messy and hard to read. Need to componentize code
*/
if (!process.argv.slice(2).length) {
const screen = dialogue.screen();


This issue was generated by todo based on a @todo comment in 28797e4 when #74 was merged. cc @jwu910.

Bug: If current working directory is not a git repository, app breaks

The app hangs in a blank state if the cwd is not a git repository.
Can simply check if the currentBranch() method returns a valid response or not.

Program should throw an error and print the correct error message for the user

git rev-parse --is-inside-work-tree will return true if path is inside a git repo. otherwise it will go to stderr

Windows Compatibility

Currently does not work with windows.

Some research has explained that this needs to be a portable node app. Reasons the node app probably does not work is the difference in file system paths and how '/' does not resolve on windows systems.

Use path.resolve() as a start.

Build a keyMap utility

Add left and right functionality to change remote. Add getUniqueRemotes method here.


check-it-out/index.js

Lines 39 to 44 in dedef3a

screen.render();
};
/**
* @todo: Build a keyMap utility
* @body: Add left and right functionality to change remote. Add getUniqueRemotes method here.


This issue was generated by todo based on a @todo comment in dedef3a when #79 was merged. cc @jwu910.

Bug: Promise error when creating a new local branch

When checking out a branch that exists on a remote, but not user's local, the following error occurs:

image

[LOG] fatal: Unable to create '/home/joshua/programming/check-it-out/.git/index.lock': File exists.

Suspecting that Git is trying to execute another command before the first command has completed. This would most likely be an incorrect use of Promises with the async and await keywords in the Git utilities.

Improper use of .then()

Using await someAsyncFunction().then(//do something)

Should we be using try catch here and then continuing?

Remove "Path" column

Path column could provide different data. Seems unnecessary to list ref path now...

Maybe list last commit?

Infrastructure: Reorganize blessed objects

Need to compartmentalize blessed screen and window objects.

Currently, code is confusing to read. Entry point should be very minimal, only instantiating the main screen.

Migrate components

Move objects into components:
Screen
Table
Questions
Status bar
etc.?

"Remote" heading doesn't handle branches that are grouped

Branches that are grouped inside of a remote get mis-labeled as having their group be the remote
e.g

remote: origin
branch: hotfix/fix-print-out

since hotfix is a grouping, it would show up as origin/hotfix/fix-print-out; therefore all "hotfix" branches get marked as having hotfix for a remote
image

I'm guessing these lines (or close to it) are the culprits

check-it-out/index.js

Lines 53 to 55 in 0b3a1b1

const branchInfo = val.content.split(/\s*\s/).map(column => {
return column === 'local' ? '' : column;
});

Fix Typos

Need to fix typos in the readme and contributing guidelines.

First time checkout

If branch is not on local, but exists on origin, git checkout should be called without the remote param.

e.g.: git checkout test-branch instead of git checkout origin/test-branch

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.