Giter VIP home page Giter VIP logo

gitlab-mr-from-commit's Introduction

GitLab-MR-From-Commit

Open MR page in GitLab associated with a Commit.
It works Not Only in Terminal but also Editor like Emacs!!

This Project is fully respecting This Project.

How It Works

on Terminal

terminal

on Emacs

emacs

Quick Start on Terminal

1. Fill the variables in gitlab-mr-from-commit

# Get it from gitlab
# See: https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html
PRIVATE_TOKEN='[YOUR PRIVATE TOKEN]'

# Get it from your project's setting page
# On the Edit Project page in GitLab, there is a Project ID field in the top right corner.
PROJECT_ID='[YOUR PROJECT ID]'

# It should be like `https://gitlab.com`
PROJECT_BASE_URL='[YOUR PROJECT BASE URL]'

# Directory should be `my-project/product1`
PROJECT_DIRECTORY='[YOUR PROJECT DIRECTORY]'

2. Set the PATH

# In your .bashrc or .zshrc or so
# Set the PATH as bellow
export PATH="$HOME/gitlab-mr-from-commit:$PATH"

3. Execute!!

# It will open MR on GitLab!
$ gitlab-mr-from-commit [YOUR_COMMIT_HASH]

Using with Tig

1. Install tig

$ brew intall tig

2. Customize .tigrc

# In .tigrc, bind your fav key to execute command
bind generic O @gitlab-mr-from-commit %(commit)

3. Execute with tig!!

# Open tig
$ tig [FILE]

# Then Type...
$ Shift+o

# That's All

Start on Emacs

1. Add a function on your nice init.el (quoted from Here)

;; init.el
(defun gitlab-open-mr ()
  (interactive)
  (let* ((rev-at-line (vc-annotate-extract-revision-at-line))
		 (rev (car rev-at-line)))
	(shell-command (concat "gitlab-mr-from-commit " rev))))

;; key bind
(global-set-key (kbd "C-o") 'gitlab-open-mr)

2. Execute with vc-annotate!!

;; In a file, under the Git Control....
M-x vc-annotate RET Ctrl+o

;; That's All

gitlab-mr-from-commit's People

Contributors

blue0513 avatar

Watchers

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