From 9386d2ed86de6edf3d7864676abdba6cefd841db Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 21 Aug 2016 11:54:02 +1200 Subject: Fix some errors in dmp(1) manpage --- man/man1/dmp.1 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/man/man1/dmp.1 b/man/man1/dmp.1 index e9b5dc4f..d5883afc 100644 --- a/man/man1/dmp.1 +++ b/man/man1/dmp.1 @@ -5,14 +5,15 @@ .SH SYNOPSIS .B dmp .br -.B dmp 25 +.B dmp +25 .SH DESCRIPTION .B dmp applies dmenu(1) to pick a password entry from a pass(1) store and put it into -the X CLIPBOARD for up to 10 seconds. +the X CLIPBOARD for a period of time, defaulting to 10 seconds, after which +xsel(1) will remove it from the clipboard. .P -An optional timeout in seconds can be applied, after which xsel(1) will remove -the password from the clipboard. This timeout defaults to 10 seconds. +The timeout in seconds can be specified as an optional argument. .SH SEE ALSO dmenu(1), pass(1), xsel(1) .SH AUTHOR -- cgit v1.2.3 From 667ae3c7c5d4c5d4eaff3fbac4f8b3d01f4e365d Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 21 Aug 2016 11:58:44 +1200 Subject: Try the patience diff algorithm --- git/gitconfig.m4 | 1 + 1 file changed, 1 insertion(+) diff --git a/git/gitconfig.m4 b/git/gitconfig.m4 index 62c58f39..15be5052 100644 --- a/git/gitconfig.m4 +++ b/git/gitconfig.m4 @@ -17,6 +17,7 @@ compression = 9 [diff] + algorithm = patience tool = vimdiff [difftool] -- cgit v1.2.3 From dbb3daa10885a534e0698ac45c81069511666803 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 21 Aug 2016 12:02:23 +1200 Subject: Use compact and prune for git-fetch(1) --- git/gitconfig.m4 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/git/gitconfig.m4 b/git/gitconfig.m4 index 15be5052..a8e96429 100644 --- a/git/gitconfig.m4 +++ b/git/gitconfig.m4 @@ -23,6 +23,10 @@ [difftool] prompt = false +[fetch] + output = compact + prune = true + [grep] extendRegexp = true lineNumber = true -- cgit v1.2.3 From 1b9f52a4c40272dfdad6c1ed5c999c039c60eca5 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 21 Aug 2016 12:14:07 +1200 Subject: Show all untracked files in git-status --- git/gitconfig.m4 | 1 + 1 file changed, 1 insertion(+) diff --git a/git/gitconfig.m4 b/git/gitconfig.m4 index a8e96429..d1aac5e8 100644 --- a/git/gitconfig.m4 +++ b/git/gitconfig.m4 @@ -50,6 +50,7 @@ [status] short = true + showUntrackedFiles = all [user] name = DOTFILES_NAME -- cgit v1.2.3 From fe8389a2f5aad6bf4b6a6b003c349fe324cbf84d Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 21 Aug 2016 12:32:50 +1200 Subject: Add some upstream checking to Git prompt Also add some comments to be a bit less cryptic --- README.markdown | 8 ++++---- bash/bashrc.d/prompt.bash | 22 +++++++++++++++++++--- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/README.markdown b/README.markdown index d9e2567d..e17ddb68 100644 --- a/README.markdown +++ b/README.markdown @@ -141,10 +141,10 @@ A terminal session with my prompt looks something like this: It expands based on context to include these elements in this order: -* Whether in a Git repository if applicable, and punctuation to show whether - there are local modifications at a glance; Subversion support can also be - enabled (I need it at work), in which case a `git:` or `svn:` prefix is - added appropriately +* Whether in a Git repository if applicable, and punctuation to show + repository status including reference to upstreams at a glance. Subversion + support can also be enabled (I need it at work), in which case a `git:` or + `svn:` prefix is added appropriately * The number of running background jobs, if non-zero * The exit status of the last command, if non-zero diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash index dca34928..1e8c568d 100644 --- a/bash/bashrc.d/prompt.bash +++ b/bash/bashrc.d/prompt.bash @@ -127,14 +127,30 @@ prompt() { # Collect symbols representing repository state local state + + # Upstream HEAD has commits after local HEAD; we're "behind" + (($(git rev-list --count 'HEAD..@{u}' 2>/dev/null) > 0)) && + state=${state}\< + + # Local HEAD has commits after upstream HEAD; we're "ahead" + (($(git rev-list --count '@{u}..HEAD' 2>/dev/null) > 0)) && + state=${state}\> + + # Tracked files are modified git diff-files --quiet || - state=${state}! + state=${state}\! + + # Changes are staged git diff-index --cached --quiet HEAD || - state=${state}+ + state=${state}\+ + + # There are some untracked and unignored files [[ -n $(git ls-files --others --exclude-standard) ]] && state=${state}\? + + # There are stashed changes git rev-parse --quiet --verify refs/stash >/dev/null && - state=${state}^ + state=${state}\^ # Print the status in brackets; add a git: prefix only if there # might be another VCS prompt (because PROMPT_VCS is set) -- cgit v1.2.3