{"thread":{"id":"1652","subject":"[PATCH] Show the branch name more prominently in \"git status\".","startedAt":"2005-08-26T08:02:46Z","lastAt":"2005-08-26T08:02:46Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"7778","messageId":"7vr7chgm6x.fsf@assigned-by-dhcp.cox.net","threadId":"1652","inReplyTo":null,"subject":"[PATCH] Show the branch name more prominently in \"git status\".","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-08-26T08:02:46Z","receivedAt":"2005-08-26T08:02:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"When not working on \"master\" branch, remind the user at the beginning\nof the status message, not at the end.\n\nAdjust git-revert-script for this change as well.  The way it detected\na clean working tree was depending on the git status behaviour too much.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n\n---\n\n git-revert-script |   10 ++++++----\n git-status-script |   12 ++++++------\n 2 files changed, 12 insertions(+), 10 deletions(-)\n\n0f60ee0f83468393fb3bca2b5e4c8e78a8896cf5\ndiff --git a/git-revert-script b/git-revert-script\n--- a/git-revert-script\n+++ b/git-revert-script\n@@ -2,11 +2,13 @@\n . git-sh-setup-script || die \"Not a git archive\"\n \n # We want a clean tree and clean index to be able to revert.\n-status=$(git status)\n-case \"$status\" in\n-'nothing to commit') ;;\n+dirty=`git-diff-cache --name-only --cached HEAD`\n+case \"$dirty\" in '') dirty=`git-diff-cache --name-only HEAD` ;; esac\n+case \"$dirty\" in\n+'') ;;\n *)\n-\techo \"$status\"\n+\techo >&2 \"Modified:\"\n+\techo \"$dirty\" | sed >&2 -e 's/^/\t/'\n \tdie \"Your working tree is dirty; cannot revert a previous patch.\" ;;\n esac\n \ndiff --git a/git-status-script b/git-status-script\n--- a/git-status-script\n+++ b/git-status-script\n@@ -28,6 +28,12 @@ report () {\n   [ \"$header\" ]\n }\n \n+branch=`readlink \"$GIT_DIR/HEAD\"`\n+case \"$branch\" in\n+refs/heads/master) ;;\n+*)\techo \"#\n+# On branch $branch\" ;;\n+esac\n git-update-cache --refresh >/dev/null 2>&1\n git-diff-cache -M --cached HEAD | sed 's/^://' | report \"Updated but not checked in\" \"will commit\"\n committable=\"$?\"\n@@ -37,10 +43,4 @@ then\n \techo \"nothing to commit\"\n \texit 1\n fi\n-branch=`readlink \"$GIT_DIR/HEAD\"`\n-case \"$branch\" in\n-refs/heads/master) ;;\n-*)\techo \"#\n-# On branch $branch\" ;;\n-esac\n exit 0\n"}]}