GithubHelp home page GithubHelp logo

paulirish / git-recent Goto Github PK

View Code? Open in Web Editor NEW
929.0 13.0 38.0 18 KB

See your latest local git branches, formatted real fancy

Home Page: https://www.npmjs.com/package/git-recent

License: MIT License

Shell 100.00%

git-recent's Introduction

git-recent

Type git recent to see your latest local git branches

Usage

git recent

Optionally, add -n<int> to see the most recent <n> branches

git recent -n5

git-recent screenshot

If you're a Windows user, you need to use Git Bash or similar shell in order to effectively use this utility.

Installation

You can add the git-recent location to your path (e.g. add the directory to your PATH environment or copy git-recent into an existing included path like /usr/local/bin or ~/bin/).

You can use also npm to install the global binary:

npm install --global git-recent

On Mac, you can install with homebrew:

brew install git-recent

If you like this you may also be interested in...

  • git open - Open the repo website in your browser
  • diff-so-fancy - Making the output of git diff so fancy

License

Copyright Paul Irish. Licensed under MIT.

Changelog

  • 2016-05-16 - added to paulirish/dotfiles
  • 2016-08-05 - released in standalone repo and published to npm

git-recent's People

Contributors

amilajack avatar amitmerchant1990 avatar daniel-liuzzi avatar db-pj avatar kevinramsunder avatar paulirish avatar ryanguill avatar taj-codaio avatar vladikoff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

git-recent's Issues

Windows compatibility

Hi @paulirish

I have installed the module on my machine running Windows 10 and got the following:
git-recent
I think something is missing while running it on the Windows.

error: unknown option `color=always'

This affects OS X 10.11 and below.

==> brew test git-recent --verbose
==> FAILED
Testing git-recent
/usr/bin/sandbox-exec -f /tmp/homebrew20180303-48976-qdimti.sb /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/bin/ruby -W0 -I /usr/local/Homebrew/Library/Homebrew -- /usr/local/Homebrew/Library/Homebrew/test.rb /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/git-recent.rb --verbose
==> git init
Initialized empty Git repository in /private/tmp/git-recent-test-20180303-48977-s6zris/.git/
==> git recent
error: unknown option `color=always'
usage: git for-each-ref [<options>] [<pattern>]
   or: git for-each-ref [--points-at <object>]
   or: git for-each-ref [(--merged | --no-merged) [<object>]]
   or: git for-each-ref [--contains [<object>]]

    -s, --shell           quote placeholders suitably for shells
    -p, --perl            quote placeholders suitably for perl
    --python              quote placeholders suitably for python
    --tcl                 quote placeholders suitably for Tcl

    --count <n>           show only <n> matched refs
    --format <format>     format to use for the output
    --sort <key>          field name to sort on
    --points-at <object>  print only refs which points at the given object
    --merged <commit>     print only refs that are merged
    --no-merged <commit>  print only refs that are not merged
    --contains <commit>   print only refs which contain the commit

-n argument seems wont work

seems it ignores the -n argument just now:

lvazquez@HL-113991 ~/w/xxx (feature/270494_multicore)> git recent -n110
feature/254751_suggestions_front 00fc9ca (hace 2 días) IRIS [behind 1]
feat(frontend): 254751-autocomplete search styles

feature/254751_suggestions 0cfde1e (hace 4 días) Leandro
Merge branch 'dev' into feature/254751_suggestions

dev 6754320 (hace 4 días) Leandro [ahead 1, behind 5]
Merge branch 'dev' of http://gitlab.madrid.org/gitadm/xxx into dev

Tag releases

Nice tool! Only just found it. 😮

I've submitted a PR at Homebrew/homebrew-core#8979 to get it brew installable - this issue is in anticipation of being told the release needs to be git tagged (or otherwise have the version number in it).

Might that be possible? 🙂

Table format broken on Windows

At the expense of being the odd one out around here on Windows, I installed git-recent on my system and already love it. It works perfectly overall, except for one minor thing. column messes up the table layout when there are control chars in any except the last column. For example:

git-recent

If I go and temporarily remove the coloring from the refname like so:

  format="\
- %(HEAD) %(color:yellow)%(refname:short)%(color:reset)|\
+ %(HEAD) %(refname:short)|\
  %(color:bold red)%(objectname:short) %(color:bold green)(%(committerdate:relative)) %(color:blue)%(authorname) %(color:reset)%(color:yellow)%(upstream:track)%0a\
-   %(color:black) %(color:reset)|%(contents:subject)%0a\
+    |%(contents:subject)%0a\
    |"

Then columns do line up properly and match the screenshot on the README:

git-recent-2

If I have to guess, this seems to be more of a column problem than a git recent problem, but I though I bring it up in case I'm missing something. If anyone can point me in the right direction I can make a PR attempt.

Why `%(upstream:track)`? ... I'm intrigued! 😀

It's not wrong, but I was just wondering about the purpose of this line:

%(color:bold yellow)%(upstream:track)%(color:reset)

The %(upstream:track) directive is only relevant if you have two local branches, one of which is the upstream for the other one... put differently: it has no relevance for remote-tracking branches.

Like I said: nothing wrong with it, but I'm intrigued by the workflow where you have a local branch with an upstream local... ie. what kind of git workflow would give rise to this use-case?

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.