Giter Site home page Giter Site logo

phyllisstein / git-commit-atom Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mmore500/git-commit-atom

0.0 2.0 0.0 19 KB

Easily edit Git Commit messages in the current Atom pane ๐ŸŒŸ ๐Ÿ˜

License: MIT License

Makefile 30.91% Go 69.09%

git-commit-atom's Introduction

git-commit-atom

Want to use Atom's handy COMMIT_EDITMSG syntax highlighting? ๐Ÿ™‹

Tired of waiting on Atom to open a new window with the --wait option? :hourglass: :sleeping:

Together with sister Atom package git-edit-atom, this Go script allows Git commit files to be conveniently edited in the current editor pane... avoiding the launch of another instance of Atom! :star2: :smirk:

A screenshot of git-edit-atom and git-commit-atom in action together

Prerequisites

Installation

There are two steps to the installation process:

  • installing the Go script, and
  • configuring Git to use the Go script.

There are two ways to install the Go script. If you have Go installed on your machine (want it? see here), you can use the following commands to install from source.

go get github.com/mmore500/git-commit-atom
go install github.com/mmore500/git-commit-atom

If your are installing from source, be sure your GOBIN is included in your PATH! If your PATH isn't already properly configured, try adding the following lines to your .bash_profile.

export GOPATH=$HOME/go
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOPATH/bin

If you don't want to build from source, you can find pre-built executable binaries here. All you have to do is

  • download zipped folder appropriate for your operating system and architecture,
  • unzip it, and
  • toss the executable into a bin on your PATH.

To configure Git to use the Go script, use the following command at your terminal.

git config --global core.editor "git-commit-atom"

If you have preexisting Git repositories, you might have to use

git config core.editor "git-commit-atom"

on them.

Usage

Once git-commit-atom is configured as Git's editor, Git COMMIT_EDITMSG, TAG_EDITMSG, MERGE_MSG, git-rebase-todo, and .diff files will open in the current pane of Atom.

To complete the message editing process simply close the tab (cmd-w is convenient) if the Atom package git-edit-atom is installed or, if not, enter quit or done at the terminal.

Implementation

This project has two components: a standalone Go script that acts as the editor called by Git during the commit process and the Atom package git-edit-atom.

When the standalone Go script is activated, it opens the COMMIT_EDITMSG file in the current Atom pane. When that file is closed, Atom appends a "magic marker" (## ATOM EDIT COMPLETE##) to the end of the COMMIT_EDITMSG file. The Go script, which is listening to the end of the COMMIT_EDITMSG file, recognizes the "magic marker" and terminates, ending the commit edit session.

In addition, the Go script listens for user input at the terminal. The commit session can also be ended by entering quit or done. (This functionality allows the standalone script to function in some capacity without the Atom package in place).

This project is directly inspired by AJ Foster's git-commit-atom.sh, presented on his personal blog. It is hoped that this implementation in Go and as an Atom package will yield greater portability and reliability.

git-commit-atom's People

Contributors

mmore500 avatar phyllisstein avatar aj-foster avatar rhuss avatar

Watchers

James Cloos avatar  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.