This commit is contained in:
Paul Irish 2016-08-05 11:44:57 -07:00
commit 59506473c2
No known key found for this signature in database
GPG key ID: 0556093828825272
3 changed files with 85 additions and 0 deletions

30
git-recent Executable file
View file

@ -0,0 +1,30 @@
#!/bin/bash
##
## git-recent
##
## list all local branches, sorted by last commit, formatted reall purdy
##
format="\
%(HEAD) %(color:yellow)%(refname:short)%(color:reset)|\
%(color:bold red)%(objectname:short) %(color:bold green)(%(committerdate:relative)) %(color:blue)%(authorname)%0a\
%(color:black) %(color:reset)|%(contents:subject)%0a\
|"
lessopts="--tabs=4 --quit-if-one-screen --RAW-CONTROL-CHARS --no-init"
git for-each-ref \
--sort=-committerdate \
"refs/heads/" \
--format="$format" \
| column -ts '|' \
| less "$lessopts"
# The above command:
# for all known branches,
# sort descending by last commit
# show local branches (change to "" to include both local + remote branches)
# apply the formatting template above
# break into columns
# use the pager only if there's not enough space

25
package.json Normal file
View file

@ -0,0 +1,25 @@
{
"name": "git-recent",
"version": "1.0.0",
"description": "List recent git branches, formatted so fancy",
"bin": {
"git-recent": "git-recent"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/paulirish/git-recent.git"
},
"keywords": [
"git",
"branches"
],
"author": "Paul Irish",
"license": "MIT",
"bugs": {
"url": "https://github.com/paulirish/git-recent/issues"
},
"homepage": "https://github.com/paulirish/git-recent#readme"
}

30
readme.md Normal file
View file

@ -0,0 +1,30 @@
# git-open
Type `git recent` to see your latest local git branches
## Usage
git recent
![git-recent screenshot](https://cloud.githubusercontent.com/assets/39191/17446638/039d4cee-5aff-11e6-9e11-4294f0020513.png)
### Installation
You can add the `git-recent` location o your path (e.g. add the directory to your `PATH` environment
or copy `git-open` into an existing included path like `/usr/local/bin` or `~/bin/`).
You can use also `npm` to install an OLD (1 year ago) version of this package:
npm install --global git-open
## License
Copyright Paul Irish. Licensed under MIT.
## Changelog
- **2016-05-16** - added to [paulirish/dotfiles](https://github.com/paulirish/dotfiles/commit/1ca1ff760832af558447145fa2a367046b1829d2)
- **2016-08-05** - released in standalone repo and published to npm