From 834275131195993c4c2135af456c45565a055b39 Mon Sep 17 00:00:00 2001 From: Tony Duckles Date: Wed, 25 Jul 2012 20:58:16 -0500 Subject: [PATCH 01/16] .bashrc: Remove extraneous args from PAGER --- .bashrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.bashrc b/.bashrc index 94c98ff..f318db9 100644 --- a/.bashrc +++ b/.bashrc @@ -129,8 +129,8 @@ export EDITOR # PAGER if test -n "$(command -v less)" ; then - PAGER="less -Fir" - MANPAGER="less -FiRs" + PAGER="less" + MANPAGER="less" else PAGER=more MANPAGER="$PAGER" -- 2.45.2 From 4dd1054e041949bb899ab2f4a12f10106c2c86d2 Mon Sep 17 00:00:00 2001 From: Tony Duckles Date: Thu, 2 Aug 2012 23:17:19 -0500 Subject: [PATCH 02/16] .bashrc: export LESS="-FiR" --- .bashrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.bashrc b/.bashrc index f318db9..37aa797 100644 --- a/.bashrc +++ b/.bashrc @@ -131,6 +131,8 @@ export EDITOR if test -n "$(command -v less)" ; then PAGER="less" MANPAGER="less" + LESS="-FiR" + export LESS else PAGER=more MANPAGER="$PAGER" -- 2.45.2 From 58af2a9d4f6d9586cb0547a93eb30d382cc90779 Mon Sep 17 00:00:00 2001 From: Tony Duckles Date: Thu, 2 Aug 2012 23:18:27 -0500 Subject: [PATCH 03/16] .dircolors: *.mp4 --- .dircolors | 1 + 1 file changed, 1 insertion(+) diff --git a/.dircolors b/.dircolors index b89d975..3491715 100644 --- a/.dircolors +++ b/.dircolors @@ -135,6 +135,7 @@ EXEC 01;32 .asf 01;37 .flc 01;37 .flv 01;37 +.mp4 01;37 .wav 36 # sound formats .aiff 36 -- 2.45.2 From a2cfe2b9888b148ee67589839be9f4e6791e553f Mon Sep 17 00:00:00 2001 From: Tony Duckles Date: Thu, 2 Aug 2012 23:19:04 -0500 Subject: [PATCH 04/16] bin/git-subup: Force "git checkout master" foreach submodule Running "git submodule update --init" rewinds HEAD in each of the submodule directories to point to the revision set in the parent working copy. This could result in a broken HEAD pointer. To avoid weird submodule state, always do a forced "git checkout master" for each submodule after running the init/update and sync. --- bin/git-subup | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/git-subup b/bin/git-subup index 47be7b7..68cfad5 100755 --- a/bin/git-subup +++ b/bin/git-subup @@ -4,4 +4,5 @@ cd $(git rev-parse --show-toplevel) git submodule update --init --quiet git submodule sync --quiet +git submodule foreach --quiet git checkout --quiet master git submodule foreach git pull -- 2.45.2 From 5abfe9ab00da969c8ef12b8ec63809f1f035a396 Mon Sep 17 00:00:00 2001 From: Tony Duckles Date: Thu, 2 Aug 2012 23:27:20 -0500 Subject: [PATCH 05/16] .vim: Update bundle submodules --- .vim/bundle/command-t | 2 +- .vim/bundle/fugitive | 2 +- .vim/bundle/git | 2 +- .vim/bundle/octopress | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.vim/bundle/command-t b/.vim/bundle/command-t index 67e3976..e926704 160000 --- a/.vim/bundle/command-t +++ b/.vim/bundle/command-t @@ -1 +1 @@ -Subproject commit 67e39768ea3a0a01eabcb511e47530558a4534de +Subproject commit e9267044261481fbb6717b482c2f3811eb61b409 diff --git a/.vim/bundle/fugitive b/.vim/bundle/fugitive index 49c6be3..0abe1fb 160000 --- a/.vim/bundle/fugitive +++ b/.vim/bundle/fugitive @@ -1 +1 @@ -Subproject commit 49c6be334c0b7950c837bd9f69c30c9f5ccd2e97 +Subproject commit 0abe1fb12232abe5b7bdfa4d244f04faf3450ba3 diff --git a/.vim/bundle/git b/.vim/bundle/git index 3d31cb0..2d54fb2 160000 --- a/.vim/bundle/git +++ b/.vim/bundle/git @@ -1 +1 @@ -Subproject commit 3d31cb0cc9470d57adf36cc3224814ccb0293cc9 +Subproject commit 2d54fb2b87fe3b74c2fb00edcfaa1f711944e6ea diff --git a/.vim/bundle/octopress b/.vim/bundle/octopress index 3dfd68f..9114eaa 160000 --- a/.vim/bundle/octopress +++ b/.vim/bundle/octopress @@ -1 +1 @@ -Subproject commit 3dfd68fc00c6b1e4589fa47825dd748c3fe1bfad +Subproject commit 9114eaa3d4cd53a4684fafbcef4f065d2dbbfc23 -- 2.45.2 From 26ad220e289f1dde91a38e9f1bc9218a4fada085 Mon Sep 17 00:00:00 2001 From: Tony Duckles Date: Sat, 4 Aug 2012 09:35:19 -0500 Subject: [PATCH 06/16] .bashrc: export LESS="-FiRX" For non-screen'd shells, found that output that was less than a screenful was causing 'less' to: switch to temporary buffer, show output, terminate since it was less than a screenful (-F), and then return to original screen. Ugh. Passing -X (no termcap init) seems to fix this. --- .bashrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bashrc b/.bashrc index 37aa797..5764c0c 100644 --- a/.bashrc +++ b/.bashrc @@ -131,7 +131,7 @@ export EDITOR if test -n "$(command -v less)" ; then PAGER="less" MANPAGER="less" - LESS="-FiR" + LESS="-FiRX" export LESS else PAGER=more -- 2.45.2 From b8fb628362b6e083c06b2863b205933b4e6023d1 Mon Sep 17 00:00:00 2001 From: Tony Duckles Date: Tue, 18 Sep 2012 17:58:15 -0500 Subject: [PATCH 07/16] .screenrc: altscreen=on (alternate buffer) xterm-style emulators support the notion of an alternate buffer with a separate scroll-back history than the "normal" buffer. By default GNU screen has the alternate buffer disabled, but we want it enabled so that alternate buffer switching works as expected (when using an xterm-supporting terminal emulator) for applications that try to use that it, e.g. vim, etc. --- .screenrc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.screenrc b/.screenrc index 054cb18..c06493d 100644 --- a/.screenrc +++ b/.screenrc @@ -33,9 +33,10 @@ attrcolor b ".I" # allow bold colors termcapinfo xterm* 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' # tell screen how to set colors. AB = background, AF=foreground defbce on # erase background with current bg color -# disable altscreen, so PuTTy + screen play nicely together +# enable altscreen, and disable ti/te initializations to allow PuTTy scrollback. +# (http://www4.cs.fau.de/~jnweiger/screen-faq.html) +altscreen on termcapinfo xterm* 'ti@:te@' -altscreen off # xterm understands both im/ic and doesn't have a status line. # Note: Do not specify im and ic in the real termcap/info file as -- 2.45.2 From fec46051f038d2f00ca8cf86bb3fbd2322f70a77 Mon Sep 17 00:00:00 2001 From: Tony Duckles Date: Thu, 13 Dec 2012 20:15:16 -0600 Subject: [PATCH 08/16] .bashrc: Use grep --color=always and setup GREP_COLORS Always use colorized grep and setup custom grep colors. --- .bashrc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.bashrc b/.bashrc index 5764c0c..5958d8d 100644 --- a/.bashrc +++ b/.bashrc @@ -305,12 +305,16 @@ if [ -n "$COLORS" ]; then case "$UNAME" in "SunOS") # For Solaris, use the GNU version of grep for color support - test -x /usr/gnu/bin/grep && alias grep="/usr/gnu/bin/grep --color=auto" + test -x /usr/gnu/bin/grep && alias grep="/usr/gnu/bin/grep --color=always" ;; *) - alias grep="command grep --color=auto" + alias grep="command grep --color=always" ;; esac + # older versions of grep only support a singular highlight color + export GREP_COLOR='1;37;42' + # newer versions of grep have more flexible color configuration + export GREP_COLORS='fn=36:ln=1;33:ms=1;37;42' fi # -------------------------------------------------------------------- -- 2.45.2 From 2d356322d1c3731a49f606db054aa596eacbb9d8 Mon Sep 17 00:00:00 2001 From: Tony Duckles Date: Thu, 13 Dec 2012 20:16:40 -0600 Subject: [PATCH 09/16] .ackrc: Adding, define custom ack colors --- .ackrc | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .ackrc diff --git a/.ackrc b/.ackrc new file mode 100644 index 0000000..28d9149 --- /dev/null +++ b/.ackrc @@ -0,0 +1,25 @@ +# General Ack Settings +# #################################################################### + +# only search with case sensitivity if there is mixed case +--smart-case +# follow symlinks +--follow +# always sort the files +--sort-files +# always color, even if piping to a another program +--color +# no grouping +--noheading +--break + +# Ack Type Settings +# #################################################################### +--type-set=mumps=.m,.ro,.ROU,.GLO +--type-set=markdown=.md,.mkd,.markdown + +# Colors +# #################################################################### +--color-filename=cyan +--color-lineno=yellow bold +--color-match=white on_green bold -- 2.45.2 From cfc24cbdd64327ab5855f4f9d19173593d041eec Mon Sep 17 00:00:00 2001 From: Tony Duckles Date: Wed, 19 Dec 2012 23:14:56 -0600 Subject: [PATCH 10/16] .gitconfig: push.default = matching The default value of push.default is changing in Git 2.0. Set an explicit value to squelch warning message when doing "git push" on Git 1.8 and above. --- .gitconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitconfig b/.gitconfig index 78a06bd..a802e56 100644 --- a/.gitconfig +++ b/.gitconfig @@ -70,3 +70,5 @@ changed = green bold untracked = blue bold +[push] + default = matching -- 2.45.2 From fc98a6422a2a57dbdb37972599508aca064b1651 Mon Sep 17 00:00:00 2001 From: Tony Duckles Date: Wed, 19 Dec 2012 23:21:31 -0600 Subject: [PATCH 11/16] .vim/bundle: Update vim bundle submodules --- .vim/bundle/ack | 2 +- .vim/bundle/command-t | 2 +- .vim/bundle/fugitive | 2 +- .vim/bundle/git | 2 +- .vim/bundle/octopress | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.vim/bundle/ack b/.vim/bundle/ack index 9895285..e93f693 160000 --- a/.vim/bundle/ack +++ b/.vim/bundle/ack @@ -1 +1 @@ -Subproject commit 9895285042a2fd5691b2f6582aa979e4d1bdffea +Subproject commit e93f693fd2a9940d6421bf9e4ddd1f535994eaa5 diff --git a/.vim/bundle/command-t b/.vim/bundle/command-t index e926704..07087e1 160000 --- a/.vim/bundle/command-t +++ b/.vim/bundle/command-t @@ -1 +1 @@ -Subproject commit e9267044261481fbb6717b482c2f3811eb61b409 +Subproject commit 07087e16ba8fe0a87b1d1ccd03e158a0157dc1f8 diff --git a/.vim/bundle/fugitive b/.vim/bundle/fugitive index 0abe1fb..d63a475 160000 --- a/.vim/bundle/fugitive +++ b/.vim/bundle/fugitive @@ -1 +1 @@ -Subproject commit 0abe1fb12232abe5b7bdfa4d244f04faf3450ba3 +Subproject commit d63a475fcb73c782ce09d63a591d69481a62b30f diff --git a/.vim/bundle/git b/.vim/bundle/git index 2d54fb2..4bc24f6 160000 --- a/.vim/bundle/git +++ b/.vim/bundle/git @@ -1 +1 @@ -Subproject commit 2d54fb2b87fe3b74c2fb00edcfaa1f711944e6ea +Subproject commit 4bc24f694d12bea02f8a97a02efc2987a5cb66f9 diff --git a/.vim/bundle/octopress b/.vim/bundle/octopress index 9114eaa..0e6e36a 160000 --- a/.vim/bundle/octopress +++ b/.vim/bundle/octopress @@ -1 +1 @@ -Subproject commit 9114eaa3d4cd53a4684fafbcef4f065d2dbbfc23 +Subproject commit 0e6e36ae5b9e8020539898e36f4579ee9333e591 -- 2.45.2 From e4973cb91e053cf666c1f66168f0a586a659f84a Mon Sep 17 00:00:00 2001 From: Tony Duckles Date: Wed, 19 Dec 2012 23:51:40 -0600 Subject: [PATCH 12/16] .bashrc: put ~/sbin in $PATH if it exists --- .bashrc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.bashrc b/.bashrc index 5958d8d..3ba2059 100644 --- a/.bashrc +++ b/.bashrc @@ -70,17 +70,21 @@ umask 0022 # PATH # ---------------------------------------------------------------------- -# we want the various sbins on the path along with /usr/local/bin +# we want the various sbin's on the path along with /usr/local/bin PATH="$PATH:/usr/local/sbin:/usr/sbin:/sbin" PATH="/usr/local/bin:$PATH" +# put /opt/csw/* on PATH if exists (OpenCSW Solaris packages) +test -d "/opt/csw" && + PATH="/opt/csw/sbin:/opt/csw/bin:$PATH" + # put ~/bin on PATH if exists test -d "$HOME/bin" && PATH="$HOME/bin:$PATH" -# put /opt/csw/* on PATH if exists (OpenCSW Solaris packages) -test -d "/opt/csw" && - PATH="/opt/csw/sbin:/opt/csw/bin:$PATH" +# put ~/sbin on PATH if exists +test -d "$HOME/sbin" && + PATH="$HOME/sbin:$PATH" # ---------------------------------------------------------------------- # ENVIRONMENT CONFIGURATION -- 2.45.2 From eafa1b7b3146d43996f69d5d8a0b105ecdb43cd5 Mon Sep 17 00:00:00 2001 From: Tony Duckles Date: Fri, 21 Dec 2012 21:57:05 -0600 Subject: [PATCH 13/16] bin/git-up: Rewrite to support 'git fetch --all --prune' * Use "[git fetch] --all --prune" (if no given +) to fetch changes from all remotes and prune nonexistent branches. * Use "[git merge] --ff-only" to ensure we only do fast-forward merge from `git pull`. * Grab HEAD before and after pull to see if changed. Previous code relied on HEAD@{1} (i.e. git reflog) which is a false-positive if HEAD didn't actually change during pull. --- bin/git-up | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/bin/git-up b/bin/git-up index fc061d8..43a525a 100755 --- a/bin/git-up +++ b/bin/git-up @@ -13,21 +13,33 @@ set -e PULL_ARGS="$@" -# when invoked as git-reup, run as `git pull --rebase' -test "$(basename $0)" = "git-reup" && -PULL_ARGS="--rebase $PULL_ARGS" +if [ "$(basename $0)" = "git-reup" ]; then + # when invoked as git-reup, run as `git pull --rebase ...' + PULL_ARGS="--rebase $PULL_ARGS" + FETCH_ARGS="" +else + # when invoked as git-up, run as `git pull ...` + PULL_ARGS="--ff-only $PULL_ARGS" + if [ " $@" = " " ]; then + # when invoked without a repo/head, fetch (and prune) all remotes + FETCH_ARGS="--all --prune" + fi +fi -git pull $PULL_ARGS +HEAD_OLD=$(git log -1 --pretty='format:%H' HEAD) +git pull $PULL_ARGS $FETCH_ARGS $@ +HEAD_NEW=$(git log -1 --pretty='format:%H' HEAD) -# show diffstat of all changes if we're pulling with --rebase. not -# sure why git-pull only does this when merging. -test "$(basename $0)" = "git-reup" && { - echo "Diff:" - git --no-pager diff --color --stat HEAD@{1}.. | - sed 's/^/ /' -} +if [ "$HEAD_OLD" != "$HEAD_NEW" ]; then + # if HEAD was actually updated... + if [ "$(basename $0)" = "git-reup" ]; then + # if we're pulling with --rebase, show diffstat of all changes. + # not sure why git-pull only does this when merging. + echo "Diff:" + git --no-pager diff --color --stat ${HEAD_OLD}.. | sed 's/^/ /' + fi -# show an abbreviated commit log of stuff that was just merged. -echo "Log:" -git log --color --pretty=oneline --abbrev-commit HEAD@{1}.. | -sed 's/^/ /' + # show an abbreviated commit log of stuff that was just merged. + echo "Log:" + git log --color --pretty=oneline --abbrev-commit ${HEAD_OLD}.. | sed 's/^/ /' +fi -- 2.45.2 From bba67af10abce04cd4756c609f905ca421520191 Mon Sep 17 00:00:00 2001 From: Tony Duckles Date: Fri, 21 Dec 2012 22:30:45 -0600 Subject: [PATCH 14/16] .gitconfig: Clean-up aliases --- .gitconfig | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/.gitconfig b/.gitconfig index a802e56..300fc89 100644 --- a/.gitconfig +++ b/.gitconfig @@ -3,37 +3,37 @@ email = tony@nynim.org [alias] - browse = !hub browse - w = !hub browse - compare = !hub compare - cb = !git-cut-branch - sh = !git-sh - grab = !github-grab - thanks = !git-thanks - track = !git-track - root = rev-parse --show-toplevel - ll = log -16 --pretty='format:%C(yellow)%h%Creset %s%C(green bold)%d%Creset %C(black bold)(by %an, %ar)%Creset' - lll = log --pretty='format:%C(yellow)%h%Creset %s%C(green bold)%d%Creset %C(black bold)(by %an, %ar)%Creset' - graph = log --all --graph --topo-order --pretty='format:%C(yellow)%h%Creset %s %C(black bold)(by %an)%Creset%C(green bold)%d%Creset%n' - review = log -p --max-count=1 - fp = format-patch --stdout + # Simple aliases ci = commit st = status br = branch co = checkout - cv = !git-cv - lg = log -p - who = shortlog -s -- - bd = !git-brdate - bv = !git branch --color -v | cut -c1-100 + tags = tag -n1 -l + # Log helpers + ll = log -16 --pretty='format:%C(yellow)%h%Creset %s%C(green bold)%d%Creset %C(black bold)(by %an, %ar)%Creset' + lll = log --pretty='format:%C(yellow)%h%Creset %s%C(green bold)%d%Creset %C(black bold)(by %an, %ar)%Creset' + graph = log --all --graph --topo-order --pretty='format:%C(yellow)%h%Creset %s %C(black bold)(by %an)%Creset%C(green bold)%d%Creset%n' + # Remote helpers + track = !git-track incoming = !git-incoming in = !git-incoming outgoing = !git-outgoing out = !git-outgoing + # Branch helpers + bd = !git-brdate + bv = !git branch --color -vv + cv = !git-cv subtree = !git-subtree - sup = !git-subup + # Diff helpers df = diff --patience - di = diff --patience --cached + dfc = diff --patience --cached + # Misc + root = rev-parse --show-toplevel + sh = !git-sh + thanks = !git-thanks + who = shortlog -s -- + sup = !git-subup + fp = format-patch --stdout [core] filemode = true -- 2.45.2 From bd6233b9f25690e63ff9ddf4f22b3ccc10c849ff Mon Sep 17 00:00:00 2001 From: Tony Duckles Date: Sat, 22 Dec 2012 02:09:34 -0600 Subject: [PATCH 15/16] bin/git-subup: Use --prune for 'git pull' --- bin/git-subup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/git-subup b/bin/git-subup index 68cfad5..04ea0b5 100755 --- a/bin/git-subup +++ b/bin/git-subup @@ -5,4 +5,4 @@ cd $(git rev-parse --show-toplevel) git submodule update --init --quiet git submodule sync --quiet git submodule foreach --quiet git checkout --quiet master -git submodule foreach git pull +git submodule foreach git pull --prune -- 2.45.2 From 8b96472116db7167aca29c63204e2d0d4c8b7985 Mon Sep 17 00:00:00 2001 From: Tony Duckles Date: Sat, 22 Dec 2012 12:52:06 -0600 Subject: [PATCH 16/16] .bashrc: Use __git_ps1() in $PS1 Use __git_ps1() to display current branch info in bash prompt (PS1). * Never show this for the $HOME (dotfiles) repo since it would get obnoxious. * Check a (custom) `git config` variable to allow repo-specific exclusion of __git_ps1() handling. --- .bashrc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.bashrc b/.bashrc index 3ba2059..d1c375d 100644 --- a/.bashrc +++ b/.bashrc @@ -192,7 +192,17 @@ prompt_compact() { } prompt_color() { - PS1="\[\033[0;90m\][${PS_C1}\u@\h\[\033[0m\]\[\033[0;90m\]:${PS_C2}\w\[\033[0;90m\]]${PS_P}\[\033[0m\] " + # If git and the git bash_completion scripts are installed, use __git_ps1() to show current branch info. + # Never show branch info for $HOME (dotfiles) repo. + # Use the following to exclude a given repo: `git config --local --bool --add bash.hidePrompt true` + if [ -n "$(type -P git)" -a "$(type -t __git_ps1)" = "function" ]; then + PS_GIT='$(test -n "$(__git_ps1 %s)" && + test "$(git rev-parse --show-toplevel)" != "$HOME" && + test "$(git config --bool bash.hidePrompt)" != "true" && + __git_ps1 "{\[\033[0;100m\]%s\[\033[0;90m\]}")' + export GIT_PS1_SHOWDIRTYSTATE=1 + fi + PS1="\[\033[0;90m\][${PS_C1}\u@\h\[\033[0m\]\[\033[0;90m\]:${PS_C2}\w\[\033[0;90m\]]${PS_GIT}${PS_P}\[\033[0m\] " PS2="> " } -- 2.45.2