Thread (1 message) 1 message, 1 author, 2016-06-15

Re: My first git success [not quite]

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:16
Subsystem: the rest · Maintainer: Linus Torvalds

Possibly related (same subject, not in this thread)

merlyn@stonehenge.com (Randal L. Schwartz) writes:
Well, I'm a developer and *I* also had that problem while working
on my "ajax" branch.

Maybe git-checkout should by default *warn* when it is leaving
things in the tree that are indexed but not updated in the index...
What Linus already said.  But you may find this on top of the
current "master" branch useful.

Likes, dislikes?

-- >8 --
[PATCH] checkout: show dirty state upon switching branches.

This shows your working file state when you switch branches.  As
a side effect, "git checkout" without any branch name (i.e. stay
on the current branch) becomes a more concise shorthand for the
"git status" command.

Signed-off-by: Junio C Hamano <redacted>
---
diff --git a/git-checkout.sh b/git-checkout.sh
index bd7f007..d99688f 100755
--- a/git-checkout.sh
+++ b/git-checkout.sh
@@ -164,6 +164,9 @@ else
 	esac
 	exit 0
     )
+    saved_err=$?
+    git diff-files --name-status
+    (exit $saved_err)
 fi
 
 # 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help