From b8f205465872231231b3e786363466c05a08fad8 Mon Sep 17 00:00:00 2001 From: bleis-tift Date: Fri, 4 Mar 2011 01:44:47 -0800 Subject: [PATCH 1/2] --- .vimrc | 1 + git-now | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 .vimrc diff --git a/.vimrc b/.vimrc new file mode 100644 index 0000000..c26f5e5 --- /dev/null +++ b/.vimrc @@ -0,0 +1 @@ +nnoremap gn :w:Git now \ No newline at end of file diff --git a/git-now b/git-now index 69e8cea..d7dc119 100644 --- a/git-now +++ b/git-now @@ -1,7 +1,7 @@ #!/bin/sh PREFIX="from now" -MESSAGE="[${PREFIX}] `date`" +MESSAGE="[${PREFIX}] `date +\"%Y/%m/%d %T\"`" if [ $# -eq 0 ] then From 2cc1580c12eddf6aa8e2c42cc7284df80a388a24 Mon Sep 17 00:00:00 2001 From: bleis-tift Date: Fri, 4 Mar 2011 07:08:06 -0800 Subject: [PATCH 2/2] --- .vimrc | 3 ++- git-now | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.vimrc b/.vimrc index c26f5e5..2df08c5 100644 --- a/.vimrc +++ b/.vimrc @@ -1 +1,2 @@ -nnoremap gn :w:Git now \ No newline at end of file +nnoremap gn :w:Git now +nnoremap gN :w:Git now --all \ No newline at end of file diff --git a/git-now b/git-now index d7dc119..0eeef51 100644 --- a/git-now +++ b/git-now @@ -9,7 +9,13 @@ then printf "${MESSAGE}\n\n%s" "`git diff --cached`" | git commit -F - elif [ $1 != "--rebase" ] then - git add $@ + if [ $1 != "--all" ] + then + git add $@ + else + git add -u + git add . + fi printf "${MESSAGE}\n\n%s" "`git diff --cached`" | git commit -F - else FIRST_NOW_COMMIT=`git log --pretty=oneline --grep="${PREFIX}" | tail -n 1 | cut -d " " -f 1`