From: Simon Oosthoek <soosthoek@nieuwland.nl>
To: Michael J Gruber <git@drmicha.warpmail.net>
Cc: Simon Oosthoek <s.oosthoek@xs4all.nl>,
Git Mailing List <git@vger.kernel.org>,
gitster@pobox.com, spearce@spearce.org, artagnon@gmail.com,
schwab@linux-m68k.org
Subject: Re: [PATCH 2/2] show color hints based on state of the git tree
Date: Mon, 15 Oct 2012 12:34:24 +0200 [thread overview]
Message-ID: <507BE6B0.4020306@nieuwland.nl> (raw)
In-Reply-To: <507BD3C1.4040807@drmicha.warpmail.net>
On 10/15/2012 11:13 AM, Michael J Gruber wrote:
>
> It really doesn't matter much what works for you, and it doesn't matter
> what works for me either. The point is: What works for most users?
Obviously, that was my point as well ;-)
>> I'm quite unfamiliar with the color coding of git (I hadn't enabled that
>> option), I suppose consistency would be better, but then you'd have to
>> add some code to figure out which color is used for what in git's output
>> and convert that to the code setting the colors here.
>
> As a starter, you could use the default colors which git uses. Querying
> git for the colors could be the next, optional step.
I suppose it would be a start.
so how should it be?
all committed: green branch, no characters
only staged changes: green branch, colored characters (yellow/red?)
only unstaged changes: red/yellow branch, colored characters (red)
staged and unstaged changes: red/yellow branch, multiple characters in
red/yellow?)
detached head: red commit-sha1 (abbrev.), characters as above?
What is the most useful thing to show in case of a detached head?
-the commit hash of current head?
-"detached head"
>
>> As for the characters used, I think there's a good reason not to use the
>> ones git uses in the prompt. The characters in git status output are put
>> in front of the files they apply to, in the prompt you only get a
>> summarized output. And perhaps that argument could be extended to the
>> use of the colors as well, I prefer to know whether I have uncommitted
>> changes and in that category I want to know whether I already staged
>> them or not.
>
> Well, sure. The prompt could show any of AMCRD if you have any of those
> changes. * + are shortcuts saying you have any of those.
How do you suppose that should work?
Add another configuration parameter like GIT_PS1_SHOWSTATUSSBCHARS
(please give a better suggestion ;-) or the other way around
GIT_PS1_SHOWSTARPLUS (either of which could be the default)
>>> I think it's very confusing to have completely different schemes (not
>>> just themes) for two versions of the same information: concise status
>>> information.
>>>
>>> So, please try and follow "git status -sb".
>>
>> I think there are different levels of conciseness. And I see "git status
>> -sb" uses green for staged modified files, which would be confusing to me.
>
> ...only because you don't know the color coding scheme. It's green
> because those changes are saved somewhere (in the index) and would even
> survice a branch switch.
I suppose you could see that as green (I usually view a yellow traffic
light as green as well ;-)
Isn't it best practice to commit the staged changes ASAP? (But let's not
diverge in this thread to discuss best-practices, so consider that a
rhetorical question for now ;-)
> No, I said red for unstaged, green for staged for the characters, i.e. a
> * would always be red if present, a + always green if present.
>
> For the "branch name", it would be red for detached head and green for
> checked out branch.
using green for staged changes could be acceptable for me, but I'm
slightly worried that a colored character would be too slight a hint.
OTOH, a detached head would show up with or without color...
>
>> Perhaps, but that would be confusing to me ;-)
>
> If that is case, you can try and propose changing that scheme...
>
> But there's really a good reason for it. Cached (staged) changes are
> "safe" because they are saved in the index, and also they are "good to
> go into the next commit", i.e. the commit traffic lights are green!
I suppose I knew that in the back of my mind, but not as clearly as you
spell it out here... Tnx!
/Simon
next prev parent reply other threads:[~2012-10-15 10:41 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-26 15:00 bash completion with colour hints Simon Oosthoek
2012-09-26 15:24 ` Ramkumar Ramachandra
2012-09-26 19:25 ` Simon Oosthoek
2012-09-27 6:53 ` Junio C Hamano
2012-09-27 8:53 ` Michael J Gruber
2012-09-27 8:55 ` Michael J Gruber
2012-09-27 9:16 ` Simon Oosthoek
2012-09-27 10:05 ` Andreas Schwab
2012-09-27 11:57 ` Simon Oosthoek
2012-09-28 11:40 ` [PATCH] Add __git_ps1_pc to use as PROMPT_COMMAND Simon Oosthoek
2012-09-28 17:58 ` Junio C Hamano
2012-10-01 9:13 ` Simon Oosthoek
2012-10-01 17:16 ` Junio C Hamano
2012-10-01 18:42 ` Simon Oosthoek
2012-10-01 19:13 ` Junio C Hamano
2012-10-01 19:27 ` Simon Oosthoek
2012-10-01 19:54 ` Junio C Hamano
2012-10-01 20:56 ` Simon Oosthoek
2012-10-01 21:09 ` Junio C Hamano
2012-10-02 7:38 ` Michael J Gruber
2012-10-02 8:01 ` Simon Oosthoek
2012-10-02 17:01 ` Junio C Hamano
2012-10-02 19:50 ` Simon Oosthoek
2012-10-02 20:18 ` Junio C Hamano
2012-10-05 21:09 ` [PATCH 1/2] Allow __git_ps1 to be used in PROMPT_COMMAND Simon Oosthoek
2012-10-08 18:12 ` Junio C Hamano
2012-10-08 19:50 ` Simon Oosthoek
2012-10-08 21:17 ` Junio C Hamano
2012-10-10 19:31 ` Simon Oosthoek
2012-10-10 23:00 ` Junio C Hamano
2012-10-10 19:32 ` [PATCH 2/2] show color hints based on state of the git tree Simon Oosthoek
2012-10-10 19:37 ` [PATCH 1/2] Allow __git_ps1 to be used in PROMPT_COMMAND Simon Oosthoek
2012-10-10 19:38 ` [PATCH 2/2] show color hints based on state of the git tree Simon Oosthoek
2012-10-05 21:10 ` Simon Oosthoek
2012-10-15 8:23 ` Michael J Gruber
2012-10-15 9:01 ` Simon Oosthoek
2012-10-15 9:13 ` Michael J Gruber
2012-10-15 10:34 ` Simon Oosthoek [this message]
2012-10-15 13:20 ` Simon Oosthoek
2012-10-15 15:19 ` Michael J Gruber
[not found] ` <CAPc5daVUyAuznmrT+-yqvPR0gd38oiWmi2k+BFVV1s9ouMUt0Q@mail.gmail.com>
2012-10-15 15:15 ` Simon Oosthoek
2012-10-15 18:10 ` Junio C Hamano
2012-10-16 5:32 ` [PATCH 3/3] Change colors to be based on git status -sb in color mode Simon Oosthoek
2012-10-16 15:58 ` Junio C Hamano
2012-10-16 19:34 ` Simon Oosthoek
2012-10-16 21:30 ` Junio C Hamano
2012-10-16 22:04 ` Junio C Hamano
2012-10-17 7:17 ` Simon Oosthoek
2012-10-08 15:00 ` [PATCH] Add __git_ps1_pc to use as PROMPT_COMMAND Simon Oosthoek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=507BE6B0.4020306@nieuwland.nl \
--to=soosthoek@nieuwland.nl \
--cc=artagnon@gmail.com \
--cc=git@drmicha.warpmail.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=s.oosthoek@xs4all.nl \
--cc=schwab@linux-m68k.org \
--cc=spearce@spearce.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).