aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-08-21 11:27:47 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-08-21 11:27:47 +1200
commitcab985614fd72c2d82e57156e16f09a79c3f19f8 (patch)
treef1be1e18c29d41474a0c727fea64271300874b9b
parentDon't show comments in $EDITOR for git commit (diff)
downloaddotfiles-cab985614fd72c2d82e57156e16f09a79c3f19f8.tar.gz
dotfiles-cab985614fd72c2d82e57156e16f09a79c3f19f8.zip
Resolve an issue with incorrect prompt info
From `man 1 git-config`: > diff.autoRefreshIndex > When using git diff to compare with work tree files, do not > consider stat-only change as changed. Instead, silently run git > update-index --refresh to update the cached stat information for > paths whose contents in the work tree match the contents in the > index. This option defaults to true. Note that this affects only > git diff Porcelain, and not lower level diff commands such as git > diff-files.
-rw-r--r--ISSUES.markdown18
-rw-r--r--bash/bashrc.d/prompt.bash3
2 files changed, 5 insertions, 16 deletions
diff --git a/ISSUES.markdown b/ISSUES.markdown
index 95402145..9cccdb03 100644
--- a/ISSUES.markdown
+++ b/ISSUES.markdown
@@ -1,4 +1,5 @@
-Known issues
+Known issues issuesW:L
+
============
* man(1) completion doesn't work on OpenBSD as manpath(1) isn't a thing on
@@ -15,21 +16,6 @@ Known issues
git-reflog(1) cals
* The \xFF syntax for regex as used in rfct(1) is not POSIX. Need to decide
if it's well-supported enough to keep it anyway.
-* Git prompt seems to change its mind about file moves after a run of
- git-status:
-
- tom@conan:~/.dotfiles(master)$ git mv bash/bashrc.d/ud.bash sh/shrc.d/ud.sh
- tom@conan:~/.dotfiles(master!+)$ git diff --cached
- diff --git a/bash/bashrc.d/ud.bash b/sh/shrc.d/ud.sh
- similarity index 100%
- rename from bash/bashrc.d/ud.bash
- rename to sh/shrc.d/ud.sh
- tom@conan:~/.dotfiles(master!+)$
- tom@conan:~/.dotfiles(master!+)$
- tom@conan:~/.dotfiles(master!+)$ git status
- R bash/bashrc.d/ud.bash -> sh/shrc.d/ud.sh
- tom@conan:~/.dotfiles(master+)$
-
* On OpenBSD pdksh, including single quotes in comments within command
substitution throws "unclosed quote" errors in the linter checks:
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash
index 081cff69..3b0578ba 100644
--- a/bash/bashrc.d/prompt.bash
+++ b/bash/bashrc.d/prompt.bash
@@ -122,6 +122,9 @@ prompt() {
fi
branch=${branch##*/}
+ # Refresh index so e.g. git-diff-files(1) is accurate
+ git update-index --refresh >/dev/null
+
# Collect symbols representing repository state
local state
if ! git diff-files --quiet ; then