Skip to content

Commit

Permalink
Use 1 as the default number of commits (git last)
Browse files Browse the repository at this point in the history
This patch sets the default number of commits to 1, in case
no number of commits is specified on the command line (note
that this requires the bash shell, as it uses bash-specific
shell parameter expansion syntax)... avoiding the following
error message:

~ $ git last
error: -n requires an argument
~ $ git-last
error: -n requires an argument
~ $ _
  • Loading branch information
pvdb committed Dec 5, 2011
1 parent b23a712 commit c2633d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions git-last
@@ -1,3 +1,3 @@
#!/bin/sh
REVISIONS=${1}
#!/bin/bash
REVISIONS=${1:-1}
git log -n ${REVISIONS}

0 comments on commit c2633d9

Please sign in to comment.