aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <msabate@suse.com>2020-03-17 17:24:58 +0100
committerMiquel Sabaté Solà <msabate@suse.com>2020-03-17 17:28:22 +0100
commitecdc723c96e0a92fdda3a754edb0302cdc2de9eb (patch)
tree96be54346acd262286a47fbda5b8781f95565190
parentda5b6722c9402aa26cda174ecddfc5e2a76985f6 (diff)
downloadg-ecdc723c96e0a92fdda3a754edb0302cdc2de9eb.tar.gz
g-ecdc723c96e0a92fdda3a754edb0302cdc2de9eb.zip
Rebumped the whole project so it's better looking
I've also added the `git-validation` tool into the test suite. Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
-rw-r--r--.github/ISSUE_TEMPLATE/custom.md32
-rw-r--r--.github/PULL_REQUEST_TEMPLATE.md15
-rw-r--r--CHANGELOG.org30
-rw-r--r--CONTRIBUTING.org52
-rw-r--r--Makefile14
-rw-r--r--README.md44
-rw-r--r--README.org67
7 files changed, 209 insertions, 45 deletions
diff --git a/.github/ISSUE_TEMPLATE/custom.md b/.github/ISSUE_TEMPLATE/custom.md
new file mode 100644
index 0000000..ac97269
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/custom.md
@@ -0,0 +1,32 @@
+---
+name: Custom issue template
+about: General issues, both bugs and features.
+title: ''
+labels: ''
+assignees: mssola
+---
+
+### Description
+
+Check out the [contribution guidelines](../CONTRIBUTING.org) file for some considerations before submitting a new issue.
+
+### Steps to reproduce
+
+1. First I did this...
+2. Then that...
+3. And this happened!
+
+- **Expected behavior**: I expected this to happen!
+- **Actual behavior**: But this happened...
+
+### g version
+
+With a git commit SHA if possible.
+
+### Shell version
+
+Provide the shell version if possible.
+
+### Operating system
+
+The operating system and the exact version you are using.
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000..73e55f7
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,15 @@
+Provide a general description of the changes in your pull request. If this pull
+request fixes a known issue, please tag it as well (e.g.: `Fixes #1`).
+
+Before submitting a PR make sure the following things have been done (and denote
+this by checking the relevant checkboxes):
+
+- [ ] The commits are consistent with the [contribution guidelines](../CONTRIBUTING.org).
+- [ ] You've added tests (if possible) to cover your change(s).
+- [ ] Tests are passing (`make test`).
+- [ ] You've updated the [changelog](../CHANGELOG.org) (if adding/changing
+ user-visible functionality).
+- [ ] You've updated the [readme](../README.org) (if adding/changing
+ user-visible functionality).
+
+Thanks for contributing to this project!
diff --git a/CHANGELOG.org b/CHANGELOG.org
new file mode 100644
index 0000000..ee2753b
--- /dev/null
+++ b/CHANGELOG.org
@@ -0,0 +1,30 @@
+#+STARTUP:showall
+
+* Changelog
+
+** 0.3.x
+
+Lots of minor code improvements across different releases that were not tagged
+in git:
+
+- a54d534d3585 Improved the layout of the table displayed by the =list= command.
+- 3b18f5039369 Improved the layout of the help command.
+- 8b873f3d5e4b Don't allow the user to add shortcuts whose name conflicts with commands.
+- d63a1d032b89 Return a proper exit code.
+- e55408103393 Using the =__g= namespace for everything.
+- ebe139b64189 Allow relative paths.
+- e5541ca8d93c Introduced CI.
+- 21140b4d13d3 Print the usage function if no argument was given.
+- 9e9bee407b7e Replaced the =realpath= function with one taken from [[https://github.com/travis-ci/gimme][travis-ci/gimme]].
+- 0f7ff3a89637 Add copyright notice into the -v/--version flags.
+
+** 0.2
+
+- 3c070c44d7ef Tabulate output of the =list= command.
+- 35c0df4330d4 The third argument of the =add= command is optional now.
+
+** 0.1
+
+- 50c8973995f1 Initial commit with basic functionality.
+- 97122b6f5f29 Added the =--keys= option to the =list= command.
+- 35176441ca34 Added a GNU Bash completion file.
diff --git a/CONTRIBUTING.org b/CONTRIBUTING.org
new file mode 100644
index 0000000..9b9b07c
--- /dev/null
+++ b/CONTRIBUTING.org
@@ -0,0 +1,52 @@
+#+STARTUP:showall
+
+* Contributing
+
+** Running tests
+
+Just run:
+
+#+BEGIN_SRC bash
+$ make test
+#+END_SRC
+
+*** Git validation
+
+In order to ensure that the git log is as maintainable as possible, the
+[[https://github.com/vbatts/git-validation][git-validation]] tool is used. You can install this tool by running:
+
+#+BEGIN_SRC bash
+$ go get -u github.com/vbatts/git-validation
+#+END_SRC
+
+If you already have this tool installed, then simply perform:
+
+#+BEGIN_SRC bash
+$ make git-validation
+#+END_SRC
+
+Note that if you don't have this tool installed the task will do nothing (it
+will just print a help message). This is done so when running the default make
+task this doesn't interrupt it. This task is already called by the default
+=test= one.
+
+** Issue reporting
+
+I'm using [[https://github.com/mssola/writer-mode][Github]] in order to host the code. Thus, in order to report issues you
+can do it on its [[https://github.com/mssola/writer-mode/issues][issue tracker]]. A couple of notes on reports:
+
+- Check that the issue has not already been reported or fixed in =master=.
+- Try to be concise and precise in your description of the problem.
+- Provide a step by step guide on how to reproduce this problem.
+- Provide the version you are using (the commit SHA, if possible).
+
+** Pull requests
+
+- Write a [[https://chris.beams.io/posts/git-commit/][good commit message]].
+- Make sure that tests are passing on your local machine (it will also be
+ checked by the CI system whenever you submit the pull request).
+- Update the [[./CHANGELOG.org][changelog]].
+- Try to use the same coding conventions as used in this project.
+- Open a pull request with *only* one subject and a clear title and
+ description. Refrain from submitting pull requests with tons of different
+ unrelated commits.
diff --git a/Makefile b/Makefile
index f9874d6..01ec0ab 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,15 @@
-test ::
+.PHONY: test
+test: git-validation unit-test
+
+.PHONY: unit-test
+unit-test:
@docker build -t mssola/g:latest .
@docker run --rm mssola/g:latest bash test.sh
+
+.PHONY: git-validation
+git-validation:
+ifeq (, $(shell which git-validation 2> /dev/null))
+ @echo "You don't have 'git-validation' installed, consider installing it (see the CONTRIBUTING.org file)."
+else
+ @git-validation -q -range da5b6722c940..HEAD -travis-pr-only=false
+endif
diff --git a/README.md b/README.md
deleted file mode 100644
index 1902c77..0000000
--- a/README.md
+++ /dev/null
@@ -1,44 +0,0 @@
-# Yeah! just one letter ! [![Build Status](https://travis-ci.org/mssola/g.svg)](https://travis-ci.org/mssola/g)
-
-This repository holds a very humble and simple script that handles shortcuts
-of bash paths. For example:
-
- $ g awesome
- (instead of ...)
- $ cd /home/user/directory/dir/awesome
-
-Furthermore, this repo also brings a file that adds bash completion so the user
-can access the desired directory as fast as possible. In order to manage
-shortcuts, this script accepts three commands:
-
- $ g add awesome /home/user/directory/dir/awesome
- $ g rm awesome
- $ g list
-
-I guess that the commands above are quite self-explanatory. Note though that if
-the path was not given to the add command then the current working directory
-will be picked instead.
-
-## Install
-
-Just place the `g.sh` and the `gcompletion.sh` files wherever you want and then
-add a `source` command for both of the files in the `.bashrc` file.
-
-## Legal stuff
-
-```
-Copyright (C) 2013-2020 Miquel Sabaté Solà <mikisabate@gmail.com>
-
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program. If not, see <http://www.gnu.org/licenses/>.
-```
diff --git a/README.org b/README.org
new file mode 100644
index 0000000..78198fb
--- /dev/null
+++ b/README.org
@@ -0,0 +1,67 @@
+* Yeah! just one letter !
+[[https://travis-ci.org/mssola/g][https://travis-ci.org/mssola/g.svg?branch=master]]
+
+This repository holds a very humble and simple script that handles shortcuts of
+bash paths. For example:
+
+#+BEGIN_SRC bash
+$ g awesome
+# instead of ...
+$ cd /home/user/directory/dir/awesome
+#+END_SRC
+
+Furthermore, this repo also brings a file that adds bash completion so the user
+can access the desired directory as fast as possible. In order to manage
+shortcuts, this script accepts three commands:
+
+#+BEGIN_SRC bash
+$ g add awesome /home/user/directory/dir/awesome
+$ g list
+# Output:
+# awesome => /home/user/directory/dir/awesome
+$ cd /home/user/directory/anotherawesome
+$ g add anotherawesomedir
+$ g rm awesome
+$ g list
+# Output:
+# anotherawesome => /home/user/directory/anotherawesome
+#+END_SRC
+
+I guess that the commands above are quite self-explanatory.
+
+** Install
+
+Just place the =g.sh= and the =gcompletion.sh= files wherever you want and then
+add a =source= command for both of the files in the =.bashrc= file.
+
+** GNU Emacs
+
+I have also created a package for GNU Emacs and it is available on my [[https://github.com/mssola/dotfiles/blob/master/.emacs.d/lisp/g.el][dotfiles]]
+project.
+
+** Contributing
+
+Read the [[./CONTRIBUTING.org][CONTRIBUTING.org]] file.
+
+** [[https://pbs.twimg.com/media/DJDYCcLXcAA_eIo?format=jpg&name=small][Changelog]]
+
+Read the [[./CHANGELOG.org][CHANGELOG.org]] file.
+
+** Legal stuff
+
+#+BEGIN_SRC text
+Copyright (C) 2013-2020 Miquel Sabaté Solà <mikisabate@gmail.com>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+#+END_SRC