Re: [PATCH] wt-status.c: Modified status message shown for a parent-less branch

2 messages, 2 authors, 2017-06-12 · open the first message on its own page

Re: [PATCH] wt-status.c: Modified status message shown for a parent-less branch

From: Junio C Hamano <hidden>
Date: 2017-06-10 11:02:36

Jeff King [off-list ref] writes:
On Sat, Jun 10, 2017 at 02:14:01PM +0530, Kaartic Sivaraam wrote:
...
quoted
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
#
# Waiting for initial commit
#
# Changes to be committed:
#       new file:   test-file
#

Looks odd. Not sure how to fix this. Maybe on of the alternatives have
to be considered. "Your current branch does not have any commits" seems
a good one.
We could also add an option to "struct wt_status" to differentiate the
two cases.

I had forgotten completely that this would affect git-commit. And that
explains the "Initial commit" text in the first place. This output
originated as the git-commit template message, and only later was moved
into the git-status command. And in the context of making a commit,
saying "This is the initial commit" makes a lot of sense.

And it probably does mean we want separate messages for status and
commit. One is "if you were to make a commit, it would be the first".
The other is "you are making the first commit".
Again, you said what I wanted to say in my review comment a lot
better than I managed to say ;-)

When the current message "Initial commit" is read in the context
together with "Changes to be committed", etc., by users of "git
commit" who do not use the "-m message" option, it is clear that
these are talking about the commit the user is about to make.  

The confusion factor that triggered the discussion in the thread
that resulted in this patch exists because the output from "git
status" uses phrases that are designed to guide the user in working
toward creating the next commit on the branch, even though the user
may not be thinking in terms of "what would happen when I say
'commit' now?"

And I do not think the potential confusion is limited to "Initial
commit" from that point of view.  The files listed in "Changes to be
committed" list are not files to be "committed", UNLESS the user is
aware that s/he is asking "what would happen when I say 'commit'
now?".  When the question is "what is the status of my working area?",
that phrase in the section header is suboptimal.

Adding a bit to "struct wt_status" is a good first step to allow all
three (i.e. in addition to "Initial commit" and "Changes to be
committed", "Changes not staged for commit" is the other one that
shares this potential confusion factor) to be phrased in a way that
is more appropriate in an answer to the question "what is the status
of my working area?", I would think.

Thanks.

Re: [PATCH] wt-status.c: Modified status message shown for a parent-less branch

From: Kaartic Sivaraam <hidden>
Date: 2017-06-12 08:10:35

On Sat, 2017-06-10 at 20:02 +0900, Junio C Hamano wrote:
Again, you said what I wanted to say in my review comment a lot
better than I managed to say ;-)

When the current message "Initial commit" is read in the context
together with "Changes to be committed", etc., by users of "git
commit" who do not use the "-m message" option, it is clear that
these are talking about the commit the user is about to make.  

The confusion factor that triggered the discussion in the thread
that resulted in this patch exists because the output from "git
status" uses phrases that are designed to guide the user in working
toward creating the next commit on the branch, even though the user
may not be thinking in terms of "what would happen when I say
'commit' now?"

And I do not think the potential confusion is limited to "Initial
commit" from that point of view.  The files listed in "Changes to be
committed" list are not files to be "committed", UNLESS the user is
aware that s/he is asking "what would happen when I say 'commit'
now?".  When the question is "what is the status of my working
area?",
that phrase in the section header is suboptimal.

Adding a bit to "struct wt_status" is a good first step to allow all
three (i.e. in addition to "Initial commit" and "Changes to be
committed", "Changes not staged for commit" is the other one that
shares this potential confusion factor) to be phrased in a way that
is more appropriate in an answer to the question "what is the status
of my working area?", I would think.

Thanks.
It seems that the current change has to be discarded altogether and
further the change required doesn't look trivial. This seems to warrant
some bit of research of the code base. As a first step I would like to
know which part of the code base creates the commit template. I guess
much can't be done without knowing how it's created.

-- 
Regards,
Kaartic Sivaraam [off-list ref]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help