Skip to content

Easily add multiple contributors/authors/byLines to a recent Git commit... no extra commands to remember!

Notifications You must be signed in to change notification settings

bleuf1sh/git-byLines

Repository files navigation

git-byLines

Easily add multiple contributors/authors/byLines to a recent Git commit.
Simply git commit as usual... no extra commands to remember!

Installation

Simply copy/paste this line into terminal (bash) and run to install

curl -sL "https://raw.githubusercontent.com/bleuf1sh/git-byLines/master/installByLines.sh?$(date +%s)" > installByLines.sh && bash installByLines.sh

Demo

Usage

  • Runs automatically after any git commit shell command
  • Invoke directly with the byLines shell command

Features

  • Super lightweight (just bash and python)
  • Easy 1 handed install
  • Intelligently add contributors using the Authored-by or Co-authored-by
    syntax based on selection count or if an Authored-by is already present
  • Prevents adding duplicate authors
  • Ability to disable for an individual repo
  • Remembers and Auto selects the previously used byLines
  • Displays a preview before amending of the final commit message for confirmation
  • Currently supports adding unlimited contributors
  • Python 2 and 3 compatible
  • Uses a local dependency folder to not clutter your global Python dependencies
  • byLine can be safely run back-to-back in case someone was forgotten

What makes this different than other approaches out there?

There are no specific commands to remember or configurations to setup before use.
The code is triggered upon any git commit command performed within any git repo. Thereby achieving that natural flow similar to signing your name after writing an email.

How does it work?

git-byLines overloads the git command via shell function and is triggered upon any git commit command.
It can also be triggered manually via the shell function byLines.

A config file named .config.byLines.json is automatically generated inside of each repo and is recommended to be added to source control.

Manual Install

  1. Clone this repo to a directory of your choosing
  2. Look at additionsToBashProfile.sh for examples of the functions to manually add (adapt) to your shell

Requirements

  • Python 2.7 and above
  • Pip

Test Installation of Custom Branch

Replace master with custom branch name

curl -sL "https://raw.githubusercontent.com/bleuf1sh/git-byLines/master/installByLines.sh?$(date +%s)" > installByLines.sh && bash installByLines.sh "master"

TODO

  • Add ability to notify that an update is available
  • Windows (PowerShell or CMD) support
  • (DONE) ReCycle the prompts when not amending
  • (DONE) Support for Fish shell
  • (DONE) Support when commands are missing the leading colon
  • (DONE) Isolate selections to numbers and commands to letters
  • (DONE) Remember recently used byLines
  • (DONE) Double author protection
  • (DONE) Toggle selection of byLines
  • (DONE) Add easy one line installer
  • (DONE) Develop PoC amend post commit approach

Inspired by

# MIT License

# Copyright (c) 2019 Aaron

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:

# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.

# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

About

Easily add multiple contributors/authors/byLines to a recent Git commit... no extra commands to remember!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published